From nobody Thu Dec 01 14:25:31 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NNJJW5GD7z4jLMd; Thu, 1 Dec 2022 14:25:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NNJJW4HvYz3sQm; Thu, 1 Dec 2022 14:25:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669904731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMBVEtL4oRwBfWuRXvoY5YZK+JjPWgZdLty1T9f6cF0=; b=uIzKYlJwVMpwjQJGQ7nMVmzbaoyznlNVUSIERIuJgam6N+vpgRa9cPlhaF24/3tEeoUC+V a1gWVk6NZKLf8wcA6EDoBDKoWeiPJ2TrhFrYNrvCaeYgphIcUjIIktD6wxwJVbnQpZCqGO +oj/XdLf3rlhUu0mMyqvUsETV5/mpxBZ0eBsW6lHElP/xSLYuMybsAMOjiZmh0eyq3Ktjc FqmV81A7BvGg7wGNlTlN7jxd5RhU6PKOXJJMnB6AOvF2yYKrcC6a3JGrbU96l20Smc5rHa pPbokvrn1715gn9CmZTqRTQ9uOEcmjc3G397lyhGZzctMBhREYCt6CxPXWYolg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669904731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OMBVEtL4oRwBfWuRXvoY5YZK+JjPWgZdLty1T9f6cF0=; b=cH5+DTNOz1jI0epCJ8Q6cBx1bvCvKm6HH76zU2l63zlL3xb1f41x5fNwyK5yEgb7gHAc0/ REGmu5Rzlda+hNdQxvWWoXGMRIaE8ddPU8W9Ncl1ksB5mix1wBzVk1cx2qiGgcghk8hB7m 3gTRDMil1cxhHOvQGsDGd/5baTKMFmCx+EaOn2ws4dv3drae9Csfm4rOXlUIl89wJy3sTK ulzZAkOE6F5ZVJQ3/jMel8MO0JpMg7A152ffaRCarKp3YNJ44OyptsTKQ4s0ZHy9k5Gp3H I9Ft1pHprrveVMhOPQMKtrJ+wW+shujiEkoyiQgKsP8wlBAPx/stR7DHimlZaA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669904731; a=rsa-sha256; cv=none; b=VZurMRV6ei3qqBLiumdqLVYdBWUqy8lIQW8Pg/sQwS0j0yXVUaM6+fJbw2cX/V1KPMXSXx wJgpLcoibKCZ+3dO/RK4ex0SKwlZQzX4phjK2Y7nmL86cXh/QP98WxZ9vPh2kS4Rz/qaz2 S13hzlZ/7x1QV7gJ3a9YjxndGBeyQLsVnD8giPVrKINznsRcK+dC+u0KbL2jAcUndvDhrN g8Fcy2OLtK39tf4ACOUdm/IEfHHMLfY0QaEexrvGn2wsg4bzKp4Lpw2h97M6TdAT2L4OsZ Dzq4J1Xf+/WgXs3uesMU/qI9iN8Nn6rKiawXh+W9J5GpGAouBicwei4EJ2yP2w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NNJJW3PpQzfxV; Thu, 1 Dec 2022 14:25:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2B1EPV9A079193; Thu, 1 Dec 2022 14:25:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2B1EPVTG079192; Thu, 1 Dec 2022 14:25:31 GMT (envelope-from git) Date: Thu, 1 Dec 2022 14:25:31 GMT Message-Id: <202212011425.2B1EPVTG079192@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Cy Schubert Subject: git: d310918268cb - stable/13 - heimdal: Add missing kadm5 error checks List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cy X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d310918268cb5384c2ec900acd6ae1630cba82c5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cy: URL: https://cgit.FreeBSD.org/src/commit/?id=d310918268cb5384c2ec900acd6ae1630cba82c5 commit d310918268cb5384c2ec900acd6ae1630cba82c5 Author: Cy Schubert AuthorDate: 2022-11-26 17:06:09 +0000 Commit: Cy Schubert CommitDate: 2022-12-01 14:25:10 +0000 heimdal: Add missing kadm5 error checks Obtained from: Heimdal commit 4a0e01f9edabe36d0f2cab188078dd29fa5aaf02 (cherry picked from commit 879b0e9cd2ada8f815e208d31feb4b7c05ba7e4a) --- crypto/heimdal/lib/kadm5/get_princs_s.c | 3 ++- crypto/heimdal/lib/kadm5/get_s.c | 2 ++ crypto/heimdal/lib/kadm5/rename_s.c | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/crypto/heimdal/lib/kadm5/get_princs_s.c b/crypto/heimdal/lib/kadm5/get_princs_s.c index 55c8f2e98b60..3ccd18f87a14 100644 --- a/crypto/heimdal/lib/kadm5/get_princs_s.c +++ b/crypto/heimdal/lib/kadm5/get_princs_s.c @@ -93,7 +93,8 @@ kadm5_s_get_principals(void *server_handle, d.exp = expression; { krb5_realm r; - krb5_get_default_realm(context->context, &r); + if ((ret = krb5_get_default_realm(context->context, &r))) + return (ret); asprintf(&d.exp2, "%s@%s", expression, r); free(r); } diff --git a/crypto/heimdal/lib/kadm5/get_s.c b/crypto/heimdal/lib/kadm5/get_s.c index 6c456e118316..6c966a9281e1 100644 --- a/crypto/heimdal/lib/kadm5/get_s.c +++ b/crypto/heimdal/lib/kadm5/get_s.c @@ -231,6 +231,8 @@ kadm5_s_get_principal(void *server_handle, unsigned char buf[4]; _krb5_put_int(buf, last_pw_expire, sizeof(buf)); ret = add_tl_data(out, KRB5_TL_LAST_PWD_CHANGE, buf, sizeof(buf)); + if (ret) + goto out; } if(ret){ kadm5_free_principal_ent(context, out); diff --git a/crypto/heimdal/lib/kadm5/rename_s.c b/crypto/heimdal/lib/kadm5/rename_s.c index 08351290c9a6..1b3cc5a11f3b 100644 --- a/crypto/heimdal/lib/kadm5/rename_s.c +++ b/crypto/heimdal/lib/kadm5/rename_s.c @@ -66,7 +66,9 @@ kadm5_s_rename_principal(void *server_handle, Salt salt; krb5_salt salt2; memset(&salt, 0, sizeof(salt)); - krb5_get_pw_salt(context->context, source, &salt2); + ret = krb5_get_pw_salt(context->context, source, &salt2); + if (ret) + goto out; salt.type = hdb_pw_salt; salt.salt = salt2.saltvalue; for(i = 0; i < ent.entry.keys.len; i++){