use ERR_peek_last_error() instead of ERR_peek_error()
[openssl.git] / ssl / ssl_rsa.c
index e6d7f386b4d57dfb6cc92ba5037c8a00371c6eb8..1cf8e20934b04dc4e0ec994d696a30aef3141a1e 100644 (file)
@@ -170,7 +170,7 @@ int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa)
                return(0);
                }
 
-       RSA_up(rsa);
+       RSA_up_ref(rsa);
        EVP_PKEY_assign_RSA(pkey,rsa);
 
        ret=ssl_set_pkey(ssl->cert,pkey);
@@ -582,7 +582,7 @@ int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa)
                return(0);
                }
 
-       RSA_up(rsa);
+       RSA_up_ref(rsa);
        EVP_PKEY_assign_RSA(pkey,rsa);
 
        ret=ssl_set_pkey(ctx->cert, pkey);
@@ -800,9 +800,9 @@ int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file)
                         * by SSL_CTX_use_certificate). */
                        }
                /* When the while loop ends, it's usually just EOF. */
-               err = ERR_peek_error();
+               err = ERR_peek_last_error();
                if (ERR_GET_LIB(err) == ERR_LIB_PEM && ERR_GET_REASON(err) == PEM_R_NO_START_LINE)
-                       (void) ERR_get_error();
+                       (void)ERR_get_error();
                else 
                        ret = 0; /* some real error */
                }