Give a better error if we can't find a sig alg
authorMatt Caswell <matt@openssl.org>
Fri, 27 Mar 2020 17:16:59 +0000 (17:16 +0000)
committerMatt Caswell <matt@openssl.org>
Mon, 30 Mar 2020 14:21:20 +0000 (15:21 +0100)
Some scenarios where we could not find a suitable sig alg just
gave "internal error" as the reason - which isn't very helpful. A
more suitable reason code already exists - so we use that.

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11425)

ssl/t1_lib.c

index 4ab046b7b3da0a0ad913b4eafb0844ebf4811d8e..624add64a8e96176fc7a26e59942212abf780a38 100644 (file)
@@ -2964,7 +2964,7 @@ int tls_choose_sigalg(SSL *s, int fatalerrs)
                     if (!fatalerrs)
                         return 1;
                     SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CHOOSE_SIGALG,
-                             ERR_R_INTERNAL_ERROR);
+                             SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM);
                     return 0;
                 }
 
@@ -2989,7 +2989,7 @@ int tls_choose_sigalg(SSL *s, int fatalerrs)
                 if (!fatalerrs)
                     return 1;
                 SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CHOOSE_SIGALG,
-                         ERR_R_INTERNAL_ERROR);
+                         SSL_R_NO_SUITABLE_SIGNATURE_ALGORITHM);
                 return 0;
             }
         }