gnutls/gnutls-FIPS-TLS_KDF_selftest.patch
Pedro Monreal Gonzalez ea12736003 Accepting request 1165440 from home:pmonrealgonzalez:branches:security:tls
- Update to 3.8.5:
  * libgnutls: Due to majority of usages and implementations of
    RSA decryption with PKCS#1 v1.5 padding being incorrect,
    leaving them vulnerable to Marvin attack, the RSAES-PKCS1-v1_5
    is being deprecated (encryption and decryption) and will be
    disabled in the future. A new option 'allow-rsa-pkcs1-encrypt'
    has been added into the system-wide library configuration which
    allows to enable/disable the RSAES-PKCS1-v1_5. Currently, the
    RSAES-PKCS1-v1_5 is enabled by default.
  * libgnutls: Added support for RIPEMD160 and PBES1-DES-SHA1 for
    backward compatibility with GCR.
  * libgnutls: A couple of memory related issues have been fixed in
    RSA PKCS#1 v1.5 decryption error handling and deterministic ECDSA
    with earlier versions of GMP. These were a regression introduced
    in the 3.8.4 release. See #1535 and !1827.
  * build: Fixed a bug where building gnutls statically failed due
    to a duplicate definition of nettle_rsa_compute_root_tr().
  * API and ABI modifications:
    - GNUTLS_PKCS_PBES1_DES_SHA1: New enum member of
      gnutls_pkcs_encrypt_flags_t
  * Rebase patches:
    - gnutls-FIPS-TLS_KDF_selftest.patch
    - gnutls-FIPS-140-3-references.patch

OBS-URL: https://build.opensuse.org/request/show/1165440
OBS-URL: https://build.opensuse.org/package/show/security:tls/gnutls?expand=0&rev=109
2024-04-05 10:43:46 +00:00

32 lines
1.2 KiB
Diff

Index: gnutls-3.8.5/lib/fips.c
===================================================================
--- gnutls-3.8.5.orig/lib/fips.c
+++ gnutls-3.8.5/lib/fips.c
@@ -593,6 +593,26 @@ int _gnutls_fips_perform_self_checks2(vo
return gnutls_assert_val(GNUTLS_E_SELF_TEST_ERROR);
}
+ /* KDF */
+
+ char derived[512];
+
+ gnutls_datum_t secret = { (void *)"\x04\x50\xb0\xea\x9e\xcd\x36\x02\xee\x0d\x76\xc5\xc3\xc8\x6f\x4a", 16 };
+ gnutls_datum_t seed = { (void *)"\x20\x7a\xcc\x02\x54\xb8\x67\xf5\xb9\x25\xb4\x5a\x33\x60\x1d\x8b", 16 };
+ gnutls_datum_t label = { (void *)"test label", 10 };
+ gnutls_datum_t expected = { (void *)"\xae\x67\x9e\x0e\x71\x4f\x59\x75\x76\x37\x68\xb1\x66\x97\x9e\x1d", 16 };
+
+ ret = _gnutls_prf_raw(GNUTLS_MAC_SHA256, secret.size, secret.data,
+ label.size, (char*)label.data, seed.size, seed.data, expected.size, derived);
+ if (ret < 0) {
+ return gnutls_assert_val(GNUTLS_E_SELF_TEST_ERROR);
+ }
+
+ ret = memcmp(derived, expected.data, expected.size);
+ if (ret != 0) {
+ return gnutls_assert_val(GNUTLS_E_SELF_TEST_ERROR);
+ }
+
/* PK */
if (_gnutls_config_is_rsa_pkcs1_encrypt_allowed()) {
ret = gnutls_pk_self_test(0, GNUTLS_PK_RSA);