bn: Drop unnecessary use of r9
[openssl.git] / ssl / ssl_rsa.c
index 7c64a994e89ca6aee75f3b90a864a89bc962fcbe..cf410d6d871ecfcff0b6e6cb9f3794910136c929 100644 (file)
@@ -239,12 +239,12 @@ static int ssl_set_cert(CERT *c, X509 *x)
         ERR_raise(ERR_LIB_SSL, SSL_R_UNKNOWN_CERTIFICATE_TYPE);
         return 0;
     }
-#ifndef OPENSSL_NO_EC
+
     if (i == SSL_PKEY_ECC && !EVP_PKEY_can_sign(pkey)) {
         ERR_raise(ERR_LIB_SSL, SSL_R_ECC_CERT_NOT_FOR_SIGNING);
         return 0;
     }
-#endif
+
     if (c->pkeys[i].privatekey != NULL) {
         /*
          * The return code from EVP_PKEY_copy_parameters is deliberately
@@ -424,6 +424,9 @@ static int use_certificate_chain_file(SSL_CTX *ctx, SSL *ssl, const char *file)
     void *passwd_callback_userdata;
     SSL_CTX *real_ctx = (ssl == NULL) ? ctx : ssl->ctx;
 
+    if (ctx == NULL && ssl == NULL)
+        return 0;
+
     ERR_clear_error();          /* clear error stack for
                                  * SSL_CTX_use_certificate() */