X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=ssl%2Fssl_rsa.c;h=90fe8c8af9baef4dcf502d9f66cb6867177f146f;hb=e5bf62f716f71e4df6995a07d1fbc4cad82a2637;hp=8799d3dd56c2a6803704923a85725b6b50d7a1ae;hpb=2c3823491d8812560922a58677e3ad2db4b2ec8d;p=oweals%2Fopenssl.git diff --git a/ssl/ssl_rsa.c b/ssl/ssl_rsa.c index 8799d3dd56..90fe8c8af9 100644 --- a/ssl/ssl_rsa.c +++ b/ssl/ssl_rsa.c @@ -121,8 +121,7 @@ int SSL_use_certificate_file(SSL *ssl, const char *file, int type) end: if (x != NULL) X509_free(x); - if (in != NULL) - BIO_free(in); + BIO_free(in); return (ret); } #endif @@ -262,8 +261,7 @@ int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type) ret = SSL_use_RSAPrivateKey(ssl, rsa); RSA_free(rsa); end: - if (in != NULL) - BIO_free(in); + BIO_free(in); return (ret); } # endif @@ -335,8 +333,7 @@ int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type) ret = SSL_use_PrivateKey(ssl, pkey); EVP_PKEY_free(pkey); end: - if (in != NULL) - BIO_free(in); + BIO_free(in); return (ret); } #endif @@ -470,8 +467,7 @@ int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type) end: if (x != NULL) X509_free(x); - if (in != NULL) - BIO_free(in); + BIO_free(in); return (ret); } #endif @@ -552,8 +548,7 @@ int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type) ret = SSL_CTX_use_RSAPrivateKey(ctx, rsa); RSA_free(rsa); end: - if (in != NULL) - BIO_free(in); + BIO_free(in); return (ret); } # endif @@ -622,8 +617,7 @@ int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type) ret = SSL_CTX_use_PrivateKey(ctx, pkey); EVP_PKEY_free(pkey); end: - if (in != NULL) - BIO_free(in); + BIO_free(in); return (ret); } #endif @@ -693,7 +687,10 @@ int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file) int r; unsigned long err; - SSL_CTX_clear_chain_certs(ctx); + if(!SSL_CTX_clear_chain_certs(ctx)) { + ret = 0; + goto end; + } while ((ca = PEM_read_bio_X509(in, NULL, ctx->default_passwd_callback, @@ -723,8 +720,7 @@ int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file) end: if (x != NULL) X509_free(x); - if (in != NULL) - BIO_free(in); + BIO_free(in); return (ret); } #endif @@ -988,8 +984,7 @@ int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file) OPENSSL_free(header); OPENSSL_free(extension); OPENSSL_free(serverinfo); - if (bin != NULL) - BIO_free(bin); + BIO_free(bin); return ret; } # endif /* OPENSSL_NO_STDIO */