Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package openssl-1_1 for openSUSE:Factory 
checked in at 2021-03-03 18:33:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/openssl-1_1 (Old)
 and      /work/SRC/openSUSE:Factory/.openssl-1_1.new.2378 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "openssl-1_1"

Wed Mar  3 18:33:24 2021 rev:21 rq:874306 version:1.1.1j

Changes:
--------
--- /work/SRC/openSUSE:Factory/openssl-1_1/openssl-1_1.changes  2020-12-16 
10:58:45.895468366 +0100
+++ /work/SRC/openSUSE:Factory/.openssl-1_1.new.2378/openssl-1_1.changes        
2021-03-03 18:33:52.775334321 +0100
@@ -1,0 +2,79 @@
+Fri Feb 19 08:01:01 UTC 2021 - Pedro Monreal <[email protected]>
+
+- Update to 1.1.1j
+  * Fixed the X509_issuer_and_serial_hash() function. It attempts
+    to create a unique hash value based on the issuer and serial
+    number data contained within an X509 certificate. However it
+    was failing to correctly handle any errors that may occur
+    while parsing the issuer field [bsc#1182331, CVE-2021-23841]
+  * Fixed the RSA_padding_check_SSLv23() function and the
+    RSA_SSLV23_PADDING padding mode to correctly check for
+    rollback attacks.
+  * Fixed the EVP_CipherUpdate, EVP_EncryptUpdate and
+    EVP_DecryptUpdate functions. Previously they could overflow the
+    output length argument in some cases where the input length is
+    close to the maximum permissable length for an integer on the
+    platform. In such cases the return value from the function call
+    would be 1 (indicating success), but the output length value
+    would be negative. This could cause applications to behave
+    incorrectly or crash. [bsc#1182333, CVE-2021-23840]
+  * Fixed SRP_Calc_client_key so that it runs in constant time.
+    The previous implementation called BN_mod_exp without setting
+    BN_FLG_CONSTTIME. This could be exploited in a side channel
+    attack to recover the password. Since the attack is local host
+    only this is outside of the current OpenSSL threat model and
+    therefore no CVE is assigned.
+- Rebase patches:
+  * openssl-1.1.1-fips.patch
+  * openssl-1.1.0-issuer-hash.patch
+  * openssl-1.1.1-evp-kdf.patch
+
+-------------------------------------------------------------------
+Sat Feb  6 14:44:12 UTC 2021 - Jason Sikes <[email protected]>
+
+- Removed patch because it was causing problems with other servers.
+  * openssl-zero-pad-DHE-public-key.patch
+  * bsc#1181796
+
+-------------------------------------------------------------------
+Thu Feb  4 18:23:17 UTC 2021 - Jason Sikes <[email protected]>
+
+- Zero pad the DHE public key in ClientKeyExchange for interoperability with
+  Windows Server 2019.
+  * openssl-zero-pad-DHE-public-key.patch
+  * bsc#1181796
+  * sourced from https://github.com/openssl/openssl/pull/12331/files
+
+-------------------------------------------------------------------
+Fri Jan 22 09:05:41 UTC 2021 - Pedro Monreal <[email protected]>
+
+- Add version guards for the crypto-policies
+
+-------------------------------------------------------------------
+Wed Jan 20 15:59:01 UTC 2021 - Pedro Monreal <[email protected]>
+
+- Disable test_srp subsection from 90-test_sslapi.t test
+- Use SECLEVEL 2 in 80-test_ssl_new.t
+- Add patches:
+  * openssl-1_1-use-seclevel2-in-tests.patch
+  * openssl-1_1-disable-test_srp-sslapi.patch
+
+-------------------------------------------------------------------
+Fri Jan  8 17:49:33 UTC 2021 - Pedro Monreal <[email protected]>
+
+- Allow SHA1 in SECLEVEL 2 in non-FIPS mode
+- Add openssl-1_1-seclevel.patch
+
+-------------------------------------------------------------------
+Thu Dec 17 17:16:08 UTC 2020 - Pedro Monreal <[email protected]> 
+
+- Require the crypto-policies package [bsc#1180051]
+
+-------------------------------------------------------------------
+Tue Dec  8 15:43:32 UTC 2020 - V??t??zslav ??????ek <[email protected]>
+
+- Update to 1.1.1i (bsc#1179491)
+  * Fixed NULL pointer deref in GENERAL_NAME_cmp (CVE-2020-1971)
+- Refresh openssl-1.1.1-fips-post-rand.patch
+
+-------------------------------------------------------------------

Old:
----
  openssl-1.1.1h.tar.gz
  openssl-1.1.1h.tar.gz.asc

New:
----
  openssl-1.1.1j.tar.gz
  openssl-1.1.1j.tar.gz.asc
  openssl-1_1-disable-test_srp-sslapi.patch
  openssl-1_1-seclevel.patch
  openssl-1_1-use-seclevel2-in-tests.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ openssl-1_1.spec ++++++
--- /var/tmp/diff_new_pack.WXRf9W/_old  2021-03-03 18:33:53.783335053 +0100
+++ /var/tmp/diff_new_pack.WXRf9W/_new  2021-03-03 18:33:53.787335055 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package openssl-1_1
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2021 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -21,7 +21,7 @@
 %define _rname  openssl
 Name:           openssl-1_1
 # Don't forget to update the version in the "openssl" package!
-Version:        1.1.1h
+Version:        1.1.1j
 Release:        0
 Summary:        Secure Sockets and Transport Layer Security
 License:        OpenSSL
@@ -87,7 +87,14 @@
 Patch50:        
openssl-s390x-assembly-pack-accelerate-X25519-X448-Ed25519-and-Ed448.patch
 Patch51:        
openssl-s390x-fix-x448-and-x448-test-vector-ctime-for-x25519-and-x448.patch
 Patch52:        openssl-1.1.1-system-cipherlist.patch
+# PATCH-FIX-OPENSUSE jsc#SLE-15832 Centralized Crypto Compliance Configuration
+Patch53:        openssl-1_1-seclevel.patch
+Patch54:        openssl-1_1-use-seclevel2-in-tests.patch
+Patch55:        openssl-1_1-disable-test_srp-sslapi.patch
 BuildRequires:  pkgconfig
+%if 0%{?suse_version} && ! 0%{?sle_version}
+Requires:       crypto-policies
+%endif
 Conflicts:      ssl
 Provides:       ssl
 Provides:       openssl(cli)
@@ -211,8 +218,10 @@
 %check
 export MALLOC_CHECK_=3
 export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
+#export HARNESS_VERBOSE=1
 LD_LIBRARY_PATH=`pwd` make test -j1
-# show cyphers
+
+# show ciphers
 gcc -o showciphers %{optflags} -I%{buildroot}%{_includedir} %{SOURCE5} 
-L%{buildroot}%{_libdir} -lssl -lcrypto
 LD_LIBRARY_PATH=%{buildroot}%{_libdir} ./showciphers
 

++++++ openssl-1.1.0-issuer-hash.patch ++++++
--- /var/tmp/diff_new_pack.WXRf9W/_old  2021-03-03 18:33:53.879335122 +0100
+++ /var/tmp/diff_new_pack.WXRf9W/_new  2021-03-03 18:33:53.879335122 +0100
@@ -1,12 +1,12 @@
-Index: openssl-1.1.1d/crypto/x509/x509_cmp.c
+Index: openssl-1.1.1j/crypto/x509/x509_cmp.c
 ===================================================================
---- openssl-1.1.1d.orig/crypto/x509/x509_cmp.c 2019-09-10 15:13:07.000000000 
+0200
-+++ openssl-1.1.1d/crypto/x509/x509_cmp.c      2020-01-23 13:45:11.404634047 
+0100
+--- openssl-1.1.1j.orig/crypto/x509/x509_cmp.c
++++ openssl-1.1.1j/crypto/x509/x509_cmp.c
 @@ -38,6 +38,7 @@ unsigned long X509_issuer_and_serial_has
  
      if (ctx == NULL)
          goto err;
 +    EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
      f = X509_NAME_oneline(a->cert_info.issuer, NULL, 0);
-     if (!EVP_DigestInit_ex(ctx, EVP_md5(), NULL))
+     if (f == NULL)
          goto err;

++++++ openssl-1.1.1-evp-kdf.patch ++++++
++++ 610 lines (skipped)
++++ between /work/SRC/openSUSE:Factory/openssl-1_1/openssl-1.1.1-evp-kdf.patch
++++ and 
/work/SRC/openSUSE:Factory/.openssl-1_1.new.2378/openssl-1.1.1-evp-kdf.patch

++++++ openssl-1.1.1-fips-post-rand.patch ++++++
--- /var/tmp/diff_new_pack.WXRf9W/_old  2021-03-03 18:33:53.915335149 +0100
+++ /var/tmp/diff_new_pack.WXRf9W/_new  2021-03-03 18:33:53.915335149 +0100
@@ -1,7 +1,7 @@
-Index: openssl-1.1.1e/crypto/fips/fips.c
+Index: openssl-1.1.1i/crypto/fips/fips.c
 ===================================================================
---- openssl-1.1.1e.orig/crypto/fips/fips.c     2020-03-20 14:08:12.235758574 
+0100
-+++ openssl-1.1.1e/crypto/fips/fips.c  2020-03-20 14:08:13.787766679 +0100
+--- openssl-1.1.1i.orig/crypto/fips/fips.c     2020-12-08 16:46:23.666760618 
+0100
++++ openssl-1.1.1i/crypto/fips/fips.c  2020-12-08 16:46:25.626772700 +0100
 @@ -68,6 +68,7 @@
  
  # include <openssl/fips.h>
@@ -52,10 +52,10 @@
          ret = 1;
          goto end;
      }
-Index: openssl-1.1.1e/include/crypto/fips_int.h
+Index: openssl-1.1.1i/include/crypto/fips_int.h
 ===================================================================
---- openssl-1.1.1e.orig/include/crypto/fips_int.h      2020-03-20 
14:08:12.239758595 +0100
-+++ openssl-1.1.1e/include/crypto/fips_int.h   2020-03-20 14:08:13.787766679 
+0100
+--- openssl-1.1.1i.orig/include/crypto/fips_int.h      2020-12-08 
16:46:23.666760618 +0100
++++ openssl-1.1.1i/include/crypto/fips_int.h   2020-12-08 16:46:25.626772700 
+0100
 @@ -77,6 +77,8 @@ int FIPS_selftest_hmac(void);
  int FIPS_selftest_drbg(void);
  int FIPS_selftest_cmac(void);
@@ -65,10 +65,10 @@
  int fips_pkey_signature_test(EVP_PKEY *pkey,
                                   const unsigned char *tbs, int tbslen,
                                   const unsigned char *kat,
-Index: openssl-1.1.1e/include/crypto/rand.h
+Index: openssl-1.1.1i/include/crypto/rand.h
 ===================================================================
---- openssl-1.1.1e.orig/include/crypto/rand.h  2020-03-20 14:08:12.239758595 
+0100
-+++ openssl-1.1.1e/include/crypto/rand.h       2020-03-20 14:08:13.791766699 
+0100
+--- openssl-1.1.1i.orig/include/crypto/rand.h  2020-12-08 16:46:23.670760642 
+0100
++++ openssl-1.1.1i/include/crypto/rand.h       2020-12-08 16:46:25.626772700 
+0100
 @@ -24,6 +24,7 @@
  typedef struct rand_pool_st RAND_POOL;
  
@@ -77,11 +77,11 @@
  void rand_drbg_cleanup_int(void);
  void drbg_delete_thread_state(void);
  
-Index: openssl-1.1.1e/crypto/rand/drbg_lib.c
+Index: openssl-1.1.1i/crypto/rand/drbg_lib.c
 ===================================================================
---- openssl-1.1.1e.orig/crypto/rand/drbg_lib.c 2020-03-20 14:08:12.239758595 
+0100
-+++ openssl-1.1.1e/crypto/rand/drbg_lib.c      2020-03-20 14:08:13.791766699 
+0100
-@@ -1009,6 +1009,20 @@ size_t rand_drbg_seedlen(RAND_DRBG *drbg
+--- openssl-1.1.1i.orig/crypto/rand/drbg_lib.c 2020-12-08 16:46:23.670760642 
+0100
++++ openssl-1.1.1i/crypto/rand/drbg_lib.c      2020-12-08 16:46:25.626772700 
+0100
+@@ -1005,6 +1005,20 @@ size_t rand_drbg_seedlen(RAND_DRBG *drbg
      return min_entropy > min_entropylen ? min_entropy : min_entropylen;
  }
  
@@ -102,10 +102,10 @@
  /* Implements the default OpenSSL RAND_add() method */
  static int drbg_add(const void *buf, int num, double randomness)
  {
-Index: openssl-1.1.1e/crypto/rand/rand_unix.c
+Index: openssl-1.1.1i/crypto/rand/rand_unix.c
 ===================================================================
---- openssl-1.1.1e.orig/crypto/rand/rand_unix.c        2020-03-20 
14:08:12.239758595 +0100
-+++ openssl-1.1.1e/crypto/rand/rand_unix.c     2020-03-20 14:08:41.763912735 
+0100
+--- openssl-1.1.1i.orig/crypto/rand/rand_unix.c        2020-12-08 
16:46:23.670760642 +0100
++++ openssl-1.1.1i/crypto/rand/rand_unix.c     2020-12-08 16:47:33.695192297 
+0100
 @@ -17,10 +17,12 @@
  #include <openssl/crypto.h>
  #include "rand_local.h"
@@ -119,7 +119,7 @@
  # ifdef DEVRANDOM_WAIT
  #  include <sys/shm.h>
  #  include <sys/utsname.h>
-@@ -342,7 +344,7 @@ static ssize_t sysctl_random(char *buf,
+@@ -344,7 +346,7 @@ static ssize_t sysctl_random(char *buf,
   * syscall_random(): Try to get random data using a system call
   * returns the number of bytes returned in buf, or < 0 on error.
   */
@@ -128,15 +128,15 @@
  {
      /*
       * Note: 'buflen' equals the size of the buffer which is used by the
-@@ -364,6 +366,7 @@ static ssize_t syscall_random(void *buf,
-      * - Linux since 3.17 with glibc 2.25
-      * - FreeBSD since 12.0 (1200061)
+@@ -369,6 +371,7 @@ static ssize_t syscall_random(void *buf,
+      * Note: Sometimes getentropy() can be provided but not implemented
+      * internally. So we need to check errno for ENOSYS
       */
 +#  if 0
  #  if defined(__GNUC__) && __GNUC__>=2 && defined(__ELF__) && !defined(__hpux)
      extern int getentropy(void *buffer, size_t length) __attribute__((weak));
  
-@@ -385,10 +388,10 @@ static ssize_t syscall_random(void *buf,
+@@ -394,10 +397,10 @@ static ssize_t syscall_random(void *buf,
      if (p_getentropy.p != NULL)
          return p_getentropy.f(buf, buflen) == 0 ? (ssize_t)buflen : -1;
  #  endif
@@ -150,7 +150,7 @@
  #  elif (defined(__FreeBSD__) || defined(__NetBSD__)) && defined(KERN_ARND)
      return sysctl_random(buf, buflen);
  #  else
-@@ -623,6 +626,9 @@ size_t rand_pool_acquire_entropy(RAND_PO
+@@ -633,6 +636,9 @@ size_t rand_pool_acquire_entropy(RAND_PO
      size_t entropy_available;
  
  #   if defined(OPENSSL_RAND_SEED_GETRANDOM)
@@ -160,7 +160,7 @@
      {
          size_t bytes_needed;
          unsigned char *buffer;
-@@ -633,7 +639,7 @@ size_t rand_pool_acquire_entropy(RAND_PO
+@@ -643,7 +649,7 @@ size_t rand_pool_acquire_entropy(RAND_PO
          bytes_needed = rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
          while (bytes_needed != 0 && attempts-- > 0) {
              buffer = rand_pool_add_begin(pool, bytes_needed);
@@ -169,7 +169,7 @@
              if (bytes > 0) {
                  rand_pool_add_end(pool, bytes, 8 * bytes);
                  bytes_needed -= bytes;
-@@ -668,8 +674,10 @@ size_t rand_pool_acquire_entropy(RAND_PO
+@@ -678,8 +684,10 @@ size_t rand_pool_acquire_entropy(RAND_PO
              int attempts = 3;
              const int fd = get_random_device(i);
  
@@ -181,7 +181,7 @@
  
              while (bytes_needed != 0 && attempts-- > 0) {
                  buffer = rand_pool_add_begin(pool, bytes_needed);
-@@ -732,7 +740,9 @@ size_t rand_pool_acquire_entropy(RAND_PO
+@@ -742,7 +750,9 @@ size_t rand_pool_acquire_entropy(RAND_PO
              return entropy_available;
      }
  #   endif

++++++ openssl-1.1.1-fips.patch ++++++
++++ 1463 lines (skipped)
++++ between /work/SRC/openSUSE:Factory/openssl-1_1/openssl-1.1.1-fips.patch
++++ and 
/work/SRC/openSUSE:Factory/.openssl-1_1.new.2378/openssl-1.1.1-fips.patch

++++++ openssl-1_1-disable-test_srp-sslapi.patch ++++++
Index: openssl-1.1.1i/test/sslapitest.c
===================================================================
--- openssl-1.1.1i.orig/test/sslapitest.c
+++ openssl-1.1.1i/test/sslapitest.c
@@ -6766,7 +6766,7 @@ int setup_tests(void)
 #endif
     ADD_ALL_TESTS(test_ssl_clear, 2);
     ADD_ALL_TESTS(test_max_fragment_len_ext, 
OSSL_NELEM(max_fragment_len_test));
-#if !defined(OPENSSL_NO_SRP) && !defined(OPENSSL_NO_TLS1_2)
+#if !defined(OPENSSL_NO_SRP) && !defined(OPENSSL_NO_TLS1_2) && 0
     ADD_ALL_TESTS(test_srp, 6);
 #endif
     ADD_ALL_TESTS(test_info_callback, 6);
++++++ openssl-1_1-seclevel.patch ++++++
diff -up openssl-1.1.1g/crypto/x509/x509_vfy.c.seclevel 
openssl-1.1.1g/crypto/x509/x509_vfy.c
--- openssl-1.1.1g/crypto/x509/x509_vfy.c.seclevel      2020-04-21 
14:22:39.000000000 +0200
+++ openssl-1.1.1g/crypto/x509/x509_vfy.c       2020-06-05 17:16:54.835536823 
+0200
@@ -3225,6 +3225,7 @@ static int build_chain(X509_STORE_CTX *c
 }
 
 static const int minbits_table[] = { 80, 112, 128, 192, 256 };
+static const int minbits_digest_table[] = { 80, 80, 128, 192, 256 };
 static const int NUM_AUTH_LEVELS = OSSL_NELEM(minbits_table);
 
 /*
@@ -3276,6 +3277,11 @@ static int check_sig_level(X509_STORE_CT
 
     if (!X509_get_signature_info(cert, NULL, NULL, &secbits, NULL))
         return 0;
-
-    return secbits >= minbits_table[level - 1];
+    /*
+     * Allow SHA1 in SECLEVEL 2 in non-FIPS mode or when the magic
+     * disable SHA1 flag is not set.
+     */
+    if ((ctx->param->flags & 0x40000000) || FIPS_mode())
+        return secbits >= minbits_table[level - 1];
+    return secbits >= minbits_digest_table[level - 1];
 }
diff -up openssl-1.1.1g/doc/man3/SSL_CTX_set_security_level.pod.seclevel 
openssl-1.1.1g/doc/man3/SSL_CTX_set_security_level.pod
--- openssl-1.1.1g/doc/man3/SSL_CTX_set_security_level.pod.seclevel     
2020-04-21 14:22:39.000000000 +0200
+++ openssl-1.1.1g/doc/man3/SSL_CTX_set_security_level.pod      2020-06-04 
15:48:01.608178833 +0200
@@ -81,8 +81,10 @@ using MD5 for the MAC is also prohibited
 
 =item B<Level 2>
 
-Security level set to 112 bits of security. As a result RSA, DSA and DH keys
-shorter than 2048 bits and ECC keys shorter than 224 bits are prohibited.
+Security level set to 112 bits of security with the exception of SHA1 allowed
+for signatures.
+As a result RSA, DSA and DH keys shorter than 2048 bits and ECC keys
+shorter than 224 bits are prohibited.
 In addition to the level 1 exclusions any cipher suite using RC4 is also
 prohibited. SSL version 3 is also not allowed. Compression is disabled.
 
diff -up openssl-1.1.1g/ssl/ssl_cert.c.seclevel openssl-1.1.1g/ssl/ssl_cert.c
--- openssl-1.1.1g/ssl/ssl_cert.c.seclevel      2020-04-21 14:22:39.000000000 
+0200
+++ openssl-1.1.1g/ssl/ssl_cert.c       2020-06-05 17:10:11.842198401 +0200
@@ -27,6 +27,7 @@
 static int ssl_security_default_callback(const SSL *s, const SSL_CTX *ctx,
                                          int op, int bits, int nid, void 
*other,
                                          void *ex);
+static unsigned long sha1_disable(const SSL *s, const SSL_CTX *ctx);
 
 static CRYPTO_ONCE ssl_x509_store_ctx_once = CRYPTO_ONCE_STATIC_INIT;
 static volatile int ssl_x509_store_ctx_idx = -1;
@@ -396,7 +397,7 @@ int ssl_verify_cert_chain(SSL *s, STACK_
     X509_VERIFY_PARAM_set_auth_level(param, SSL_get_security_level(s));
 
     /* Set suite B flags if needed */
-    X509_STORE_CTX_set_flags(ctx, tls1_suiteb(s));
+    X509_STORE_CTX_set_flags(ctx, tls1_suiteb(s) | sha1_disable(s, NULL));
     if (!X509_STORE_CTX_set_ex_data
         (ctx, SSL_get_ex_data_X509_STORE_CTX_idx(), s)) {
         goto end;
@@ -953,12 +954,33 @@ static int ssl_security_default_callback
             return 0;
         break;
     default:
+        /* allow SHA1 in SECLEVEL 2 in non FIPS mode */
+        if (nid == NID_sha1 && minbits == 112 && !sha1_disable(s, ctx))
+            break;
         if (bits < minbits)
             return 0;
     }
     return 1;
 }
 
+static unsigned long sha1_disable(const SSL *s, const SSL_CTX *ctx)
+{
+    unsigned long ret = 0x40000000; /* a magical internal value used by 
X509_VERIFY_PARAM */
+    const CERT *c;
+
+    if (FIPS_mode())
+        return ret;
+
+    if (ctx != NULL) {
+       c = ctx->cert;
+    } else {
+       c = s->cert;
+    }
+    if (tls1_cert_sigalgs_have_sha1(c))
+        return 0;
+    return ret;
+}
+
 int ssl_security(const SSL *s, int op, int bits, int nid, void *other)
 {
     return s->cert->sec_cb(s, NULL, op, bits, nid, other, s->cert->sec_ex);
diff -up openssl-1.1.1g/ssl/ssl_local.h.seclevel openssl-1.1.1g/ssl/ssl_local.h
--- openssl-1.1.1g/ssl/ssl_local.h.seclevel     2020-06-04 15:48:01.602178783 
+0200
+++ openssl-1.1.1g/ssl/ssl_local.h      2020-06-05 17:02:22.666313410 +0200
@@ -2576,6 +2576,7 @@ __owur int tls1_save_sigalgs(SSL *s, PAC
 __owur int tls1_process_sigalgs(SSL *s);
 __owur int tls1_set_peer_legacy_sigalg(SSL *s, const EVP_PKEY *pkey);
 __owur int tls1_lookup_md(const SIGALG_LOOKUP *lu, const EVP_MD **pmd);
+int tls1_cert_sigalgs_have_sha1(const CERT *c);
 __owur size_t tls12_get_psigalgs(SSL *s, int sent, const uint16_t **psigs);
 #  ifndef OPENSSL_NO_EC
 __owur int tls_check_sigalg_curve(const SSL *s, int curve);
diff -up openssl-1.1.1g/ssl/t1_lib.c.seclevel openssl-1.1.1g/ssl/t1_lib.c
--- openssl-1.1.1g/ssl/t1_lib.c.seclevel        2020-06-04 15:48:01.654179221 
+0200
+++ openssl-1.1.1g/ssl/t1_lib.c 2020-06-05 17:02:40.268459157 +0200
@@ -2145,6 +2145,36 @@ int tls1_set_sigalgs(CERT *c, const int
     return 0;
 }
 
+static int tls1_sigalgs_have_sha1(const uint16_t *sigalgs, size_t sigalgslen)
+{
+    size_t i;
+
+    for (i = 0; i < sigalgslen; i++, sigalgs++) {
+        const SIGALG_LOOKUP *lu = tls1_lookup_sigalg(*sigalgs);
+
+        if (lu == NULL)
+            continue;
+        if (lu->hash == NID_sha1)
+            return 1;
+    }
+    return 0;
+}
+
+
+int tls1_cert_sigalgs_have_sha1(const CERT *c)
+{
+    if (c->client_sigalgs != NULL) {
+        if (tls1_sigalgs_have_sha1(c->client_sigalgs, c->client_sigalgslen))
+            return 1;
+    }
+    if (c->conf_sigalgs != NULL) {
+        if (tls1_sigalgs_have_sha1(c->conf_sigalgs, c->conf_sigalgslen))
+            return 1;
+        return 0;
+    }
+    return 1;
+}
+
 static int tls1_check_sig_alg(SSL *s, X509 *x, int default_nid)
 {
     int sig_nid, use_pc_sigalgs = 0;
diff -up openssl-1.1.1g/test/recipes/25-test_verify.t.seclevel 
openssl-1.1.1g/test/recipes/25-test_verify.t
--- openssl-1.1.1g/test/recipes/25-test_verify.t.seclevel       2020-04-21 
14:22:39.000000000 +0200
+++ openssl-1.1.1g/test/recipes/25-test_verify.t        2020-06-04 
15:48:01.608178833 +0200
@@ -346,8 +346,8 @@ ok(verify("ee-pss-sha1-cert", "sslserver
 ok(verify("ee-pss-sha256-cert", "sslserver", ["root-cert"], ["ca-cert"], ),
     "CA with PSS signature using SHA256");
 
-ok(!verify("ee-pss-sha1-cert", "sslserver", ["root-cert"], ["ca-cert"], 
"-auth_level", "2"),
-    "Reject PSS signature using SHA1 and auth level 2");
+ok(!verify("ee-pss-sha1-cert", "sslserver", ["root-cert"], ["ca-cert"], 
"-auth_level", "3"),
+    "Reject PSS signature using SHA1 and auth level 3");
 
 ok(verify("ee-pss-sha256-cert", "sslserver", ["root-cert"], ["ca-cert"], 
"-auth_level", "2"),
     "PSS signature using SHA256 and auth level 2");
++++++ openssl-1_1-use-seclevel2-in-tests.patch ++++++
Index: openssl-1.1.1d/test/ssl_test.c
===================================================================
--- openssl-1.1.1d.orig/test/ssl_test.c
+++ openssl-1.1.1d/test/ssl_test.c
@@ -435,6 +440,7 @@ static int test_handshake(int idx)
 #endif
     if (test_ctx->method == SSL_TEST_METHOD_TLS) {
         server_ctx = SSL_CTX_new(TLS_server_method());
+        SSL_CTX_set_security_level(server_ctx, 1);
         if (!TEST_true(SSL_CTX_set_max_proto_version(server_ctx,
                                                      TLS_MAX_VERSION)))
             goto err;
@@ -443,21 +449,25 @@ static int test_handshake(int idx)
             SSL_TEST_SERVERNAME_CB_NONE) {
             if (!TEST_ptr(server2_ctx = SSL_CTX_new(TLS_server_method())))
                 goto err;
+            SSL_CTX_set_security_level(server2_ctx, 1);
             if (!TEST_true(SSL_CTX_set_max_proto_version(server2_ctx,
                                                          TLS_MAX_VERSION)))
                 goto err;
         }
         client_ctx = SSL_CTX_new(TLS_client_method());
+        SSL_CTX_set_security_level(client_ctx, 1);
         if (!TEST_true(SSL_CTX_set_max_proto_version(client_ctx,
                                                      TLS_MAX_VERSION)))
             goto err;
 
         if (test_ctx->handshake_mode == SSL_TEST_HANDSHAKE_RESUME) {
             resume_server_ctx = SSL_CTX_new(TLS_server_method());
+            SSL_CTX_set_security_level(resume_server_ctx, 1);
             if (!TEST_true(SSL_CTX_set_max_proto_version(resume_server_ctx,
                                                      TLS_MAX_VERSION)))
                 goto err;
             resume_client_ctx = SSL_CTX_new(TLS_client_method());
+            SSL_CTX_set_security_level(resume_client_ctx, 1);
             if (!TEST_true(SSL_CTX_set_max_proto_version(resume_client_ctx,
                                                          TLS_MAX_VERSION)))
                 goto err;

Reply via email to