Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package gnutls for openSUSE:Factory checked in at 2026-07-15 16:24:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/gnutls (Old) and /work/SRC/openSUSE:Factory/.gnutls.new.1991 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "gnutls" Wed Jul 15 16:24:55 2026 rev:170 rq:1364780 version:3.8.13 Changes: -------- --- /work/SRC/openSUSE:Factory/gnutls/gnutls.changes 2026-05-05 15:14:23.456752204 +0200 +++ /work/SRC/openSUSE:Factory/.gnutls.new.1991/gnutls.changes 2026-07-15 16:25:04.064610782 +0200 @@ -1,0 +2,20 @@ +Fri May 15 12:23:28 UTC 2026 - Pedro Monreal <[email protected]> + +- FIPS: Add NIST SP800-56Brev2 6.4.2.2 check: + * Partial public-key validation for RSA OAEP (bsc#1262397) + * Add gnutls-FIPS-RSA-OAEP-PK-validation.patch + +------------------------------------------------------------------- +Tue May 12 10:12:34 UTC 2026 - Pedro Monreal <[email protected]> + +- FIPS: Perform the integrity checks for libleancrypto-fips and + libleancrypto with the HMACs provided by the library (bsc#1262399) + * Add gnutls-FIPS-HMAC-leancrypto.patch + +------------------------------------------------------------------- +Tue May 12 09:30:13 UTC 2026 - Pedro Monreal <[email protected]> + +- FIPS: Remove GNUTLS_MAC_SHA1 FIPS self-test (bsc#1262400) + * Add gnutls-FIPS-Remove-SHA1-self-test.patch + +------------------------------------------------------------------- New: ---- gnutls-FIPS-HMAC-leancrypto.patch gnutls-FIPS-RSA-OAEP-PK-validation.patch gnutls-FIPS-Remove-SHA1-self-test.patch ----------(New B)---------- New: libleancrypto with the HMACs provided by the library (bsc#1262399) * Add gnutls-FIPS-HMAC-leancrypto.patch New: * Partial public-key validation for RSA OAEP (bsc#1262397) * Add gnutls-FIPS-RSA-OAEP-PK-validation.patch New:- FIPS: Remove GNUTLS_MAC_SHA1 FIPS self-test (bsc#1262400) * Add gnutls-FIPS-Remove-SHA1-self-test.patch ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ gnutls.spec ++++++ --- /var/tmp/diff_new_pack.Wjt9I7/_old 2026-07-15 16:25:06.368689245 +0200 +++ /var/tmp/diff_new_pack.Wjt9I7/_new 2026-07-15 16:25:06.372689382 +0200 @@ -70,6 +70,13 @@ Patch5: gnutls-FIPS-140-3-references.patch #PATCH-FIX-SUSE bsc#1260395 Fix build with autoconf 2.73 Patch6: gnutls-C23.patch +#PATCH-FIX-SUSE bsc#1262400 FIPS: Remove GNUTLS_MAC_SHA1 FIPS self-test +Patch7: gnutls-FIPS-Remove-SHA1-self-test.patch +#PATCH-FIX-SUSE bsc#1262399 FIPS: Perform integrity check for libleancrypto +Patch8: gnutls-FIPS-HMAC-leancrypto.patch +#PATCH-FIX-SUSE bsc#1262397 Add NIST SP800-56Brev2 6.4.2.2 check: Partial public-key validation for RSA OAEP +Patch9: gnutls-FIPS-RSA-OAEP-PK-validation.patch + BuildRequires: autogen BuildRequires: automake BuildRequires: datefudge ++++++ gnutls-FIPS-HMAC-leancrypto.patch ++++++ Index: gnutls-3.8.10/configure.ac =================================================================== --- gnutls-3.8.10.orig/configure.ac +++ gnutls-3.8.10/configure.ac @@ -890,6 +890,29 @@ LIBGNUTLS_CHECK_SONAME([hogweed], [AC_LA LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" +AC_ARG_WITH([leancrypto], + [AS_HELP_STRING([--with-leancrypto], [enable leancrypto library HMAC check])], + [with_leancrypto=$withval], + [with_leancrypto=no]) + +AS_IF([test "x$with_leancrypto" != "xno"], [ + save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $LEANCRYPTO_CFLAGS" + save_LIBS=$LIBS + LIBS="$LIBS $LEANCRYPTO_LIBS -lleancrypto" + + LIBGNUTLS_CHECK_SONAME([leancrypto], [ + AC_LANG_PROGRAM([ + extern void lc_fips_integrity_checker(void); + ],[ + lc_fips_integrity_checker(); + ]) + ]) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +]) + gnutls_so=libgnutls.so.`expr "$LT_CURRENT" - "$LT_AGE"` AC_DEFINE_UNQUOTED([GNUTLS_LIBRARY_SONAME], ["$gnutls_so"], [The soname of gnutls library]) AC_SUBST([gnutls_so]) Index: gnutls-3.8.10/lib/fips.c =================================================================== --- gnutls-3.8.10.orig/lib/fips.c +++ gnutls-3.8.10/lib/fips.c @@ -178,6 +178,9 @@ struct hmac_file { #ifdef GMP_LIBRARY_SONAME struct hmac_entry gmp; #endif +#ifdef LEANCRYPTO_LIBRARY_SONAME + struct hmac_entry leancrypto; +#endif }; struct lib_paths { @@ -191,6 +194,9 @@ struct lib_paths { #ifdef GMP_LIBRARY_SONAME char gmp[GNUTLS_PATH_MAX]; #endif +#ifdef LEANCRYPTO_LIBRARY_SONAME + char leancrypto[GNUTLS_PATH_MAX]; +#endif }; /* @@ -262,6 +268,10 @@ static int handler(void *user, const cha } else if (!strcmp(section, GMP_LIBRARY_SONAME)) { return lib_handler(&p->gmp, section, name, value); #endif +#ifdef LEANCRYPTO_LIBRARY_SONAME + } else if (!strcmp(section, LEANCRYPTO_LIBRARY_SONAME)) { + return lib_handler(&p->leancrypto, section, name, value); +#endif } else { return 0; } @@ -527,6 +537,10 @@ static int callback(struct dl_phdr_info else if (!strncmp(soname, GMP_LIBRARY_SONAME, strlen(GMP_LIBRARY_SONAME))) _gnutls_str_cpy(paths->gmp, GNUTLS_PATH_MAX, path); #endif +#ifdef LEANCRYPTO_LIBRARY_SONAME + else if (!strncmp(soname, LEANCRYPTO_LIBRARY_SONAME, strlen(LEANCRYPTO_LIBRARY_SONAME))) + _gnutls_str_cpy(paths->leancrypto, GNUTLS_PATH_MAX, path); +#endif return 0; } @@ -557,6 +571,12 @@ static int load_lib_paths(struct lib_pat return gnutls_assert_val(GNUTLS_E_FILE_ERROR); } #endif +#ifdef LEANCRYPTO_LIBRARY_SONAME + if (paths->leancrypto[0] == '\0') { + _gnutls_debug_log("Leancrypto library path was not found\n"); + return gnutls_assert_val(GNUTLS_E_FILE_ERROR); + } +#endif return GNUTLS_E_SUCCESS; } @@ -621,6 +641,11 @@ static int check_binary_integrity(void) if (ret < 0) return ret; #endif +#ifdef LEANCRYPTO_LIBRARY_SONAME + ret = check_dep_lib_hmac(paths.leancrypto); + if (ret < 0) + return ret; +#endif return 0; } Index: gnutls-3.8.10/lib/fipshmac.c =================================================================== --- gnutls-3.8.10.orig/lib/fipshmac.c +++ gnutls-3.8.10/lib/fipshmac.c @@ -121,6 +121,11 @@ static int callback(struct dl_phdr_info if (!strcmp(soname, GMP_LIBRARY_SONAME)) return print_lib(path, soname); #endif +#ifdef LEANCRYPTO_LIBRARY_SONAME + if (!strncmp(soname, LEANCRYPTO_LIBRARY_SONAME, strlen(LEANCRYPTO_LIBRARY_SONAME))) + return print_lib(path, soname); +#endif + return 0; } Index: gnutls-3.8.10/lib/global.c =================================================================== --- gnutls-3.8.10.orig/lib/global.c +++ gnutls-3.8.10/lib/global.c @@ -610,6 +610,9 @@ static const struct gnutls_library_confi #ifdef GMP_LIBRARY_SONAME { "libgmp-soname", GMP_LIBRARY_SONAME }, #endif +#ifdef LEANCRYPTO_LIBRARY_SONAME + { "libleancrypto-soname", LEANCRYPTO_LIBRARY_SONAME }, +#endif { "hardware-features", HW_FEATURES }, { "tls-features", TLS_FEATURES }, #ifdef DEFAULT_TRUST_STORE_PKCS11 @@ -643,6 +646,8 @@ static const struct gnutls_library_confi * * - libgmp-soname: the library SONAME of linked libgmp * + * - libleancrypto-soname: the library SONAME of linked libleancrypto + * * - hardware-features: enabled hardware support features * * - tls-features: enabled TLS protocol features ++++++ gnutls-FIPS-RSA-OAEP-PK-validation.patch ++++++ Index: gnutls-3.8.10/lib/nettle/pk.c =================================================================== --- gnutls-3.8.10.orig/lib/nettle/pk.c +++ gnutls-3.8.10/lib/nettle/pk.c @@ -1015,6 +1015,67 @@ static inline int _rsa_oaep_encrypt(gnut message, ciphertext); } + + +static const size_t small_primes[] = { + 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, + 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, + 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, + 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, + 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, + 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, + 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, + 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, + 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, + 479, 487, 491, 499, 503, 509, 521, 523, 541, 547, + 557, 563, 569, 571, 577, 587, 593, 599, 601, 607, + 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, + 673, 677, 683, 691, 701, 709, 719, 727, 733, 739, + 743, 751 +}; + +static int +_gnutls_rsa_oaep_public_key_validate_nist(const struct rsa_public_key *pub) +{ + /* 1. The length of the modulus is one of the specified values in FIPS 186-5. + * SP 800-56B rev2 dictates 2048 bits or larger. */ + if (unlikely(mpz_sizeinbase(pub->n, 2) < 2048)) { + return GNUTLS_E_PK_INVALID_PUBKEY; + } + + /* 3. The modulus and the public exponent are odd numbers. */ + if (unlikely(mpz_even_p(pub->n) || mpz_even_p(pub->e))) { + return GNUTLS_E_PK_INVALID_PUBKEY; + } + + /* 2. The value of the public exponent is in the valid range. + * FIPS 186-5 specifies: 65537 <= e < 2^256. */ + if (unlikely(mpz_cmp_ui(pub->e, 65537) < 0 || mpz_sizeinbase(pub->e, 2) > 256)) { + return GNUTLS_E_PK_INVALID_PUBKEY; + } + + /* 4. The modulus is composite, but not a power of a prime. + * mpz_probab_prime_p returns >0 if prime/probable prime, 0 if composite. */ + if (unlikely(mpz_probab_prime_p(pub->n, 25) > 0)) { + return GNUTLS_E_PK_INVALID_PUBKEY; + } + + /* GMP's built-in perfect power checker identifies if n == p^k. */ + if (unlikely(mpz_perfect_power_p(pub->n))) { + return GNUTLS_E_PK_INVALID_PUBKEY; + } + + /* 5. The modulus has no factors smaller than 752. */ + size_t num_primes = sizeof(small_primes) / sizeof(small_primes[0]); + for (size_t i = 0; i < num_primes; i++) { + if (unlikely(mpz_divisible_ui_p(pub->n, small_primes[i]))) { + return GNUTLS_E_PK_INVALID_PUBKEY; + } + } + + return 0; +} + static int _wrap_nettle_pk_encrypt(gnutls_pk_algorithm_t algo, gnutls_datum_t *ciphertext, const gnutls_datum_t *plaintext, @@ -1088,6 +1149,18 @@ static int _wrap_nettle_pk_encrypt(gnutl else random_func = rnd_nonce_func; +#ifdef ENABLE_FIPS140 + if (_gnutls_fips_mode_enabled()) { + /* Perform partial public-key validation before using the + * recipient's RSA public key for OAEP key transport + * according to NIST SP800-56Brev2 6.4.2.2. + */ + if (_gnutls_rsa_oaep_public_key_validate_nist(&pub)) { + not_approved = true; + } + } +#endif + buf = gnutls_malloc(pub.size); if (!buf) { ret = gnutls_assert_val(GNUTLS_E_MEMORY_ERROR); ++++++ gnutls-FIPS-Remove-SHA1-self-test.patch ++++++ Index: gnutls-3.8.10/lib/fips.c =================================================================== --- gnutls-3.8.10.orig/lib/fips.c +++ gnutls-3.8.10/lib/fips.c @@ -702,11 +702,6 @@ int _gnutls_fips_perform_self_checks2(vo } /* MAC (includes message digest test) */ - ret = gnutls_mac_self_test(0, GNUTLS_MAC_SHA1); - if (ret < 0) { - return gnutls_assert_val(GNUTLS_E_SELF_TEST_ERROR); - } - ret = gnutls_mac_self_test(0, GNUTLS_MAC_SHA224); if (ret < 0) { return gnutls_assert_val(GNUTLS_E_SELF_TEST_ERROR);
