Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Aug 2025 16:24:51 +0300
From:      Dima Panov <fluffy@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org,  dev-commits-src-main@FreeBSD.org, Lexi Winter <ivy@FreeBSD.org>
Subject:   git: 7ac276298b72 - main - Remove Secure RPC DES authentication
Message-ID:  <8e7a9c07-5efd-4450-a590-a6aeaa59b402@Canary>
In-Reply-To: <851c968c-923a-4809-83d4-b0600e70867b@Canary>
References:  <202508101537.57AFbHrI067216@gitrepo.freebsd.org> <851c968c-923a-4809-83d4-b0600e70867b@Canary>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
All xservers are affected.

However, upstream already deal with it in commit https://gitlab.freedesktop.org/xorg/xserver/-/commit/71b207a2ebc1465c7d9ad9262f60930f6a1d42ee

--
Dima. (desktop, kde, x11, office, ports-secteam)@FreeBSD team
(fluffy@FreeBSD.org, https://t.me/FluffyBSD)

> On вторник, авг. 12, 2025 at 1:41 PM, Dima Panov <fluffy@FreeBSD.org (mailto:fluffy@FreeBSD.org)> wrote:
> Hello!
>
> This commit breaks x11-server/xwayland
>
> FAILED: os/liblibxserver_os.a.p/rpcauth.c.o cc -Ios/liblibxserver_os.a.p -Ios -I../os -I. -I.. -IXext -I../Xext -IXi -I../Xi -Icomposite -I../composite -Idamageext -I../damageext -Ifb -I../fb -Iglamor -I../glamor -Imi -I../mi -Imiext/damage -I../miext/damage -Imiext/sync -I../miext/sync -Idbe -I../dbe -Idix -I../dix -Idri3 -I../dri3 -Iinclude -I../include -Ipresent -I../present -Irandr -I../randr -Irender -I../render -Ixfixes -I../xfixes -I/usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -fdiagnostics-color=never -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -DHAVE_DIX_CONFIG_H -fno-strict-aliasing -fvisibility=hidden -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -D_THREAD_SAFE -D_DEFAULT_SOURCE -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -DCLIENTIDS -MD -MQ os/liblibxserver_os.a.p/rpcauth.c.o -MF os/liblibxserver_os.a.p/rpcauth.c.o.d -o os/liblibxserver_os.a.p/rpcauth.c.o -c ../os/rpcauth.c ../os/rpcauth.c:110:52: error: incomplete definition of type 'struct authdes_cred' 110 | return (((struct authdes_cred *) r.rq_clntcred)->adc_fullname.name); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ ../os/rpcauth.c:110:22: note: forward declaration of 'struct authdes_cred' 110 | return (((struct authdes_cred *) r.rq_clntcred)->adc_fullname.name); | ^ 1 error generated.
>
>
> --
> Dima. (desktop, kde, x11, office, ports-secteam)@FreeBSD team
> (fluffy@FreeBSD.org, https://t.me/FluffyBSD)
>
>
>
> > On воскресенье, авг. 10, 2025 at 6:37 PM, Lexi Winter <ivy@FreeBSD.org (mailto:ivy@FreeBSD.org)> wrote:
> > The branch main has been updated by ivy:
> >
> > URL: https://cgit.FreeBSD.org/src/commit/?id=7ac276298b72982189ac1a5b17461936dc00163e
> >
> > commit 7ac276298b72982189ac1a5b17461936dc00163e
> > Author: Lexi Winter <ivy@FreeBSD.org>
> > AuthorDate: 2025-08-10 12:57:36 +0000
> > Commit: Lexi Winter <ivy@FreeBSD.org>
> > CommitDate: 2025-08-10 15:36:40 +0000
> >
> > Remove Secure RPC DES authentication
> >
> > Following the earlier removal of keyserv, none of this functionality
> > works since it requires keyserv.
> >
> > Remove the relevant symbols from libc's Symbol.map. Leave compatibility
> > symbols for existing applications, but since the functions don't work
> > without keyserv, stub them out to return an error.
> >
> > Remove some private symbols that were only used by keyserv; these don't
> > get compatibility symbols.
> >
> > Remove the documentation for the old functions.
> >
> > Remove rpc.ypupdated since it requires DES authentication.
> >
> > Reviewed by: manu, des, emaste
> > Differential Revision: https://reviews.freebsd.org/D50442
> > ---
> > ObsoleteFiles.inc | 4 +
> > include/rpc/auth_des.h | 79 +----
> > lib/libc/rpc/Symbol.map | 19 --
> > lib/libc/rpc/auth_des.c | 455 +----------------------------
> > lib/libc/rpc/authdes_prot.c | 44 +--
> > lib/libc/rpc/key_call.c | 424 +++------------------------
> > lib/libc/rpc/publickey.5 | 40 ---
> > lib/libc/rpc/rpc_secure.3 | 177 +-----------
> > lib/libc/rpc/rpc_soc.3 | 13 +-
> > lib/libc/rpc/rpc_soc.c | 31 +-
> > lib/libc/rpc/svc_auth.c | 8 -
> > lib/libc/rpc/svc_auth_des.c | 460 +-----------------------------
> > lib/librpcsvc/Makefile | 2 +-
> > lib/librpcsvc/yp_update.c | 199 -------------
> > libexec/rc/rc.conf | 1 -
> > libexec/rc/rc.d/Makefile | 1 -
> > libexec/rc/rc.d/ypupdated | 35 ---
> > share/man/man5/rc.conf.5 | 9 +-
> > sys/rpc/auth.h | 26 --
> > tools/build/mk/OptionalObsoleteFiles.inc | 2 -
> > usr.sbin/Makefile | 1 -
> > usr.sbin/rpc.ypupdated/Makefile | 32 ---
> > usr.sbin/rpc.ypupdated/Makefile.depend | 18 --
> > usr.sbin/rpc.ypupdated/update.c | 328 ---------------------
> > usr.sbin/rpc.ypupdated/yp_dbdelete.c | 68 -----
> > usr.sbin/rpc.ypupdated/yp_dbupdate.c | 147 ----------
> > usr.sbin/rpc.ypupdated/ypupdate | 32 ---
> > usr.sbin/rpc.ypupdated/ypupdated_extern.h | 32 ---
> > usr.sbin/rpc.ypupdated/ypupdated_main.c | 287 -------------------
> > usr.sbin/rpc.ypupdated/ypupdated_server.c | 227 ---------------
> > 30 files changed, 83 insertions(+), 3118 deletions(-)
> >
> > diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
> > index ec324e82f86d..a6662d31829f 100644
> > --- a/ObsoleteFiles.inc
> > +++ b/ObsoleteFiles.inc
> > @@ -51,6 +51,10 @@
> > # xargs -n1 | sort | uniq -d;
> > # done
> >
> > +# 20250810: Removal of remaining Secure RPC (DES) bits
> > +OLD_FILES+=usr/sbin/rpc.ypupdated
> > +OLD_FILES+=etc/rc.d/ypupdated
> > +
> > # 20250808: nvmfd removed from base install
> > OLD_FILES+=usr/sbin/nvmfd
> > OLD_FILES+=usr/share/man/man8/nvmfd.8.gz
> > diff --git a/include/rpc/auth_des.h b/include/rpc/auth_des.h
> > index 0ff43c13139b..1b4943a74b8b 100644
> > --- a/include/rpc/auth_des.h
> > +++ b/include/rpc/auth_des.h
> > @@ -33,91 +33,14 @@
> > * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
> > */
> >
> > -/*
> > - * auth_des.h, Protocol for DES style authentication for RPC
> > - */
> > +/* Note, RPC DES authentication was removed in FreeBSD 15.0. */
> >
> > #ifndef _AUTH_DES_
> > #define _AUTH_DES_
> >
> > -/*
> > - * There are two kinds of "names": fullnames and nicknames
> > - */
> > -enum authdes_namekind {
> > - ADN_FULLNAME,
> > - ADN_NICKNAME
> > -};
> > -
> > -/*
> > - * A fullname contains the network name of the client,
> > - * a conversation key and the window
> > - */
> > -struct authdes_fullname {
> > - char *name; /* network name of client, up to MAXNETNAMELEN */
> > - des_block key; /* conversation key */
> > - u_long window; /* associated window */
> > -};
> > -
> > -
> > -/*
> > - * A credential
> > - */
> > -struct authdes_cred {
> > - enum authdes_namekind adc_namekind;
> > - struct authdes_fullname adc_fullname;
> > - u_long adc_nickname;
> > -};
> > -
> > -
> > -
> > -/*
> > - * A des authentication verifier
> > - */
> > -struct authdes_verf {
> > - union {
> > - struct timeval adv_ctime; /* clear time */
> > - des_block adv_xtime; /* crypt time */
> > - } adv_time_u;
> > - u_long adv_int_u;
> > -};
> > -
> > -/*
> > - * des authentication verifier: client variety
> > - *
> > - * adv_timestamp is the current time.
> > - * adv_winverf is the credential window + 1.
> > - * Both are encrypted using the conversation key.
> > - */
> > -#define adv_timestamp adv_time_u.adv_ctime
> > -#define adv_xtimestamp adv_time_u.adv_xtime
> > -#define adv_winverf adv_int_u
> > -
> > -/*
> > - * des authentication verifier: server variety
> > - *
> > - * adv_timeverf is the client's timestamp + client's window
> > - * adv_nickname is the server's nickname for the client.
> > - * adv_timeverf is encrypted using the conversation key.
> > - */
> > -#define adv_timeverf adv_time_u.adv_ctime
> > -#define adv_xtimeverf adv_time_u.adv_xtime
> > -#define adv_nickname adv_int_u
> > -
> > -/*
> > - * Map a des credential into a unix cred.
> > - *
> > - */
> > -__BEGIN_DECLS
> > -extern int authdes_getucred( struct authdes_cred *, uid_t *, gid_t *, int *, gid_t * );
> > -__END_DECLS
> > -
> > __BEGIN_DECLS
> > -extern bool_t xdr_authdes_cred(XDR *, struct authdes_cred *);
> > -extern bool_t xdr_authdes_verf(XDR *, struct authdes_verf *);
> > extern int rtime(dev_t, struct netbuf *, int, struct timeval *,
> > struct timeval *);
> > -extern void kgetnetname(char *);
> > -extern enum auth_stat _svcauth_des(struct svc_req *, struct rpc_msg *);
> > __END_DECLS
> >
> > #endif /* ndef _AUTH_DES_ */
> > diff --git a/lib/libc/rpc/Symbol.map b/lib/libc/rpc/Symbol.map
> > index 105d6fb6b54e..61e8e084b1e0 100644
> > --- a/lib/libc/rpc/Symbol.map
> > +++ b/lib/libc/rpc/Symbol.map
> > @@ -8,13 +8,9 @@ FBSD_1.0 {
> > xdr_desargs;
> > xdr_desresp;
> >
> > - authdes_seccreate;
> > - authdes_pk_seccreate;
> > authnone_create;
> > authunix_create;
> > authunix_create_default;
> > - xdr_authdes_cred;
> > - xdr_authdes_verf;
> > xdr_authunix_parms;
> > bindresvport;
> > bindresvport_sa;
> > @@ -58,15 +54,6 @@ FBSD_1.0 {
> > endrpcent;
> > getrpcent;
> > getrpcport;
> > - key_setsecret;
> > - key_secretkey_is_set;
> > - key_encryptsession_pk;
> > - key_decryptsession_pk;
> > - key_encryptsession;
> > - key_decryptsession;
> > - key_gendes;
> > - key_setnet;
> > - key_get_conv;
> > xdr_keystatus;
> > xdr_keybuf;
> > xdr_netnamestr;
> > @@ -130,7 +117,6 @@ FBSD_1.0 {
> > callrpc;
> > registerrpc;
> > clnt_broadcast;
> > - authdes_create;
> > clntunix_create;
> > svcunix_create;
> > svcunixfd_create;
> > @@ -180,8 +166,6 @@ FBSD_1.0 {
> > _authenticate;
> > _svcauth_null;
> > svc_auth_reg;
> > - _svcauth_des;
> > - authdes_getucred;
> > _svcauth_unix;
> > _svcauth_short;
> > svc_dg_create;
> > @@ -205,9 +189,6 @@ FBSD_1.8 {
> >
> > FBSDprivate_1.0 {
> > __des_crypt_LOCAL;
> > - __key_encryptsession_pk_LOCAL;
> > - __key_decryptsession_pk_LOCAL;
> > - __key_gendes_LOCAL;
> > __svc_clean_idle;
> > __rpc_gss_unwrap;
> > __rpc_gss_unwrap_stub;
> > diff --git a/lib/libc/rpc/auth_des.c b/lib/libc/rpc/auth_des.c
> > index c9b20de25cda..754d55cbed3e 100644
> > --- a/lib/libc/rpc/auth_des.c
> > +++ b/lib/libc/rpc/auth_des.c
> > @@ -30,463 +30,34 @@
> > /*
> > * Copyright (c) 1988 by Sun Microsystems, Inc.
> > */
> > +
> > /*
> > - * auth_des.c, client-side implementation of DES authentication
> > + * Secure RPC DES authentication was removed in FreeBSD 15.0.
> > + * These symbols are provided for backward compatibility, but provide no
> > + * functionality and will always return an error.
> > */
> >
> > #include "namespace.h"
> > #include "reentrant.h"
> > -#include <err.h>
> > -#include <errno.h>
> > -#include <string.h>
> > -#include <stdlib.h>
> > -#include <unistd.h>
> > -#include <rpc/des_crypt.h>
> > -#include <syslog.h>
> > #include <rpc/types.h>
> > #include <rpc/auth.h>
> > #include <rpc/auth_des.h>
> > -#include <rpc/clnt.h>
> > -#include <rpc/xdr.h>
> > -#include <sys/socket.h>
> > -#undef NIS
> > #include <rpcsvc/nis.h>
> > #include "un-namespace.h"
> > -#include "mt_misc.h"
> > -
> > -#define USEC_PER_SEC 1000000
> > -#define RTIME_TIMEOUT 5 /* seconds to wait for sync */
> > -
> > -#define AUTH_PRIVATE(auth) (struct ad_private *) auth->ah_private
> > -#define ALLOC(object_type) (object_type *) mem_alloc(sizeof(object_type))
> > -#define FREE(ptr, size) mem_free((char *)(ptr), (int) size)
> > -#define ATTEMPT(xdr_op) if (!(xdr_op)) return (FALSE)
> > -
> > -extern bool_t xdr_authdes_cred( XDR *, struct authdes_cred *);
> > -extern bool_t xdr_authdes_verf( XDR *, struct authdes_verf *);
> > -extern int key_encryptsession_pk(char *, netobj *, des_block *);
> > -
> > -extern bool_t __rpc_get_time_offset(struct timeval *, nis_server *, char *,
> > - char **, char **);
> >
> > -/*
> > - * DES authenticator operations vector
> > - */
> > -static void authdes_nextverf(AUTH *);
> > -static bool_t authdes_marshal(AUTH *, XDR *);
> > -static bool_t authdes_validate(AUTH *, struct opaque_auth *);
> > -static bool_t authdes_refresh(AUTH *, void *);
> > -static void authdes_destroy(AUTH *);
> > -
> > -static struct auth_ops *authdes_ops(void);
> > -
> > -/*
> > - * This struct is pointed to by the ah_private field of an "AUTH *"
> > - */
> > -struct ad_private {
> > - char *ad_fullname; /* client's full name */
> > - u_int ad_fullnamelen; /* length of name, rounded up */
> > - char *ad_servername; /* server's full name */
> > - u_int ad_servernamelen; /* length of name, rounded up */
> > - u_int ad_window; /* client specified window */
> > - bool_t ad_dosync; /* synchronize? */
> > - struct netbuf ad_syncaddr; /* remote host to synch with */
> > - char *ad_timehost; /* remote host to synch with */
> > - struct timeval ad_timediff; /* server's time - client's time */
> > - u_int ad_nickname; /* server's nickname for client */
> > - struct authdes_cred ad_cred; /* storage for credential */
> > - struct authdes_verf ad_verf; /* storage for verifier */
> > - struct timeval ad_timestamp; /* timestamp sent */
> > - des_block ad_xkey; /* encrypted conversation key */
> > - u_char ad_pkey[1024]; /* Server's actual public key */
> > - char *ad_netid; /* Timehost netid */
> > - char *ad_uaddr; /* Timehost uaddr */
> > - nis_server *ad_nis_srvr; /* NIS+ server struct */
> > -};
> > -
> > -AUTH *authdes_pk_seccreate(const char *, netobj *, u_int, const char *,
> > - const des_block *, nis_server *);
> > -
> > -/*
> > - * documented version of authdes_seccreate
> > - */
> > -/*
> > - servername: network name of server
> > - win: time to live
> > - timehost: optional hostname to sync with
> > - ckey: optional conversation key to use
> > -*/
> > -
> > -AUTH *
> > -authdes_seccreate(const char *servername, const u_int win,
> > +static AUTH *
> > +__authdes_seccreate(const char *servername, const u_int win,
> > const char *timehost, const des_block *ckey)
> > {
> > - u_char pkey_data[1024];
> > - netobj pkey;
> > - AUTH *dummy;
> > -
> > - if (! getpublickey(servername, (char *) pkey_data)) {
> > - syslog(LOG_ERR,
> > - "authdes_seccreate: no public key found for %s",
> > - servername);
> > - return (NULL);
> > - }
> > -
> > - pkey.n_bytes = (char *) pkey_data;
> > - pkey.n_len = (u_int)strlen((char *)pkey_data) + 1;
> > - dummy = authdes_pk_seccreate(servername, &pkey, win, timehost,
> > - ckey, NULL);
> > - return (dummy);
> > -}
> > -
> > -/*
> > - * Slightly modified version of authdessec_create which takes the public key
> > - * of the server principal as an argument. This spares us a call to
> > - * getpublickey() which in the nameserver context can cause a deadlock.
> > - */
> > -AUTH *
> > -authdes_pk_seccreate(const char *servername, netobj *pkey, u_int window,
> > - const char *timehost, const des_block *ckey, nis_server *srvr)
> > -{
> > - AUTH *auth;
> > - struct ad_private *ad;
> > - char namebuf[MAXNETNAMELEN+1];
> > -
> > - /*
> > - * Allocate everything now
> > - */
> > - auth = ALLOC(AUTH);
> > - if (auth == NULL) {
> > - syslog(LOG_ERR, "authdes_pk_seccreate: out of memory");
> > - return (NULL);
> > - }
> > - ad = ALLOC(struct ad_private);
> > - if (ad == NULL) {
> > - syslog(LOG_ERR, "authdes_pk_seccreate: out of memory");
> > - goto failed;
> > - }
> > - ad->ad_fullname = ad->ad_servername = NULL; /* Sanity reasons */
> > - ad->ad_timehost = NULL;
> > - ad->ad_netid = NULL;
> > - ad->ad_uaddr = NULL;
> > - ad->ad_nis_srvr = NULL;
> > - ad->ad_timediff.tv_sec = 0;
> > - ad->ad_timediff.tv_usec = 0;
> > - memcpy(ad->ad_pkey, pkey->n_bytes, pkey->n_len);
> > - if (!getnetname(namebuf))
> > - goto failed;
> > - ad->ad_fullnamelen = RNDUP((u_int) strlen(namebuf));
> > - ad->ad_fullname = (char *)mem_alloc(ad->ad_fullnamelen + 1);
> > - ad->ad_servernamelen = strlen(servername);
> > - ad->ad_servername = (char *)mem_alloc(ad->ad_servernamelen + 1);
> > -
> > - if (ad->ad_fullname == NULL || ad->ad_servername == NULL) {
> > - syslog(LOG_ERR, "authdes_seccreate: out of memory");
> > - goto failed;
> > - }
> > - if (timehost != NULL) {
> > - ad->ad_timehost = (char *)mem_alloc(strlen(timehost) + 1);
> > - if (ad->ad_timehost == NULL) {
> > - syslog(LOG_ERR, "authdes_seccreate: out of memory");
> > - goto failed;
> > - }
> > - memcpy(ad->ad_timehost, timehost, strlen(timehost) + 1);
> > - ad->ad_dosync = TRUE;
> > - } else if (srvr != NULL) {
> > - ad->ad_nis_srvr = srvr; /* transient */
> > - ad->ad_dosync = TRUE;
> > - } else {
> > - ad->ad_dosync = FALSE;
> > - }
> > - memcpy(ad->ad_fullname, namebuf, ad->ad_fullnamelen + 1);
> > - memcpy(ad->ad_servername, servername, ad->ad_servernamelen + 1);
> > - ad->ad_window = window;
> > - if (ckey == NULL) {
> > - if (key_gendes(&auth->ah_key) < 0) {
> > - syslog(LOG_ERR,
> > - "authdes_seccreate: keyserv(1m) is unable to generate session key");
> > - goto failed;
> > - }
> > - } else {
> > - auth->ah_key = *ckey;
> > - }
> > -
> > - /*
> > - * Set up auth handle
> > - */
> > - auth->ah_cred.oa_flavor = AUTH_DES;
> > - auth->ah_verf.oa_flavor = AUTH_DES;
> > - auth->ah_ops = authdes_ops();
> > - auth->ah_private = (caddr_t)ad;
> > -
> > - if (!authdes_refresh(auth, NULL)) {
> > - goto failed;
> > - }
> > - ad->ad_nis_srvr = NULL; /* not needed any longer */
> > - return (auth);
> > -
> > -failed:
> > - if (auth)
> > - FREE(auth, sizeof (AUTH));
> > - if (ad) {
> > - if (ad->ad_fullname)
> > - FREE(ad->ad_fullname, ad->ad_fullnamelen + 1);
> > - if (ad->ad_servername)
> > - FREE(ad->ad_servername, ad->ad_servernamelen + 1);
> > - if (ad->ad_timehost)
> > - FREE(ad->ad_timehost, strlen(ad->ad_timehost) + 1);
> > - if (ad->ad_netid)
> > - FREE(ad->ad_netid, strlen(ad->ad_netid) + 1);
> > - if (ad->ad_uaddr)
> > - FREE(ad->ad_uaddr, strlen(ad->ad_uaddr) + 1);
> > - FREE(ad, sizeof (struct ad_private));
> > - }
> > return (NULL);
> > }
> > +__sym_compat(authdes_seccreate, __authdes_seccreate, FBSD_1.0);
> >
> > -/*
> > - * Implement the five authentication operations
> > - */
> > -
> > -
> > -/*
> > - * 1. Next Verifier
> > - */
> > -/*ARGSUSED*/
> > -static void
> > -authdes_nextverf(AUTH *auth __unused)
> > +static AUTH *
> > +__authdes_pk_seccreate(const char *servername __unused, netobj *pkey __unused,
> > + u_int window __unused, const char *timehost __unused,
> > + const des_block *ckey __unused, nis_server *srvr __unused)
> > {
> > - /* what the heck am I supposed to do??? */
> > -}
> > -
> > -
> > -/*
> > - * 2. Marshal
> > - */
> > -static bool_t
> > -authdes_marshal(AUTH *auth, XDR *xdrs)
> > -{
> > -/* LINTED pointer alignment */
> > - struct ad_private *ad = AUTH_PRIVATE(auth);
> > - struct authdes_cred *cred = &ad->ad_cred;
> > - struct authdes_verf *verf = &ad->ad_verf;
> > - des_block cryptbuf[2];
> > - des_block ivec;
> > - int status;
> > - int len;
> > - rpc_inline_t *ixdr;
> > -
> > - /*
> > - * Figure out the "time", accounting for any time difference
> > - * with the server if necessary.
> > - */
> > - (void)gettimeofday(&ad->ad_timestamp, NULL);
> > - ad->ad_timestamp.tv_sec += ad->ad_timediff.tv_sec;
> > - ad->ad_timestamp.tv_usec += ad->ad_timediff.tv_usec;
> > - while (ad->ad_timestamp.tv_usec >= USEC_PER_SEC) {
> > - ad->ad_timestamp.tv_usec -= USEC_PER_SEC;
> > - ad->ad_timestamp.tv_sec++;
> > - }
> > -
> > - /*
> > - * XDR the timestamp and possibly some other things, then
> > - * encrypt them.
> > - */
> > - ixdr = (rpc_inline_t *)cryptbuf;
> > - IXDR_PUT_INT32(ixdr, ad->ad_timestamp.tv_sec);
> > - IXDR_PUT_INT32(ixdr, ad->ad_timestamp.tv_usec);
> > - if (ad->ad_cred.adc_namekind == ADN_FULLNAME) {
> > - IXDR_PUT_U_INT32(ixdr, ad->ad_window);
> > - IXDR_PUT_U_INT32(ixdr, ad->ad_window - 1);
> > - ivec.key.high = ivec.key.low = 0;
> > - status = cbc_crypt((char *)&auth->ah_key, (char *)cryptbuf,
> > - (u_int) 2 * sizeof (des_block),
> > - DES_ENCRYPT | DES_HW, (char *)&ivec);
> > - } else {
> > - status = ecb_crypt((char *)&auth->ah_key, (char *)cryptbuf,
> > - (u_int) sizeof (des_block),
> > - DES_ENCRYPT | DES_HW);
> > - }
> > - if (DES_FAILED(status)) {
> > - syslog(LOG_ERR, "authdes_marshal: DES encryption failure");
> > - return (FALSE);
> > - }
> > - ad->ad_verf.adv_xtimestamp = cryptbuf[0];
> > - if (ad->ad_cred.adc_namekind == ADN_FULLNAME) {
> > - ad->ad_cred.adc_fullname.window = cryptbuf[1].key.high;
> > - ad->ad_verf.adv_winverf = cryptbuf[1].key.low;
> > - } else {
> > - ad->ad_cred.adc_nickname = ad->ad_nickname;
> > - ad->ad_verf.adv_winverf = 0;
> > - }
> > -
> > - /*
> > - * Serialize the credential and verifier into opaque
> > - * authentication data.
> > - */
> > - if (ad->ad_cred.adc_namekind == ADN_FULLNAME) {
> > - len = ((1 + 1 + 2 + 1)*BYTES_PER_XDR_UNIT + ad->ad_fullnamelen);
> > - } else {
> > - len = (1 + 1)*BYTES_PER_XDR_UNIT;
> > - }
> > -
> > - if ((ixdr = xdr_inline(xdrs, 2*BYTES_PER_XDR_UNIT))) {
> > - IXDR_PUT_INT32(ixdr, AUTH_DES);
> > - IXDR_PUT_INT32(ixdr, len);
> > - } else {
> > - ATTEMPT(xdr_putint32(xdrs, (int *)&auth->ah_cred.oa_flavor));
> > - ATTEMPT(xdr_putint32(xdrs, &len));
> > - }
> > - ATTEMPT(xdr_authdes_cred(xdrs, cred));
> > -
> > - len = (2 + 1)*BYTES_PER_XDR_UNIT;
> > - if ((ixdr = xdr_inline(xdrs, 2*BYTES_PER_XDR_UNIT))) {
> > - IXDR_PUT_INT32(ixdr, AUTH_DES);
> > - IXDR_PUT_INT32(ixdr, len);
> > - } else {
> > - ATTEMPT(xdr_putint32(xdrs, (int *)&auth->ah_verf.oa_flavor));
> > - ATTEMPT(xdr_putint32(xdrs, &len));
> > - }
> > - ATTEMPT(xdr_authdes_verf(xdrs, verf));
> > - return (TRUE);
> > -}
> > -
> > -
> > -/*
> > - * 3. Validate
> > - */
> > -static bool_t
> > -authdes_validate(AUTH *auth, struct opaque_auth *rverf)
> > -{
> > -/* LINTED pointer alignment */
> > - struct ad_private *ad = AUTH_PRIVATE(auth);
> > - struct authdes_verf verf;
> > - int status;
> > - uint32_t *ixdr;
> > - des_block buf;
> > -
> > - if (rverf->oa_length != (2 + 1) * BYTES_PER_XDR_UNIT) {
> > - return (FALSE);
> > - }
> > -/* LINTED pointer alignment */
> > - ixdr = (uint32_t *)rverf->oa_base;
> > - buf.key.high = (uint32_t)*ixdr++;
> > - buf.key.low = (uint32_t)*ixdr++;
> > - verf.adv_int_u = (uint32_t)*ixdr++;
> > -
> > - /*
> > - * Decrypt the timestamp
> > - */
> > - status = ecb_crypt((char *)&auth->ah_key, (char *)&buf,
> > - (u_int)sizeof (des_block), DES_DECRYPT | DES_HW);
> > -
> > - if (DES_FAILED(status)) {
> > - syslog(LOG_ERR, "authdes_validate: DES decryption failure");
> > - return (FALSE);
> > - }
> > -
> > - /*
> > - * xdr the decrypted timestamp
> > - */
> > -/* LINTED pointer alignment */
> > - ixdr = (uint32_t *)buf.c;
> > - verf.adv_timestamp.tv_sec = IXDR_GET_INT32(ixdr) + 1;
> > - verf.adv_timestamp.tv_usec = IXDR_GET_INT32(ixdr);
> > -
> > - /*
> > - * validate
> > - */
> > - if (bcmp((char *)&ad->ad_timestamp, (char *)&verf.adv_timestamp,
> > - sizeof(struct timeval)) != 0) {
> > - syslog(LOG_DEBUG, "authdes_validate: verifier mismatch");
> > - return (FALSE);
> > - }
> > -
> > - /*
> > - * We have a nickname now, let's use it
> > - */
> > - ad->ad_nickname = verf.adv_nickname;
> > - ad->ad_cred.adc_namekind = ADN_NICKNAME;
> > - return (TRUE);
> > -}
> > -
> > -/*
> > - * 4. Refresh
> > - */
> > -/*ARGSUSED*/
> > -static bool_t
> > -authdes_refresh(AUTH *auth, void *dummy __unused)
> > -{
> > -/* LINTED pointer alignment */
> > - struct ad_private *ad = AUTH_PRIVATE(auth);
> > - struct authdes_cred *cred = &ad->ad_cred;
> > - int ok;
> > - netobj pkey;
> > -
> > - if (ad->ad_dosync) {
> > - ok = __rpc_get_time_offset(&ad->ad_timediff, ad->ad_nis_srvr,
> > - ad->ad_timehost, &(ad->ad_uaddr),
> > - &(ad->ad_netid));
> > - if (! ok) {
> > - /*
> > - * Hope the clocks are synced!
> > - */
> > - ad->ad_dosync = 0;
> > - syslog(LOG_DEBUG,
> > - "authdes_refresh: unable to synchronize clock");
> > - }
> > - }
> > - ad->ad_xkey = auth->ah_key;
> > - pkey.n_bytes = (char *)(ad->ad_pkey);
> > - pkey.n_len = (u_int)strlen((char *)ad->ad_pkey) + 1;
> > - if (key_encryptsession_pk(ad->ad_servername, &pkey, &ad->ad_xkey) < 0) {
> > - syslog(LOG_INFO,
> > - "authdes_refresh: keyserv(1m) is unable to encrypt session key");
> > - return (FALSE);
> > - }
> > - cred->adc_fullname.key = ad->ad_xkey;
> > - cred->adc_namekind = ADN_FULLNAME;
> > - cred->adc_fullname.name = ad->ad_fullname;
> > - return (TRUE);
> > -}
> > -
> > -
> > -/*
> > - * 5. Destroy
> > - */
> > -static void
> > -authdes_destroy(AUTH *auth)
> > -{
> > -/* LINTED pointer alignment */
> > - struct ad_private *ad = AUTH_PRIVATE(auth);
> > -
> > - FREE(ad->ad_fullname, ad->ad_fullnamelen + 1);
> > - FREE(ad->ad_servername, ad->ad_servernamelen + 1);
> > - if (ad->ad_timehost)
> > - FREE(ad->ad_timehost, strlen(ad->ad_timehost) + 1);
> > - if (ad->ad_netid)
> > - FREE(ad->ad_netid, strlen(ad->ad_netid) + 1);
> > - if (ad->ad_uaddr)
> > - FREE(ad->ad_uaddr, strlen(ad->ad_uaddr) + 1);
> > - FREE(ad, sizeof (struct ad_private));
> > - FREE(auth, sizeof(AUTH));
> > -}
> > -
> > -static struct auth_ops *
> > -authdes_ops(void)
> > -{
> > - static struct auth_ops ops;
> > -
> > - /* VARIABLES PROTECTED BY ops_lock: ops */
> > -
> > - mutex_lock(&authdes_ops_lock);
> > - if (ops.ah_nextverf == NULL) {
> > - ops.ah_nextverf = authdes_nextverf;
> > - ops.ah_marshal = authdes_marshal;
> > - ops.ah_validate = authdes_validate;
> > - ops.ah_refresh = authdes_refresh;
> > - ops.ah_destroy = authdes_destroy;
> > - }
> > - mutex_unlock(&authdes_ops_lock);
> > - return (&ops);
> > + return (NULL);
> > }
> > +__sym_compat(authdes_pk_seccreate, __authdes_pk_seccreate, FBSD_1.0);
> > diff --git a/lib/libc/rpc/authdes_prot.c b/lib/libc/rpc/authdes_prot.c
> > index 79a0e5baa084..56b44daafe41 100644
> > --- a/lib/libc/rpc/authdes_prot.c
> > +++ b/lib/libc/rpc/authdes_prot.c
> > @@ -42,44 +42,16 @@
> > #include <rpc/auth_des.h>
> > #include "un-namespace.h"
> >
> > -#define ATTEMPT(xdr_op) if (!(xdr_op)) return (FALSE)
> > -
> > -bool_t
> > -xdr_authdes_cred(XDR *xdrs, struct authdes_cred *cred)
> > +static bool_t
> > +__xdr_authdes_cred(XDR *xdrs, void *cred)
> > {
> > - enum authdes_namekind *padc_namekind = &cred->adc_namekind;
> > - /*
> > - * Unrolled xdr
> > - */
> > - ATTEMPT(xdr_enum(xdrs, (enum_t *) padc_namekind));
> > - switch (cred->adc_namekind) {
> > - case ADN_FULLNAME:
> > - ATTEMPT(xdr_string(xdrs, &cred->adc_fullname.name,
> > - MAXNETNAMELEN));
> > - ATTEMPT(xdr_opaque(xdrs, (caddr_t)&cred->adc_fullname.key,
> > - sizeof(des_block)));
> > - ATTEMPT(xdr_opaque(xdrs, (caddr_t)&cred->adc_fullname.window,
> > - sizeof(cred->adc_fullname.window)));
> > - return (TRUE);
> > - case ADN_NICKNAME:
> > - ATTEMPT(xdr_opaque(xdrs, (caddr_t)&cred->adc_nickname,
> > - sizeof(cred->adc_nickname)));
> > - return (TRUE);
> > - default:
> > - return (FALSE);
> > - }
> > + return (FALSE);
> > }
> > +__sym_compat(xdr_authdes_cred, __xdr_authdes_cred, FBSD_1.0);
> >
> > -
> > -bool_t
> > -xdr_authdes_verf(XDR *xdrs, struct authdes_verf *verf)
> > +static bool_t
> > +__xdr_authdes_verf(XDR *xdrs, void *verf)
> > {
> > - /*
> > - * Unrolled xdr
> > - */
> > - ATTEMPT(xdr_opaque(xdrs, (caddr_t)&verf->adv_xtimestamp,
> > - sizeof(des_block)));
> > - ATTEMPT(xdr_opaque(xdrs, (caddr_t)&verf->adv_int_u,
> > - sizeof(verf->adv_int_u)));
> > - return (TRUE);
> > + return (FALSE);
> > }
> > +__sym_compat(xdr_authdes_verf, __xdr_authdes_verf, FBSD_1.0);
> > diff --git a/lib/libc/rpc/key_call.c b/lib/libc/rpc/key_call.c
> > index 5c87881c815c..eb274fcfff36 100644
> > --- a/lib/libc/rpc/key_call.c
> > +++ b/lib/libc/rpc/key_call.c
> > @@ -32,426 +32,78 @@
> > */
> >
> > /*
> > - * key_call.c, Interface to keyserver
> > - *
> > - * setsecretkey(key) - set your secret key
> > - * encryptsessionkey(agent, deskey) - encrypt a session key to talk to agent
> > - * decryptsessionkey(agent, deskey) - decrypt ditto
> > - * gendeskey(deskey) - generate a secure des key
> > + * Secure RPC keyserver support was removed in FreeBSD 15.0.
> > + * These symbols are provided for backward compatibility, but provide no
> > + * functionality and will always return an error.
> > */
> >
> > #include "namespace.h"
> > #include "reentrant.h"
> > -#include <stdio.h>
> > -#include <stdlib.h>
> > -#include <unistd.h>
> > -#include <errno.h>
> > #include <rpc/rpc.h>
> > -#include <rpc/auth.h>
> > -#include <rpc/auth_unix.h>
> > #include <rpc/key_prot.h>
> > -#include <string.h>
> > -#include <netconfig.h>
> > -#include <sys/utsname.h>
> > -#include <stdlib.h>
> > -#include <signal.h>
> > -#include <sys/wait.h>
> > -#include <sys/fcntl.h>
> > +#include <rpc/auth.h>
> > #include "un-namespace.h"
> > #include "mt_misc.h"
> >
> > -
> > -#define KEY_TIMEOUT 5 /* per-try timeout in seconds */
> > -#define KEY_NRETRY 12 /* number of retries */
> > -
> > -#ifdef DEBUG
> > -#define debug(msg) (void) fprintf(stderr, "%s\n", msg);
> > -#else
> > -#define debug(msg)
> > -#endif /* DEBUG */
> > -
> > -/*
> > - * Hack to allow the keyserver to use AUTH_DES (for authenticated
> > - * NIS+ calls, for example). The only functions that get called
> > - * are key_encryptsession_pk, key_decryptsession_pk, and key_gendes.
> > - *
> > - * The approach is to have the keyserver fill in pointers to local
> > - * implementations of these functions, and to call those in key_call().
> > - */
> > -
> > -cryptkeyres *(*__key_encryptsession_pk_LOCAL)(uid_t, void *arg) = 0;
> > -cryptkeyres *(*__key_decryptsession_pk_LOCAL)(uid_t, void *arg) = 0;
> > -des_block *(*__key_gendes_LOCAL)(uid_t, void *) = 0;
> > -
> > -static int key_call( u_long, xdrproc_t, void *, xdrproc_t, void *);
> > -
> > -int
> > -key_setsecret(const char *secretkey)
> > -{
> > - keystatus status;
> > -
> > - if (!key_call((u_long) KEY_SET, (xdrproc_t)xdr_keybuf,
> > - (void *)secretkey,
> > - (xdrproc_t)xdr_keystatus, &status)) {
> > - return (-1);
> > - }
> > - if (status != KEY_SUCCESS) {
> > - debug("set status is nonzero");
> > - return (-1);
> > - }
> > - return (0);
> > -}
> > -
> > -
> > -/* key_secretkey_is_set() returns 1 if the keyserver has a secret key
> > - * stored for the caller's effective uid; it returns 0 otherwise
> > - *
> > - * N.B.: The KEY_NET_GET key call is undocumented. Applications shouldn't
> > - * be using it, because it allows them to get the user's secret key.
> > - */
> > -
> > -int
> > -key_secretkey_is_set(void)
> > -{
> > - struct key_netstres kres;
> > -
> > - memset((void*)&kres, 0, sizeof (kres));
> > - if (key_call((u_long) KEY_NET_GET, (xdrproc_t)xdr_void, NULL,
> > - (xdrproc_t)xdr_key_netstres, &kres) &&
> > - (kres.status == KEY_SUCCESS) &&
> > - (kres.key_netstres_u.knet.st_priv_key[0] != 0)) {
> > - /* avoid leaving secret key in memory */
> > - memset(kres.key_netstres_u.knet.st_priv_key, 0, HEXKEYBYTES);
> > - return (1);
> > - }
> > - return (0);
> > -}
> > -
> > -int
> > -key_encryptsession_pk(char *remotename, netobj *remotekey, des_block *deskey)
> > -{
> > - cryptkeyarg2 arg;
> > - cryptkeyres res;
> > -
> > - arg.remotename = remotename;
> > - arg.remotekey = *remotekey;
> > - arg.deskey = *deskey;
> > - if (!key_call((u_long)KEY_ENCRYPT_PK, (xdrproc_t)xdr_cryptkeyarg2, &arg,
> > - (xdrproc_t)xdr_cryptkeyres, &res)) {
> > - return (-1);
> > - }
> > - if (res.status != KEY_SUCCESS) {
> > - debug("encrypt status is nonzero");
> > - return (-1);
> > - }
> > - *deskey = res.cryptkeyres_u.deskey;
> > - return (0);
> > -}
> > -
> > -int
> > -key_decryptsession_pk(char *remotename, netobj *remotekey, des_block *deskey)
> > -{
> > - cryptkeyarg2 arg;
> > - cryptkeyres res;
> > -
> > - arg.remotename = remotename;
> > - arg.remotekey = *remotekey;
> > - arg.deskey = *deskey;
> > - if (!key_call((u_long)KEY_DECRYPT_PK, (xdrproc_t)xdr_cryptkeyarg2, &arg,
> > - (xdrproc_t)xdr_cryptkeyres, &res)) {
> > - return (-1);
> > - }
> > - if (res.status != KEY_SUCCESS) {
> > - debug("decrypt status is nonzero");
> > - return (-1);
> > - }
> > - *deskey = res.cryptkeyres_u.deskey;
> > - return (0);
> > -}
> > -
> > -int
> > -key_encryptsession(const char *remotename, des_block *deskey)
> > +static int
> > +__key_setsecret(const char *secretkey)
> > {
> > - cryptkeyarg arg;
> > - cryptkeyres res;
> > -
> > - arg.remotename = (char *) remotename;
> > - arg.deskey = *deskey;
> > - if (!key_call((u_long)KEY_ENCRYPT, (xdrproc_t)xdr_cryptkeyarg, &arg,
> > - (xdrproc_t)xdr_cryptkeyres, &res)) {
> > - return (-1);
> > - }
> > - if (res.status != KEY_SUCCESS) {
> > - debug("encrypt status is nonzero");
> > - return (-1);
> > - }
> > - *deskey = res.cryptkeyres_u.deskey;
> > - return (0);
> > + return (-1);
> > }
> > +__sym_compat(key_setsecret, __key_setsecret, FBSD_1.0);
> >
> > -int
> > -key_decryptsession(const char *remotename, des_block *deskey)
> > +static int
> > +__key_secretkey_is_set(void)
> > {
> > - cryptkeyarg arg;
> > - cryptkeyres res;
> > -
> > - arg.remotename = (char *) remotename;
> > - arg.deskey = *deskey;
> > - if (!key_call((u_long)KEY_DECRYPT, (xdrproc_t)xdr_cryptkeyarg, &arg,
> > - (xdrproc_t)xdr_cryptkeyres, &res)) {
> > - return (-1);
> > - }
> > - if (res.status != KEY_SUCCESS) {
> > - debug("decrypt status is nonzero");
> > - return (-1);
> > - }
> > - *deskey = res.cryptkeyres_u.deskey;
> > return (0);
> > }
> > +__sym_compat(key_secretkey_is_set, __key_secretkey_is_set, FBSD_1.0);
> >
> > -int
> > -key_gendes(des_block *key)
> > +static int
> > +__key_encryptsession_pk(char *remotename, netobj *remotekey, des_block *deskey)
> > {
> > - if (!key_call((u_long)KEY_GEN, (xdrproc_t)xdr_void, NULL,
> > - (xdrproc_t)xdr_des_block, key)) {
> > - return (-1);
> > - }
> > - return (0);
> > + return (-1);
> > }
> > +__sym_compat(key_encryptsession_pk, __key_encryptsession_pk, FBSD_1.0);
> >
> > -int
> > -key_setnet(struct key_netstarg *arg)
> > +static int
> > +__key_decryptsession_pk(char *remotename, netobj *remotekey, des_block *deskey)
> > {
> > *** 2726 LINES SKIPPED ***
> >

[-- Attachment #2 --]
<html xmlns="http://www.w3.org/1999/xhtml"><head>; <title></title> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no"> </head> <body dir="auto"><div id="CanaryBody"> <div> All xservers are affected. </div><div><br></div><div>However, upstream already deal with it in commit <span style="font-family: system-ui; font-size: 12px;">https://gitlab.freedesktop.org/xorg/xserver/-/commit/71b207a2ebc1465c7d9ad9262f60930f6a1d42ee</span></div>; <div><br></div> </div> <div id="CanarySig"> <div> <div style="font-family:Helvetica;"><div style="font-family:Helvetica;">--<br><div>Dima. (desktop, kde, x11, office, ports-secteam)@FreeBSD team</div><div>(fluffy@FreeBSD.org, https://t.me/FluffyBSD)</div></div></div>; <div><br></div> </div> </div> <div id="CanaryDropbox"> </div> <blockquote id="CanaryBlockquote"> <div> <div>On вторник, авг. 12, 2025 at 1:41 PM, Dima Panov &lt;<a href="mailto:fluffy@FreeBSD.org">fluffy@FreeBSD.org</a>&gt; wrote:<br></div> <div dir="auto"><div id=""> <div> Hello!</div><div><br></div><div>This commit breaks x11-server/xwayland</div><div><br></div><div>FAILED: os/liblibxserver_os.a.p/rpcauth.c.o                                                                                                                                                                                                 cc -Ios/liblibxserver_os.a.p -Ios -I../os -I. -I.. -IXext -I../Xext -IXi -I../Xi -Icomposite -I../composite -Idamageext -I../damageext -Ifb -I../fb -Iglamor -I../glamor -Imi -I../mi -Imiext/damage -I../miext/damage -Imiext/sync -I../miext/sync -Idbe -I../dbe -Idix -I../dix -Idri3 -I../dri3 -Iinclude -I../include -Ipresent -I../present -Irandr -I../randr -Irender -I../render -Ixfixes -I../xfixes -I/usr/local/include -I/usr/local/include/pixman-1 -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -fdiagnostics-color=never -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -DHAVE_DIX_CONFIG_H -fno-strict-aliasing -fvisibility=hidden -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -O2 -pipe -fstack-protector-strong -fno-strict-aliasing -fPIC -D_THREAD_SAFE -D_DEFAULT_SOURCE -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -DCLIENTIDS -MD -MQ os/liblibxserver_os.a.p/rpcauth.c.o -MF os/liblibxserver_os.a.p/rpcauth.c.o.d -o os/liblibxserver_os.a.p/rpcauth.c.o -c ../os/rpcauth.c                                                                                                                                                                                         ../os/rpcauth.c:110:52: error: incomplete definition of type 'struct authdes_cred'                                                                                                                                                            110 |     return (((struct authdes_cred *) r.rq_clntcred)-&gt;adc_fullname.name);                                                                                                                                                                  |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^                                                                                                                                                                                ../os/rpcauth.c:110:22: note: forward declaration of 'struct authdes_cred'                                                                                                                                                                    110 |     return (((struct authdes_cred *) r.rq_clntcred)-&gt;adc_fullname.name);                                                                                                                                                                  |                      ^                                                                                                                                                                                                              1 error generated.<br></div><div><br></div> <div><br></div> </div> <div id=""> <div> <div style="font-family:Helvetica;"><div style="font-family:Helvetica;">--<br><div>Dima. (desktop, kde, x11, office, ports-secteam)@FreeBSD team</div><div>(fluffy@FreeBSD.org, https://t.me/FluffyBSD)</div></div></div>; <div><br></div> </div> </div> <div id="CanaryDropbox"> </div> <blockquote id=""> <div> <div>On воскресенье, авг. 10, 2025 at 6:37 PM, Lexi Winter &lt;<a href="mailto:ivy@FreeBSD.org">ivy@FreeBSD.org</a>&gt; wrote:<br></div> <div>The branch main has been updated by ivy: <br> <br>URL: https://cgit.FreeBSD.org/src/commit/?id=7ac276298b72982189ac1a5b17461936dc00163e <br> <br>commit 7ac276298b72982189ac1a5b17461936dc00163e <br>Author: Lexi Winter &lt;ivy@FreeBSD.org&gt; <br>AuthorDate: 2025-08-10 12:57:36 +0000 <br>Commit: Lexi Winter &lt;ivy@FreeBSD.org&gt; <br>CommitDate: 2025-08-10 15:36:40 +0000 <br> <br> Remove Secure RPC DES authentication <br> <br> Following the earlier removal of keyserv, none of this functionality <br> works since it requires keyserv. <br> <br> Remove the relevant symbols from libc's Symbol.map. Leave compatibility <br> symbols for existing applications, but since the functions don't work <br> without keyserv, stub them out to return an error. <br> <br> Remove some private symbols that were only used by keyserv; these don't <br> get compatibility symbols. <br> <br> Remove the documentation for the old functions. <br> <br> Remove rpc.ypupdated since it requires DES authentication. <br> <br> Reviewed by: manu, des, emaste <br> Differential Revision: https://reviews.freebsd.org/D50442 <br>--- <br> ObsoleteFiles.inc | 4 + <br> include/rpc/auth_des.h | 79 +---- <br> lib/libc/rpc/Symbol.map | 19 -- <br> lib/libc/rpc/auth_des.c | 455 +---------------------------- <br> lib/libc/rpc/authdes_prot.c | 44 +-- <br> lib/libc/rpc/key_call.c | 424 +++------------------------ <br> lib/libc/rpc/publickey.5 | 40 --- <br> lib/libc/rpc/rpc_secure.3 | 177 +----------- <br> lib/libc/rpc/rpc_soc.3 | 13 +- <br> lib/libc/rpc/rpc_soc.c | 31 +- <br> lib/libc/rpc/svc_auth.c | 8 - <br> lib/libc/rpc/svc_auth_des.c | 460 +----------------------------- <br> lib/librpcsvc/Makefile | 2 +- <br> lib/librpcsvc/yp_update.c | 199 ------------- <br> libexec/rc/rc.conf | 1 - <br> libexec/rc/rc.d/Makefile | 1 - <br> libexec/rc/rc.d/ypupdated | 35 --- <br> share/man/man5/rc.conf.5 | 9 +- <br> sys/rpc/auth.h | 26 -- <br> tools/build/mk/OptionalObsoleteFiles.inc | 2 - <br> usr.sbin/Makefile | 1 - <br> usr.sbin/rpc.ypupdated/Makefile | 32 --- <br> usr.sbin/rpc.ypupdated/Makefile.depend | 18 -- <br> usr.sbin/rpc.ypupdated/update.c | 328 --------------------- <br> usr.sbin/rpc.ypupdated/yp_dbdelete.c | 68 ----- <br> usr.sbin/rpc.ypupdated/yp_dbupdate.c | 147 ---------- <br> usr.sbin/rpc.ypupdated/ypupdate | 32 --- <br> usr.sbin/rpc.ypupdated/ypupdated_extern.h | 32 --- <br> usr.sbin/rpc.ypupdated/ypupdated_main.c | 287 ------------------- <br> usr.sbin/rpc.ypupdated/ypupdated_server.c | 227 --------------- <br> 30 files changed, 83 insertions(+), 3118 deletions(-) <br> <br>diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc <br>index ec324e82f86d..a6662d31829f 100644 <br>--- a/ObsoleteFiles.inc <br>+++ b/ObsoleteFiles.inc <br>@@ -51,6 +51,10 @@ <br> # xargs -n1 | sort | uniq -d; <br> # done <br> <br>+# 20250810: Removal of remaining Secure RPC (DES) bits <br>+OLD_FILES+=usr/sbin/rpc.ypupdated <br>+OLD_FILES+=etc/rc.d/ypupdated <br>+ <br> # 20250808: nvmfd removed from base install <br> OLD_FILES+=usr/sbin/nvmfd <br> OLD_FILES+=usr/share/man/man8/nvmfd.8.gz <br>diff --git a/include/rpc/auth_des.h b/include/rpc/auth_des.h <br>index 0ff43c13139b..1b4943a74b8b 100644 <br>--- a/include/rpc/auth_des.h <br>+++ b/include/rpc/auth_des.h <br>@@ -33,91 +33,14 @@ <br> * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc. <br> */ <br> <br>-/* <br>- * auth_des.h, Protocol for DES style authentication for RPC <br>- */ <br>+/* Note, RPC DES authentication was removed in FreeBSD 15.0. */ <br> <br> #ifndef _AUTH_DES_ <br> #define _AUTH_DES_ <br> <br>-/* <br>- * There are two kinds of "names": fullnames and nicknames <br>- */ <br>-enum authdes_namekind { <br>- ADN_FULLNAME, <br>- ADN_NICKNAME <br>-}; <br>- <br>-/* <br>- * A fullname contains the network name of the client, <br>- * a conversation key and the window <br>- */ <br>-struct authdes_fullname { <br>- char *name; /* network name of client, up to MAXNETNAMELEN */ <br>- des_block key; /* conversation key */ <br>- u_long window; /* associated window */ <br>-}; <br>- <br>- <br>-/* <br>- * A credential <br>- */ <br>-struct authdes_cred { <br>- enum authdes_namekind adc_namekind; <br>- struct authdes_fullname adc_fullname; <br>- u_long adc_nickname; <br>-}; <br>- <br>- <br>- <br>-/* <br>- * A des authentication verifier <br>- */ <br>-struct authdes_verf { <br>- union { <br>- struct timeval adv_ctime; /* clear time */ <br>- des_block adv_xtime; /* crypt time */ <br>- } adv_time_u; <br>- u_long adv_int_u; <br>-}; <br>- <br>-/* <br>- * des authentication verifier: client variety <br>- * <br>- * adv_timestamp is the current time. <br>- * adv_winverf is the credential window + 1. <br>- * Both are encrypted using the conversation key. <br>- */ <br>-#define adv_timestamp adv_time_u.adv_ctime <br>-#define adv_xtimestamp adv_time_u.adv_xtime <br>-#define adv_winverf adv_int_u <br>- <br>-/* <br>- * des authentication verifier: server variety <br>- * <br>- * adv_timeverf is the client's timestamp + client's window <br>- * adv_nickname is the server's nickname for the client. <br>- * adv_timeverf is encrypted using the conversation key. <br>- */ <br>-#define adv_timeverf adv_time_u.adv_ctime <br>-#define adv_xtimeverf adv_time_u.adv_xtime <br>-#define adv_nickname adv_int_u <br>- <br>-/* <br>- * Map a des credential into a unix cred. <br>- * <br>- */ <br>-__BEGIN_DECLS <br>-extern int authdes_getucred( struct authdes_cred *, uid_t *, gid_t *, int *, gid_t * ); <br>-__END_DECLS <br>- <br> __BEGIN_DECLS <br>-extern bool_t xdr_authdes_cred(XDR *, struct authdes_cred *); <br>-extern bool_t xdr_authdes_verf(XDR *, struct authdes_verf *); <br> extern int rtime(dev_t, struct netbuf *, int, struct timeval *, <br> struct timeval *); <br>-extern void kgetnetname(char *); <br>-extern enum auth_stat _svcauth_des(struct svc_req *, struct rpc_msg *); <br> __END_DECLS <br> <br> #endif /* ndef _AUTH_DES_ */ <br>diff --git a/lib/libc/rpc/Symbol.map b/lib/libc/rpc/Symbol.map <br>index 105d6fb6b54e..61e8e084b1e0 100644 <br>--- a/lib/libc/rpc/Symbol.map <br>+++ b/lib/libc/rpc/Symbol.map <br>@@ -8,13 +8,9 @@ FBSD_1.0 { <br> xdr_desargs; <br> xdr_desresp; <br> <br>- authdes_seccreate; <br>- authdes_pk_seccreate; <br> authnone_create; <br> authunix_create; <br> authunix_create_default; <br>- xdr_authdes_cred; <br>- xdr_authdes_verf; <br> xdr_authunix_parms; <br> bindresvport; <br> bindresvport_sa; <br>@@ -58,15 +54,6 @@ FBSD_1.0 { <br> endrpcent; <br> getrpcent; <br> getrpcport; <br>- key_setsecret; <br>- key_secretkey_is_set; <br>- key_encryptsession_pk; <br>- key_decryptsession_pk; <br>- key_encryptsession; <br>- key_decryptsession; <br>- key_gendes; <br>- key_setnet; <br>- key_get_conv; <br> xdr_keystatus; <br> xdr_keybuf; <br> xdr_netnamestr; <br>@@ -130,7 +117,6 @@ FBSD_1.0 { <br> callrpc; <br> registerrpc; <br> clnt_broadcast; <br>- authdes_create; <br> clntunix_create; <br> svcunix_create; <br> svcunixfd_create; <br>@@ -180,8 +166,6 @@ FBSD_1.0 { <br> _authenticate; <br> _svcauth_null; <br> svc_auth_reg; <br>- _svcauth_des; <br>- authdes_getucred; <br> _svcauth_unix; <br> _svcauth_short; <br> svc_dg_create; <br>@@ -205,9 +189,6 @@ FBSD_1.8 { <br> <br> FBSDprivate_1.0 { <br> __des_crypt_LOCAL; <br>- __key_encryptsession_pk_LOCAL; <br>- __key_decryptsession_pk_LOCAL; <br>- __key_gendes_LOCAL; <br> __svc_clean_idle; <br> __rpc_gss_unwrap; <br> __rpc_gss_unwrap_stub; <br>diff --git a/lib/libc/rpc/auth_des.c b/lib/libc/rpc/auth_des.c <br>index c9b20de25cda..754d55cbed3e 100644 <br>--- a/lib/libc/rpc/auth_des.c <br>+++ b/lib/libc/rpc/auth_des.c <br>@@ -30,463 +30,34 @@ <br> /* <br> * Copyright (c) 1988 by Sun Microsystems, Inc. <br> */ <br>+ <br> /* <br>- * auth_des.c, client-side implementation of DES authentication <br>+ * Secure RPC DES authentication was removed in FreeBSD 15.0. <br>+ * These symbols are provided for backward compatibility, but provide no <br>+ * functionality and will always return an error. <br> */ <br> <br> #include "namespace.h" <br> #include "reentrant.h" <br>-#include &lt;err.h&gt; <br>-#include &lt;errno.h&gt; <br>-#include &lt;string.h&gt; <br>-#include &lt;stdlib.h&gt; <br>-#include &lt;unistd.h&gt; <br>-#include &lt;rpc/des_crypt.h&gt; <br>-#include &lt;syslog.h&gt; <br> #include &lt;rpc/types.h&gt; <br> #include &lt;rpc/auth.h&gt; <br> #include &lt;rpc/auth_des.h&gt; <br>-#include &lt;rpc/clnt.h&gt; <br>-#include &lt;rpc/xdr.h&gt; <br>-#include &lt;sys/socket.h&gt; <br>-#undef NIS <br> #include &lt;rpcsvc/nis.h&gt; <br> #include "un-namespace.h" <br>-#include "mt_misc.h" <br>- <br>-#define USEC_PER_SEC 1000000 <br>-#define RTIME_TIMEOUT 5 /* seconds to wait for sync */ <br>- <br>-#define AUTH_PRIVATE(auth) (struct ad_private *) auth-&gt;ah_private <br>-#define ALLOC(object_type) (object_type *) mem_alloc(sizeof(object_type)) <br>-#define FREE(ptr, size) mem_free((char *)(ptr), (int) size) <br>-#define ATTEMPT(xdr_op) if (!(xdr_op)) return (FALSE) <br>- <br>-extern bool_t xdr_authdes_cred( XDR *, struct authdes_cred *); <br>-extern bool_t xdr_authdes_verf( XDR *, struct authdes_verf *); <br>-extern int key_encryptsession_pk(char *, netobj *, des_block *); <br>- <br>-extern bool_t __rpc_get_time_offset(struct timeval *, nis_server *, char *, <br>- char **, char **); <br> <br>-/* <br>- * DES authenticator operations vector <br>- */ <br>-static void authdes_nextverf(AUTH *); <br>-static bool_t authdes_marshal(AUTH *, XDR *); <br>-static bool_t authdes_validate(AUTH *, struct opaque_auth *); <br>-static bool_t authdes_refresh(AUTH *, void *); <br>-static void authdes_destroy(AUTH *); <br>- <br>-static struct auth_ops *authdes_ops(void); <br>- <br>-/* <br>- * This struct is pointed to by the ah_private field of an "AUTH *" <br>- */ <br>-struct ad_private { <br>- char *ad_fullname; /* client's full name */ <br>- u_int ad_fullnamelen; /* length of name, rounded up */ <br>- char *ad_servername; /* server's full name */ <br>- u_int ad_servernamelen; /* length of name, rounded up */ <br>- u_int ad_window; /* client specified window */ <br>- bool_t ad_dosync; /* synchronize? */ <br>- struct netbuf ad_syncaddr; /* remote host to synch with */ <br>- char *ad_timehost; /* remote host to synch with */ <br>- struct timeval ad_timediff; /* server's time - client's time */ <br>- u_int ad_nickname; /* server's nickname for client */ <br>- struct authdes_cred ad_cred; /* storage for credential */ <br>- struct authdes_verf ad_verf; /* storage for verifier */ <br>- struct timeval ad_timestamp; /* timestamp sent */ <br>- des_block ad_xkey; /* encrypted conversation key */ <br>- u_char ad_pkey[1024]; /* Server's actual public key */ <br>- char *ad_netid; /* Timehost netid */ <br>- char *ad_uaddr; /* Timehost uaddr */ <br>- nis_server *ad_nis_srvr; /* NIS+ server struct */ <br>-}; <br>- <br>-AUTH *authdes_pk_seccreate(const char *, netobj *, u_int, const char *, <br>- const des_block *, nis_server *); <br>- <br>-/* <br>- * documented version of authdes_seccreate <br>- */ <br>-/* <br>- servername: network name of server <br>- win: time to live <br>- timehost: optional hostname to sync with <br>- ckey: optional conversation key to use <br>-*/ <br>- <br>-AUTH * <br>-authdes_seccreate(const char *servername, const u_int win, <br>+static AUTH * <br>+__authdes_seccreate(const char *servername, const u_int win, <br> const char *timehost, const des_block *ckey) <br> { <br>- u_char pkey_data[1024]; <br>- netobj pkey; <br>- AUTH *dummy; <br>- <br>- if (! getpublickey(servername, (char *) pkey_data)) { <br>- syslog(LOG_ERR, <br>- "authdes_seccreate: no public key found for %s", <br>- servername); <br>- return (NULL); <br>- } <br>- <br>- pkey.n_bytes = (char *) pkey_data; <br>- pkey.n_len = (u_int)strlen((char *)pkey_data) + 1; <br>- dummy = authdes_pk_seccreate(servername, &amp;pkey, win, timehost, <br>- ckey, NULL); <br>- return (dummy); <br>-} <br>- <br>-/* <br>- * Slightly modified version of authdessec_create which takes the public key <br>- * of the server principal as an argument. This spares us a call to <br>- * getpublickey() which in the nameserver context can cause a deadlock. <br>- */ <br>-AUTH * <br>-authdes_pk_seccreate(const char *servername, netobj *pkey, u_int window, <br>- const char *timehost, const des_block *ckey, nis_server *srvr) <br>-{ <br>- AUTH *auth; <br>- struct ad_private *ad; <br>- char namebuf[MAXNETNAMELEN+1]; <br>- <br>- /* <br>- * Allocate everything now <br>- */ <br>- auth = ALLOC(AUTH); <br>- if (auth == NULL) { <br>- syslog(LOG_ERR, "authdes_pk_seccreate: out of memory"); <br>- return (NULL); <br>- } <br>- ad = ALLOC(struct ad_private); <br>- if (ad == NULL) { <br>- syslog(LOG_ERR, "authdes_pk_seccreate: out of memory"); <br>- goto failed; <br>- } <br>- ad-&gt;ad_fullname = ad-&gt;ad_servername = NULL; /* Sanity reasons */ <br>- ad-&gt;ad_timehost = NULL; <br>- ad-&gt;ad_netid = NULL; <br>- ad-&gt;ad_uaddr = NULL; <br>- ad-&gt;ad_nis_srvr = NULL; <br>- ad-&gt;ad_timediff.tv_sec = 0; <br>- ad-&gt;ad_timediff.tv_usec = 0; <br>- memcpy(ad-&gt;ad_pkey, pkey-&gt;n_bytes, pkey-&gt;n_len); <br>- if (!getnetname(namebuf)) <br>- goto failed; <br>- ad-&gt;ad_fullnamelen = RNDUP((u_int) strlen(namebuf)); <br>- ad-&gt;ad_fullname = (char *)mem_alloc(ad-&gt;ad_fullnamelen + 1); <br>- ad-&gt;ad_servernamelen = strlen(servername); <br>- ad-&gt;ad_servername = (char *)mem_alloc(ad-&gt;ad_servernamelen + 1); <br>- <br>- if (ad-&gt;ad_fullname == NULL || ad-&gt;ad_servername == NULL) { <br>- syslog(LOG_ERR, "authdes_seccreate: out of memory"); <br>- goto failed; <br>- } <br>- if (timehost != NULL) { <br>- ad-&gt;ad_timehost = (char *)mem_alloc(strlen(timehost) + 1); <br>- if (ad-&gt;ad_timehost == NULL) { <br>- syslog(LOG_ERR, "authdes_seccreate: out of memory"); <br>- goto failed; <br>- } <br>- memcpy(ad-&gt;ad_timehost, timehost, strlen(timehost) + 1); <br>- ad-&gt;ad_dosync = TRUE; <br>- } else if (srvr != NULL) { <br>- ad-&gt;ad_nis_srvr = srvr; /* transient */ <br>- ad-&gt;ad_dosync = TRUE; <br>- } else { <br>- ad-&gt;ad_dosync = FALSE; <br>- } <br>- memcpy(ad-&gt;ad_fullname, namebuf, ad-&gt;ad_fullnamelen + 1); <br>- memcpy(ad-&gt;ad_servername, servername, ad-&gt;ad_servernamelen + 1); <br>- ad-&gt;ad_window = window; <br>- if (ckey == NULL) { <br>- if (key_gendes(&amp;auth-&gt;ah_key) &lt; 0) { <br>- syslog(LOG_ERR, <br>- "authdes_seccreate: keyserv(1m) is unable to generate session key"); <br>- goto failed; <br>- } <br>- } else { <br>- auth-&gt;ah_key = *ckey; <br>- } <br>- <br>- /* <br>- * Set up auth handle <br>- */ <br>- auth-&gt;ah_cred.oa_flavor = AUTH_DES; <br>- auth-&gt;ah_verf.oa_flavor = AUTH_DES; <br>- auth-&gt;ah_ops = authdes_ops(); <br>- auth-&gt;ah_private = (caddr_t)ad; <br>- <br>- if (!authdes_refresh(auth, NULL)) { <br>- goto failed; <br>- } <br>- ad-&gt;ad_nis_srvr = NULL; /* not needed any longer */ <br>- return (auth); <br>- <br>-failed: <br>- if (auth) <br>- FREE(auth, sizeof (AUTH)); <br>- if (ad) { <br>- if (ad-&gt;ad_fullname) <br>- FREE(ad-&gt;ad_fullname, ad-&gt;ad_fullnamelen + 1); <br>- if (ad-&gt;ad_servername) <br>- FREE(ad-&gt;ad_servername, ad-&gt;ad_servernamelen + 1); <br>- if (ad-&gt;ad_timehost) <br>- FREE(ad-&gt;ad_timehost, strlen(ad-&gt;ad_timehost) + 1); <br>- if (ad-&gt;ad_netid) <br>- FREE(ad-&gt;ad_netid, strlen(ad-&gt;ad_netid) + 1); <br>- if (ad-&gt;ad_uaddr) <br>- FREE(ad-&gt;ad_uaddr, strlen(ad-&gt;ad_uaddr) + 1); <br>- FREE(ad, sizeof (struct ad_private)); <br>- } <br> return (NULL); <br> } <br>+__sym_compat(authdes_seccreate, __authdes_seccreate, FBSD_1.0); <br> <br>-/* <br>- * Implement the five authentication operations <br>- */ <br>- <br>- <br>-/* <br>- * 1. Next Verifier <br>- */ <br>-/*ARGSUSED*/ <br>-static void <br>-authdes_nextverf(AUTH *auth __unused) <br>+static AUTH * <br>+__authdes_pk_seccreate(const char *servername __unused, netobj *pkey __unused, <br>+ u_int window __unused, const char *timehost __unused, <br>+ const des_block *ckey __unused, nis_server *srvr __unused) <br> { <br>- /* what the heck am I supposed to do??? */ <br>-} <br>- <br>- <br>-/* <br>- * 2. Marshal <br>- */ <br>-static bool_t <br>-authdes_marshal(AUTH *auth, XDR *xdrs) <br>-{ <br>-/* LINTED pointer alignment */ <br>- struct ad_private *ad = AUTH_PRIVATE(auth); <br>- struct authdes_cred *cred = &amp;ad-&gt;ad_cred; <br>- struct authdes_verf *verf = &amp;ad-&gt;ad_verf; <br>- des_block cryptbuf[2]; <br>- des_block ivec; <br>- int status; <br>- int len; <br>- rpc_inline_t *ixdr; <br>- <br>- /* <br>- * Figure out the "time", accounting for any time difference <br>- * with the server if necessary. <br>- */ <br>- (void)gettimeofday(&amp;ad-&gt;ad_timestamp, NULL); <br>- ad-&gt;ad_timestamp.tv_sec += ad-&gt;ad_timediff.tv_sec; <br>- ad-&gt;ad_timestamp.tv_usec += ad-&gt;ad_timediff.tv_usec; <br>- while (ad-&gt;ad_timestamp.tv_usec &gt;= USEC_PER_SEC) { <br>- ad-&gt;ad_timestamp.tv_usec -= USEC_PER_SEC; <br>- ad-&gt;ad_timestamp.tv_sec++; <br>- } <br>- <br>- /* <br>- * XDR the timestamp and possibly some other things, then <br>- * encrypt them. <br>- */ <br>- ixdr = (rpc_inline_t *)cryptbuf; <br>- IXDR_PUT_INT32(ixdr, ad-&gt;ad_timestamp.tv_sec); <br>- IXDR_PUT_INT32(ixdr, ad-&gt;ad_timestamp.tv_usec); <br>- if (ad-&gt;ad_cred.adc_namekind == ADN_FULLNAME) { <br>- IXDR_PUT_U_INT32(ixdr, ad-&gt;ad_window); <br>- IXDR_PUT_U_INT32(ixdr, ad-&gt;ad_window - 1); <br>- ivec.key.high = ivec.key.low = 0; <br>- status = cbc_crypt((char *)&amp;auth-&gt;ah_key, (char *)cryptbuf, <br>- (u_int) 2 * sizeof (des_block), <br>- DES_ENCRYPT | DES_HW, (char *)&amp;ivec); <br>- } else { <br>- status = ecb_crypt((char *)&amp;auth-&gt;ah_key, (char *)cryptbuf, <br>- (u_int) sizeof (des_block), <br>- DES_ENCRYPT | DES_HW); <br>- } <br>- if (DES_FAILED(status)) { <br>- syslog(LOG_ERR, "authdes_marshal: DES encryption failure"); <br>- return (FALSE); <br>- } <br>- ad-&gt;ad_verf.adv_xtimestamp = cryptbuf[0]; <br>- if (ad-&gt;ad_cred.adc_namekind == ADN_FULLNAME) { <br>- ad-&gt;ad_cred.adc_fullname.window = cryptbuf[1].key.high; <br>- ad-&gt;ad_verf.adv_winverf = cryptbuf[1].key.low; <br>- } else { <br>- ad-&gt;ad_cred.adc_nickname = ad-&gt;ad_nickname; <br>- ad-&gt;ad_verf.adv_winverf = 0; <br>- } <br>- <br>- /* <br>- * Serialize the credential and verifier into opaque <br>- * authentication data. <br>- */ <br>- if (ad-&gt;ad_cred.adc_namekind == ADN_FULLNAME) { <br>- len = ((1 + 1 + 2 + 1)*BYTES_PER_XDR_UNIT + ad-&gt;ad_fullnamelen); <br>- } else { <br>- len = (1 + 1)*BYTES_PER_XDR_UNIT; <br>- } <br>- <br>- if ((ixdr = xdr_inline(xdrs, 2*BYTES_PER_XDR_UNIT))) { <br>- IXDR_PUT_INT32(ixdr, AUTH_DES); <br>- IXDR_PUT_INT32(ixdr, len); <br>- } else { <br>- ATTEMPT(xdr_putint32(xdrs, (int *)&amp;auth-&gt;ah_cred.oa_flavor)); <br>- ATTEMPT(xdr_putint32(xdrs, &amp;len)); <br>- } <br>- ATTEMPT(xdr_authdes_cred(xdrs, cred)); <br>- <br>- len = (2 + 1)*BYTES_PER_XDR_UNIT; <br>- if ((ixdr = xdr_inline(xdrs, 2*BYTES_PER_XDR_UNIT))) { <br>- IXDR_PUT_INT32(ixdr, AUTH_DES); <br>- IXDR_PUT_INT32(ixdr, len); <br>- } else { <br>- ATTEMPT(xdr_putint32(xdrs, (int *)&amp;auth-&gt;ah_verf.oa_flavor)); <br>- ATTEMPT(xdr_putint32(xdrs, &amp;len)); <br>- } <br>- ATTEMPT(xdr_authdes_verf(xdrs, verf)); <br>- return (TRUE); <br>-} <br>- <br>- <br>-/* <br>- * 3. Validate <br>- */ <br>-static bool_t <br>-authdes_validate(AUTH *auth, struct opaque_auth *rverf) <br>-{ <br>-/* LINTED pointer alignment */ <br>- struct ad_private *ad = AUTH_PRIVATE(auth); <br>- struct authdes_verf verf; <br>- int status; <br>- uint32_t *ixdr; <br>- des_block buf; <br>- <br>- if (rverf-&gt;oa_length != (2 + 1) * BYTES_PER_XDR_UNIT) { <br>- return (FALSE); <br>- } <br>-/* LINTED pointer alignment */ <br>- ixdr = (uint32_t *)rverf-&gt;oa_base; <br>- buf.key.high = (uint32_t)*ixdr++; <br>- buf.key.low = (uint32_t)*ixdr++; <br>- verf.adv_int_u = (uint32_t)*ixdr++; <br>- <br>- /* <br>- * Decrypt the timestamp <br>- */ <br>- status = ecb_crypt((char *)&amp;auth-&gt;ah_key, (char *)&amp;buf, <br>- (u_int)sizeof (des_block), DES_DECRYPT | DES_HW); <br>- <br>- if (DES_FAILED(status)) { <br>- syslog(LOG_ERR, "authdes_validate: DES decryption failure"); <br>- return (FALSE); <br>- } <br>- <br>- /* <br>- * xdr the decrypted timestamp <br>- */ <br>-/* LINTED pointer alignment */ <br>- ixdr = (uint32_t *)buf.c; <br>- verf.adv_timestamp.tv_sec = IXDR_GET_INT32(ixdr) + 1; <br>- verf.adv_timestamp.tv_usec = IXDR_GET_INT32(ixdr); <br>- <br>- /* <br>- * validate <br>- */ <br>- if (bcmp((char *)&amp;ad-&gt;ad_timestamp, (char *)&amp;verf.adv_timestamp, <br>- sizeof(struct timeval)) != 0) { <br>- syslog(LOG_DEBUG, "authdes_validate: verifier mismatch"); <br>- return (FALSE); <br>- } <br>- <br>- /* <br>- * We have a nickname now, let's use it <br>- */ <br>- ad-&gt;ad_nickname = verf.adv_nickname; <br>- ad-&gt;ad_cred.adc_namekind = ADN_NICKNAME; <br>- return (TRUE); <br>-} <br>- <br>-/* <br>- * 4. Refresh <br>- */ <br>-/*ARGSUSED*/ <br>-static bool_t <br>-authdes_refresh(AUTH *auth, void *dummy __unused) <br>-{ <br>-/* LINTED pointer alignment */ <br>- struct ad_private *ad = AUTH_PRIVATE(auth); <br>- struct authdes_cred *cred = &amp;ad-&gt;ad_cred; <br>- int ok; <br>- netobj pkey; <br>- <br>- if (ad-&gt;ad_dosync) { <br>- ok = __rpc_get_time_offset(&amp;ad-&gt;ad_timediff, ad-&gt;ad_nis_srvr, <br>- ad-&gt;ad_timehost, &amp;(ad-&gt;ad_uaddr), <br>- &amp;(ad-&gt;ad_netid)); <br>- if (! ok) { <br>- /* <br>- * Hope the clocks are synced! <br>- */ <br>- ad-&gt;ad_dosync = 0; <br>- syslog(LOG_DEBUG, <br>- "authdes_refresh: unable to synchronize clock"); <br>- } <br>- } <br>- ad-&gt;ad_xkey = auth-&gt;ah_key; <br>- pkey.n_bytes = (char *)(ad-&gt;ad_pkey); <br>- pkey.n_len = (u_int)strlen((char *)ad-&gt;ad_pkey) + 1; <br>- if (key_encryptsession_pk(ad-&gt;ad_servername, &amp;pkey, &amp;ad-&gt;ad_xkey) &lt; 0) { <br>- syslog(LOG_INFO, <br>- "authdes_refresh: keyserv(1m) is unable to encrypt session key"); <br>- return (FALSE); <br>- } <br>- cred-&gt;adc_fullname.key = ad-&gt;ad_xkey; <br>- cred-&gt;adc_namekind = ADN_FULLNAME; <br>- cred-&gt;adc_fullname.name = ad-&gt;ad_fullname; <br>- return (TRUE); <br>-} <br>- <br>- <br>-/* <br>- * 5. Destroy <br>- */ <br>-static void <br>-authdes_destroy(AUTH *auth) <br>-{ <br>-/* LINTED pointer alignment */ <br>- struct ad_private *ad = AUTH_PRIVATE(auth); <br>- <br>- FREE(ad-&gt;ad_fullname, ad-&gt;ad_fullnamelen + 1); <br>- FREE(ad-&gt;ad_servername, ad-&gt;ad_servernamelen + 1); <br>- if (ad-&gt;ad_timehost) <br>- FREE(ad-&gt;ad_timehost, strlen(ad-&gt;ad_timehost) + 1); <br>- if (ad-&gt;ad_netid) <br>- FREE(ad-&gt;ad_netid, strlen(ad-&gt;ad_netid) + 1); <br>- if (ad-&gt;ad_uaddr) <br>- FREE(ad-&gt;ad_uaddr, strlen(ad-&gt;ad_uaddr) + 1); <br>- FREE(ad, sizeof (struct ad_private)); <br>- FREE(auth, sizeof(AUTH)); <br>-} <br>- <br>-static struct auth_ops * <br>-authdes_ops(void) <br>-{ <br>- static struct auth_ops ops; <br>- <br>- /* VARIABLES PROTECTED BY ops_lock: ops */ <br>- <br>- mutex_lock(&amp;authdes_ops_lock); <br>- if (ops.ah_nextverf == NULL) { <br>- ops.ah_nextverf = authdes_nextverf; <br>- ops.ah_marshal = authdes_marshal; <br>- ops.ah_validate = authdes_validate; <br>- ops.ah_refresh = authdes_refresh; <br>- ops.ah_destroy = authdes_destroy; <br>- } <br>- mutex_unlock(&amp;authdes_ops_lock); <br>- return (&amp;ops); <br>+ return (NULL); <br> } <br>+__sym_compat(authdes_pk_seccreate, __authdes_pk_seccreate, FBSD_1.0); <br>diff --git a/lib/libc/rpc/authdes_prot.c b/lib/libc/rpc/authdes_prot.c <br>index 79a0e5baa084..56b44daafe41 100644 <br>--- a/lib/libc/rpc/authdes_prot.c <br>+++ b/lib/libc/rpc/authdes_prot.c <br>@@ -42,44 +42,16 @@ <br> #include &lt;rpc/auth_des.h&gt; <br> #include "un-namespace.h" <br> <br>-#define ATTEMPT(xdr_op) if (!(xdr_op)) return (FALSE) <br>- <br>-bool_t <br>-xdr_authdes_cred(XDR *xdrs, struct authdes_cred *cred) <br>+static bool_t <br>+__xdr_authdes_cred(XDR *xdrs, void *cred) <br> { <br>- enum authdes_namekind *padc_namekind = &amp;cred-&gt;adc_namekind; <br>- /* <br>- * Unrolled xdr <br>- */ <br>- ATTEMPT(xdr_enum(xdrs, (enum_t *) padc_namekind)); <br>- switch (cred-&gt;adc_namekind) { <br>- case ADN_FULLNAME: <br>- ATTEMPT(xdr_string(xdrs, &amp;cred-&gt;adc_fullname.name, <br>- MAXNETNAMELEN)); <br>- ATTEMPT(xdr_opaque(xdrs, (caddr_t)&amp;cred-&gt;adc_fullname.key, <br>- sizeof(des_block))); <br>- ATTEMPT(xdr_opaque(xdrs, (caddr_t)&amp;cred-&gt;adc_fullname.window, <br>- sizeof(cred-&gt;adc_fullname.window))); <br>- return (TRUE); <br>- case ADN_NICKNAME: <br>- ATTEMPT(xdr_opaque(xdrs, (caddr_t)&amp;cred-&gt;adc_nickname, <br>- sizeof(cred-&gt;adc_nickname))); <br>- return (TRUE); <br>- default: <br>- return (FALSE); <br>- } <br>+ return (FALSE); <br> } <br>+__sym_compat(xdr_authdes_cred, __xdr_authdes_cred, FBSD_1.0); <br> <br>- <br>-bool_t <br>-xdr_authdes_verf(XDR *xdrs, struct authdes_verf *verf) <br>+static bool_t <br>+__xdr_authdes_verf(XDR *xdrs, void *verf) <br> { <br>- /* <br>- * Unrolled xdr <br>- */ <br>- ATTEMPT(xdr_opaque(xdrs, (caddr_t)&amp;verf-&gt;adv_xtimestamp, <br>- sizeof(des_block))); <br>- ATTEMPT(xdr_opaque(xdrs, (caddr_t)&amp;verf-&gt;adv_int_u, <br>- sizeof(verf-&gt;adv_int_u))); <br>- return (TRUE); <br>+ return (FALSE); <br> } <br>+__sym_compat(xdr_authdes_verf, __xdr_authdes_verf, FBSD_1.0); <br>diff --git a/lib/libc/rpc/key_call.c b/lib/libc/rpc/key_call.c <br>index 5c87881c815c..eb274fcfff36 100644 <br>--- a/lib/libc/rpc/key_call.c <br>+++ b/lib/libc/rpc/key_call.c <br>@@ -32,426 +32,78 @@ <br> */ <br> <br> /* <br>- * key_call.c, Interface to keyserver <br>- * <br>- * setsecretkey(key) - set your secret key <br>- * encryptsessionkey(agent, deskey) - encrypt a session key to talk to agent <br>- * decryptsessionkey(agent, deskey) - decrypt ditto <br>- * gendeskey(deskey) - generate a secure des key <br>+ * Secure RPC keyserver support was removed in FreeBSD 15.0. <br>+ * These symbols are provided for backward compatibility, but provide no <br>+ * functionality and will always return an error. <br> */ <br> <br> #include "namespace.h" <br> #include "reentrant.h" <br>-#include &lt;stdio.h&gt; <br>-#include &lt;stdlib.h&gt; <br>-#include &lt;unistd.h&gt; <br>-#include &lt;errno.h&gt; <br> #include &lt;rpc/rpc.h&gt; <br>-#include &lt;rpc/auth.h&gt; <br>-#include &lt;rpc/auth_unix.h&gt; <br> #include &lt;rpc/key_prot.h&gt; <br>-#include &lt;string.h&gt; <br>-#include &lt;netconfig.h&gt; <br>-#include &lt;sys/utsname.h&gt; <br>-#include &lt;stdlib.h&gt; <br>-#include &lt;signal.h&gt; <br>-#include &lt;sys/wait.h&gt; <br>-#include &lt;sys/fcntl.h&gt; <br>+#include &lt;rpc/auth.h&gt; <br> #include "un-namespace.h" <br> #include "mt_misc.h" <br> <br>- <br>-#define KEY_TIMEOUT 5 /* per-try timeout in seconds */ <br>-#define KEY_NRETRY 12 /* number of retries */ <br>- <br>-#ifdef DEBUG <br>-#define debug(msg) (void) fprintf(stderr, "%s\n", msg); <br>-#else <br>-#define debug(msg) <br>-#endif /* DEBUG */ <br>- <br>-/* <br>- * Hack to allow the keyserver to use AUTH_DES (for authenticated <br>- * NIS+ calls, for example). The only functions that get called <br>- * are key_encryptsession_pk, key_decryptsession_pk, and key_gendes. <br>- * <br>- * The approach is to have the keyserver fill in pointers to local <br>- * implementations of these functions, and to call those in key_call(). <br>- */ <br>- <br>-cryptkeyres *(*__key_encryptsession_pk_LOCAL)(uid_t, void *arg) = 0; <br>-cryptkeyres *(*__key_decryptsession_pk_LOCAL)(uid_t, void *arg) = 0; <br>-des_block *(*__key_gendes_LOCAL)(uid_t, void *) = 0; <br>- <br>-static int key_call( u_long, xdrproc_t, void *, xdrproc_t, void *); <br>- <br>-int <br>-key_setsecret(const char *secretkey) <br>-{ <br>- keystatus status; <br>- <br>- if (!key_call((u_long) KEY_SET, (xdrproc_t)xdr_keybuf, <br>- (void *)secretkey, <br>- (xdrproc_t)xdr_keystatus, &amp;status)) { <br>- return (-1); <br>- } <br>- if (status != KEY_SUCCESS) { <br>- debug("set status is nonzero"); <br>- return (-1); <br>- } <br>- return (0); <br>-} <br>- <br>- <br>-/* key_secretkey_is_set() returns 1 if the keyserver has a secret key <br>- * stored for the caller's effective uid; it returns 0 otherwise <br>- * <br>- * N.B.: The KEY_NET_GET key call is undocumented. Applications shouldn't <br>- * be using it, because it allows them to get the user's secret key. <br>- */ <br>- <br>-int <br>-key_secretkey_is_set(void) <br>-{ <br>- struct key_netstres kres; <br>- <br>- memset((void*)&amp;kres, 0, sizeof (kres)); <br>- if (key_call((u_long) KEY_NET_GET, (xdrproc_t)xdr_void, NULL, <br>- (xdrproc_t)xdr_key_netstres, &amp;kres) &amp;&amp; <br>- (kres.status == KEY_SUCCESS) &amp;&amp; <br>- (kres.key_netstres_u.knet.st_priv_key[0] != 0)) { <br>- /* avoid leaving secret key in memory */ <br>- memset(kres.key_netstres_u.knet.st_priv_key, 0, HEXKEYBYTES); <br>- return (1); <br>- } <br>- return (0); <br>-} <br>- <br>-int <br>-key_encryptsession_pk(char *remotename, netobj *remotekey, des_block *deskey) <br>-{ <br>- cryptkeyarg2 arg; <br>- cryptkeyres res; <br>- <br>- arg.remotename = remotename; <br>- arg.remotekey = *remotekey; <br>- arg.deskey = *deskey; <br>- if (!key_call((u_long)KEY_ENCRYPT_PK, (xdrproc_t)xdr_cryptkeyarg2, &amp;arg, <br>- (xdrproc_t)xdr_cryptkeyres, &amp;res)) { <br>- return (-1); <br>- } <br>- if (res.status != KEY_SUCCESS) { <br>- debug("encrypt status is nonzero"); <br>- return (-1); <br>- } <br>- *deskey = res.cryptkeyres_u.deskey; <br>- return (0); <br>-} <br>- <br>-int <br>-key_decryptsession_pk(char *remotename, netobj *remotekey, des_block *deskey) <br>-{ <br>- cryptkeyarg2 arg; <br>- cryptkeyres res; <br>- <br>- arg.remotename = remotename; <br>- arg.remotekey = *remotekey; <br>- arg.deskey = *deskey; <br>- if (!key_call((u_long)KEY_DECRYPT_PK, (xdrproc_t)xdr_cryptkeyarg2, &amp;arg, <br>- (xdrproc_t)xdr_cryptkeyres, &amp;res)) { <br>- return (-1); <br>- } <br>- if (res.status != KEY_SUCCESS) { <br>- debug("decrypt status is nonzero"); <br>- return (-1); <br>- } <br>- *deskey = res.cryptkeyres_u.deskey; <br>- return (0); <br>-} <br>- <br>-int <br>-key_encryptsession(const char *remotename, des_block *deskey) <br>+static int <br>+__key_setsecret(const char *secretkey) <br> { <br>- cryptkeyarg arg; <br>- cryptkeyres res; <br>- <br>- arg.remotename = (char *) remotename; <br>- arg.deskey = *deskey; <br>- if (!key_call((u_long)KEY_ENCRYPT, (xdrproc_t)xdr_cryptkeyarg, &amp;arg, <br>- (xdrproc_t)xdr_cryptkeyres, &amp;res)) { <br>- return (-1); <br>- } <br>- if (res.status != KEY_SUCCESS) { <br>- debug("encrypt status is nonzero"); <br>- return (-1); <br>- } <br>- *deskey = res.cryptkeyres_u.deskey; <br>- return (0); <br>+ return (-1); <br> } <br>+__sym_compat(key_setsecret, __key_setsecret, FBSD_1.0); <br> <br>-int <br>-key_decryptsession(const char *remotename, des_block *deskey) <br>+static int <br>+__key_secretkey_is_set(void) <br> { <br>- cryptkeyarg arg; <br>- cryptkeyres res; <br>- <br>- arg.remotename = (char *) remotename; <br>- arg.deskey = *deskey; <br>- if (!key_call((u_long)KEY_DECRYPT, (xdrproc_t)xdr_cryptkeyarg, &amp;arg, <br>- (xdrproc_t)xdr_cryptkeyres, &amp;res)) { <br>- return (-1); <br>- } <br>- if (res.status != KEY_SUCCESS) { <br>- debug("decrypt status is nonzero"); <br>- return (-1); <br>- } <br>- *deskey = res.cryptkeyres_u.deskey; <br> return (0); <br> } <br>+__sym_compat(key_secretkey_is_set, __key_secretkey_is_set, FBSD_1.0); <br> <br>-int <br>-key_gendes(des_block *key) <br>+static int <br>+__key_encryptsession_pk(char *remotename, netobj *remotekey, des_block *deskey) <br> { <br>- if (!key_call((u_long)KEY_GEN, (xdrproc_t)xdr_void, NULL, <br>- (xdrproc_t)xdr_des_block, key)) { <br>- return (-1); <br>- } <br>- return (0); <br>+ return (-1); <br> } <br>+__sym_compat(key_encryptsession_pk, __key_encryptsession_pk, FBSD_1.0); <br> <br>-int <br>-key_setnet(struct key_netstarg *arg) <br>+static int <br>+__key_decryptsession_pk(char *remotename, netobj *remotekey, des_block *deskey) <br> { <br>*** 2726 LINES SKIPPED *** <br> <br></div> </div> </blockquote> </div> </div> </blockquote> </body></html>
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8e7a9c07-5efd-4450-a590-a6aeaa59b402>