linux-parisc update.
[openssl.git] / ssl / ssl_rsa.c
index 03828b66326262034b515d057469bcbcdfb198da..72511d248bd0173e47967bfdbe455529f596de3a 100644 (file)
@@ -131,7 +131,7 @@ end:
        }
 #endif
 
-int SSL_use_certificate_ASN1(SSL *ssl, unsigned char *d, int len)
+int SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len)
        {
        X509 *x;
        int ret;
@@ -207,7 +207,7 @@ static int ssl_set_pkey(CERT *c, EVP_PKEY *pkey)
                         ok=1;
                else
 #endif
-                       if (!X509_check_private_key(c->pkeys[i].x509,pkey))
+                    if (!X509_check_private_key(c->pkeys[i].x509,pkey))
                        {
                        if ((i == SSL_PKEY_DH_RSA) || (i == SSL_PKEY_DH_DSA))
                                {
@@ -241,6 +241,8 @@ static int ssl_set_pkey(CERT *c, EVP_PKEY *pkey)
                return(0);
                }
 
+       ERR_clear_error(); /* make sure no error from X509_check_private_key()
+                           * is left if we have chosen to ignore it */
        if (c->pkeys[i].privatekey != NULL)
                EVP_PKEY_free(c->pkeys[i].privatekey);
        CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY);
@@ -380,10 +382,10 @@ end:
        }
 #endif
 
-int SSL_use_PrivateKey_ASN1(int type, SSL *ssl, unsigned char *d, long len)
+int SSL_use_PrivateKey_ASN1(int type, SSL *ssl, const unsigned char *d, long len)
        {
        int ret;
-       unsigned char *p;
+       const unsigned char *p;
        EVP_PKEY *pkey;
 
        p=d;
@@ -543,7 +545,7 @@ end:
        }
 #endif
 
-int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, unsigned char *d)
+int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, const unsigned char *d)
        {
        X509 *x;
        int ret;
@@ -638,7 +640,7 @@ end:
        }
 #endif
 
-int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, unsigned char *d, long len)
+int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d, long len)
        {
        int ret;
        const unsigned char *p;
@@ -715,11 +717,11 @@ end:
        }
 #endif
 
-int SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx, unsigned char *d,
+int SSL_CTX_use_PrivateKey_ASN1(int type, SSL_CTX *ctx, const unsigned char *d,
             long len)
        {
        int ret;
-       unsigned char *p;
+       const unsigned char *p;
        EVP_PKEY *pkey;
 
        p=d;