third_party/heimdal: Import lorikeet-heimdal-202311012221 (commit 87159bd32148be80a0d...
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 1 Nov 2023 22:24:35 +0000 (11:24 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 2 Nov 2023 03:08:37 +0000 (03:08 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
19 files changed:
third_party/heimdal/kdc/pkinit.c
third_party/heimdal/kuser/kinit.c
third_party/heimdal/lib/hcrypto/rsa-ltm.c
third_party/heimdal/lib/hx509/ca.c
third_party/heimdal/lib/hx509/cms.c
third_party/heimdal/lib/krb5/crypto-evp.c
third_party/heimdal/lib/roken/strerror.c
third_party/heimdal/lib/wind/UnicodeData.py
third_party/heimdal/lib/wind/gen-bidi.py
third_party/heimdal/lib/wind/gen-combining.py
third_party/heimdal/lib/wind/gen-errorlist.py
third_party/heimdal/lib/wind/gen-map.py
third_party/heimdal/lib/wind/gen-normalize.py
third_party/heimdal/lib/wind/gen-punycode-examples.py
third_party/heimdal/lib/wind/generate.py
third_party/heimdal/lib/wind/rfc3454.py
third_party/heimdal/lib/wind/rfc4518.py
third_party/heimdal/lib/wind/stringprep.py
third_party/heimdal/lib/wind/util.py

index 88aa2887fb7f7ee915395ffd2c7be1122f84774c..d97ae227ae6a70210826f47420a37f9e5ac59451 100644 (file)
@@ -111,7 +111,7 @@ pk_check_pkauthenticator_win2k(krb5_context context,
 
 static krb5_error_code
 pk_check_pkauthenticator(krb5_context context,
-                        PKAuthenticator *a,
+                        const PKAuthenticator *a,
                         const KDC_REQ *req)
 {
     krb5_error_code ret;
@@ -1509,7 +1509,7 @@ _kdc_pk_mk_pa_reply(astgs_request_t r, pk_client_params *cp)
            if (ret) {
                close(fd);
                kdc_log(r->context, config, 0,
-                       "PKINIT failed to stat ocsp data %d", ret);
+                       "PKINIT failed to allocate ocsp data %d", ret);
                goto out_ocsp;
            }
            ocsp.data.length = sb.st_size;
@@ -1649,8 +1649,12 @@ match_ms_upn_san(krb5_context context,
        goto out;
 
     if (list.len != 1) {
-       kdc_log(context, config, 0,
-               "More than one PKINIT MS UPN SAN");
+       if (list.len)
+           kdc_log(context, config, 0,
+                   "More than one PKINIT MS UPN SAN");
+       else
+           kdc_log(context, config, 0,
+                   "No PKINIT MS UPN SAN");
        ret = KRB5_KDC_ERR_CLIENT_NAME_MISMATCH;
        goto out;
     }
@@ -1662,7 +1666,7 @@ match_ms_upn_san(krb5_context context,
     }
     if (size != list.val[0].length) {
        free_MS_UPN_SAN(&upn);
-       kdc_log(context, config, 0, "Trailing data in ");
+       kdc_log(context, config, 0, "Trailing data in MS UPN SAN");
        ret = KRB5_KDC_ERR_CLIENT_NAME_MISMATCH;
        goto out;
     }
@@ -2139,7 +2143,7 @@ krb5_kdc_pk_initialize(krb5_context context,
                           NULL,
                           NULL);
     if (ret) {
-       krb5_warn(context, ret, "PKINIT: ");
+       krb5_warn(context, ret, "PKINIT: failed to load ID");
        config->enable_pkinit = 0;
        return ret;
     }
index a5e00c943392a13dd9263efcc447734d422e02da..d5410df05c23db93d7c1d1779b199fb802b535a0 100644 (file)
@@ -1744,7 +1744,7 @@ main(int argc, char **argv)
         pk_anon_fast_armor = 0;
     } else if (argc && argv[0][0] == '@' &&
        (gss_preauth_mech || anonymous_flag)) {
-       const char *instance;
+       const char *instance = NULL;
 
        if (gss_preauth_mech) {
            instance = KRB5_FEDERATED_NAME;
index 49e35f5a38a97f19fa1691bb346c6ce508a3499f..aec51da757a199550f41b2d28fbdf752027aa186 100644 (file)
@@ -167,7 +167,7 @@ ltm_rsa_public_encrypt(int flen, const unsigned char* from,
                        unsigned char* to, RSA* rsa, int padding)
 {
     unsigned char *p = NULL, *p0 = NULL;
-    size_t size, ssize, padlen;
+    size_t size, ssize = 0, padlen;
     mp_int enc, dec, n, e;
     mp_err ret;
     int where = __LINE__;
@@ -222,9 +222,9 @@ static int
 ltm_rsa_public_decrypt(int flen, const unsigned char* from,
                       unsigned char* to, RSA* rsa, int padding)
 {
-    unsigned char *p;
+    unsigned char *p = NULL;
     mp_err ret;
-    size_t size;
+    size_t size = 0;
     mp_int s, us, n, e;
     int where = __LINE__;
 
@@ -273,7 +273,7 @@ static int
 ltm_rsa_private_encrypt(int flen, const unsigned char* from,
                        unsigned char* to, RSA* rsa, int padding)
 {
-    unsigned char *ptr, *ptr0 = NULL;
+    unsigned char *ptr = NULL, *ptr0 = NULL;
     mp_err ret;
     mp_int in, out, n, e;
     mp_int bi, b;
index 1ca8d51da39ec2f4605f5dd5501e6ff6c8e20695..ee5d56af29cb1cd2bfd81a12b6f40baed3734cea 100644 (file)
@@ -442,7 +442,7 @@ hx509_ca_tbs_set_from_csr(hx509_context context,
                          hx509_request req)
 {
     hx509_san_type san_type;
-    heim_oid oid = { 0, 0 };
+    heim_oid oid = { 0, NULL };
     KeyUsage ku;
     size_t i;
     char *s = NULL;
@@ -2673,7 +2673,7 @@ set_template(hx509_context context,
         size_t i;
 
         for (i = 0; ret == 0 && ekus[i]; i++) {
-            heim_oid oid = { 0, 0 };
+            heim_oid oid = { 0, NULL };
 
             if ((ret = der_find_or_parse_heim_oid(ekus[i], ".", &oid)) == 0)
                 ret = hx509_ca_tbs_add_eku(context, tbs, &oid);
index c770b8132624aa9acbec3523776cc63ef8ca8e73..6bf972ce4925a13e1a05aee4304ce21efcd94143 100644 (file)
@@ -242,7 +242,10 @@ unparse_CMSIdentifier(hx509_context context,
        if (len < 0)
            return ENOMEM;
 
-       ret = asprintf(str, "certificate with id %s", keyid);
+       if (len)
+           ret = asprintf(str, "certificate with id %s", keyid);
+       else
+           ret = asprintf(str, "certificate");
        free(keyid);
        break;
     }
@@ -925,7 +928,7 @@ hx509_cms_verify_signed_ext(hx509_context context,
     }
 
     for (found_valid_sig = 0, i = 0; i < sd.signerInfos.len; i++) {
-       heim_octet_string signed_data = { 0, 0 };
+       heim_octet_string signed_data = { 0, NULL };
        const heim_oid *match_oid;
        heim_oid decode_oid;
 
@@ -1187,7 +1190,7 @@ add_one_attribute(Attribute **attr,
 }
 
 /**
- * Decode SignedData and verify that the signature is correct.
+ * Sign and encode a SignedData structure.
  *
  * @param context A hx509 context.
  * @param flags
@@ -1517,13 +1520,11 @@ hx509_cms_create_signed(hx509_context context,
                        heim_octet_string *signed_data)
 {
     unsigned int i, j;
-    hx509_name name;
     int ret;
     size_t size;
     struct sigctx sigctx;
 
     memset(&sigctx, 0, sizeof(sigctx));
-    memset(&name, 0, sizeof(name));
 
     if (eContentType == NULL)
        eContentType = &asn1_oid_id_pkcs7_data;
index 0ed749a243ccb6b5a246be8a4df4a36734c76650..82237f1513ab6976123ea7740690a91b28ed1a06 100644 (file)
@@ -126,7 +126,7 @@ _krb5_evp_hmac_iov(krb5_context context,
                    ENGINE *engine)
 {
     HMAC_CTX *ctx;
-    krb5_data current = {0, 0};
+    krb5_data current = {0, NULL};
     int i;
 
     if (crypto != NULL) {
index b5ec6918e69ad2cf5781af1c6037f92826920c7b..93afee0650630bba6858dd218dd12c06e4cf14f4 100644 (file)
@@ -38,7 +38,7 @@
 #include <errno.h>
 
 extern int sys_nerr;
-extern char *sys_errlist[];
+extern const char *const sys_errlist[];
 
 ROKEN_LIB_FUNCTION char* ROKEN_LIB_CALL
 strerror(int eno)
index 8ce3bcade279caf105d726008067540819d8c62e..74e76edbf060885bb9c06d4491a695f380bbbc87 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/local/bin/python
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 # $Id$
 
index e2efcbb555a20412454b8978f514010464fe3bab..f01ed6b16afcf2a6a8865d78d6da69a399b4432a 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/local/bin/python
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 # $Id$
 
index 43e0d52eb3cfab1b00960a082d50d5357cee9ea5..00481b22c7b43afe61be883bc2872459ef9556c5 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/local/bin/python
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 # $Id$
 
index 97646cf5aed695989bf6f274741c920f1d314ab3..a2f1bb12b00091c08eab7d8a01935413c5392e96 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/local/bin/python
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 # $Id$
 
index dc10d6fae7f646e97eaa6c4c2837dc49ae5f6631..2757b5a89aa603b3c2b55195207444c13cc4829b 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/local/bin/python
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 # $Id$
 
index daf3c3dc42f1bb2529adb510dc96734ad0c7f511..86ec5fd17d324bf5f3e8baf03746c47c385c7c05 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/local/bin/python
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 # $Id$
 
index f2eddbb373860319b2023152566a070a6836bdb6..0896f99d77daef73e61aea9cdbe39d7c6bc0540a 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/local/bin/python
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 # $Id$
 
index 0a32fcd4d4d8b9980b8751c7d255871182de5471..510dfd9c6c344feecf90bee2355850c4701a34d1 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/local/bin/python
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 # $Id$
 
index 33f70a9b75c120e5c77f9c187a0aaebb994b16e7..0c830537240404e2b05cd82a1b8a3b01097e9396 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/local/bin/python
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 # $Id$
 
@@ -47,13 +47,13 @@ def read(filename):
         if not l:
             break
         if inTable:
-            m = re.search('^ *----- End Table ([A-Z0-9\.]+) ----- *$', l)
+            m = re.search(r'^ *----- End Table ([A-Z0-9\.]+) ----- *$', l)
             if m:
                 ret[m.group(1)] = t
                 inTable = False
             else:
                 t.append(l)
-        if re.search('^ *----- Start Table ([A-Z0-9\.]+) ----- *$', l):
+        if re.search(r'^ *----- Start Table ([A-Z0-9\.]+) ----- *$', l):
             inTable = True
             t = []
     f.close()
index a222fce16a64a29b9a67df3d9dfa077b388e7894..021550ca6c53507d214899b93b9bd24d5fb380fb 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/local/bin/python
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 # $Id$
 
index cff4d02a7b6dab63e2ac55d85ca3f2884cd50c93..b75b5455e651ecdfe3d60f707f7d1dd7b5fbd59a 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/local/bin/python
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 # $Id$
 
index a05c7398f5cfafb63eabb7228bf1a8543202833b..06a25160dbd7cdfb0fb60694c2e87e106aebf936 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/local/bin/python
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 
 # $Id$