projects
/
oweals
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Define SEQ_NUM_SIZE
[oweals/openssl.git]
/
ssl
/
ssl_rsa.c
diff --git
a/ssl/ssl_rsa.c
b/ssl/ssl_rsa.c
index 723da6e430573aa7312725976659ff3ccd1ddd00..90fe8c8af9baef4dcf502d9f66cb6867177f146f 100644
(file)
--- a/
ssl/ssl_rsa.c
+++ b/
ssl/ssl_rsa.c
@@
-79,10
+79,6
@@
int SSL_use_certificate(SSL *ssl, X509 *x)
return 0;
}
return 0;
}
- if (!ssl_cert_inst(&ssl->cert)) {
- SSLerr(SSL_F_SSL_USE_CERTIFICATE, ERR_R_MALLOC_FAILURE);
- return (0);
- }
return (ssl_set_cert(ssl->cert, x));
}
return (ssl_set_cert(ssl->cert, x));
}
@@
-125,8
+121,7
@@
int SSL_use_certificate_file(SSL *ssl, const char *file, int type)
end:
if (x != NULL)
X509_free(x);
end:
if (x != NULL)
X509_free(x);
- if (in != NULL)
- BIO_free(in);
+ BIO_free(in);
return (ret);
}
#endif
return (ret);
}
#endif
@@
-157,10
+152,6
@@
int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa)
SSLerr(SSL_F_SSL_USE_RSAPRIVATEKEY, ERR_R_PASSED_NULL_PARAMETER);
return (0);
}
SSLerr(SSL_F_SSL_USE_RSAPRIVATEKEY, ERR_R_PASSED_NULL_PARAMETER);
return (0);
}
- if (!ssl_cert_inst(&ssl->cert)) {
- SSLerr(SSL_F_SSL_USE_RSAPRIVATEKEY, ERR_R_MALLOC_FAILURE);
- return (0);
- }
if ((pkey = EVP_PKEY_new()) == NULL) {
SSLerr(SSL_F_SSL_USE_RSAPRIVATEKEY, ERR_R_EVP_LIB);
return (0);
if ((pkey = EVP_PKEY_new()) == NULL) {
SSLerr(SSL_F_SSL_USE_RSAPRIVATEKEY, ERR_R_EVP_LIB);
return (0);
@@
-270,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:
ret = SSL_use_RSAPrivateKey(ssl, rsa);
RSA_free(rsa);
end:
- if (in != NULL)
- BIO_free(in);
+ BIO_free(in);
return (ret);
}
# endif
return (ret);
}
# endif
@@
-302,10
+292,6
@@
int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey)
SSLerr(SSL_F_SSL_USE_PRIVATEKEY, ERR_R_PASSED_NULL_PARAMETER);
return (0);
}
SSLerr(SSL_F_SSL_USE_PRIVATEKEY, ERR_R_PASSED_NULL_PARAMETER);
return (0);
}
- if (!ssl_cert_inst(&ssl->cert)) {
- SSLerr(SSL_F_SSL_USE_PRIVATEKEY, ERR_R_MALLOC_FAILURE);
- return (0);
- }
ret = ssl_set_pkey(ssl->cert, pkey);
return (ret);
}
ret = ssl_set_pkey(ssl->cert, pkey);
return (ret);
}
@@
-347,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:
ret = SSL_use_PrivateKey(ssl, pkey);
EVP_PKEY_free(pkey);
end:
- if (in != NULL)
- BIO_free(in);
+ BIO_free(in);
return (ret);
}
#endif
return (ret);
}
#endif
@@
-383,10
+368,6
@@
int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x)
SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE, rv);
return 0;
}
SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE, rv);
return 0;
}
- if (!ssl_cert_inst(&ctx->cert)) {
- SSLerr(SSL_F_SSL_CTX_USE_CERTIFICATE, ERR_R_MALLOC_FAILURE);
- return (0);
- }
return (ssl_set_cert(ctx->cert, x));
}
return (ssl_set_cert(ctx->cert, x));
}
@@
-486,8
+467,7
@@
int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type)
end:
if (x != NULL)
X509_free(x);
end:
if (x != NULL)
X509_free(x);
- if (in != NULL)
- BIO_free(in);
+ BIO_free(in);
return (ret);
}
#endif
return (ret);
}
#endif
@@
-519,10
+499,6
@@
int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa)
SSLerr(SSL_F_SSL_CTX_USE_RSAPRIVATEKEY, ERR_R_PASSED_NULL_PARAMETER);
return (0);
}
SSLerr(SSL_F_SSL_CTX_USE_RSAPRIVATEKEY, ERR_R_PASSED_NULL_PARAMETER);
return (0);
}
- if (!ssl_cert_inst(&ctx->cert)) {
- SSLerr(SSL_F_SSL_CTX_USE_RSAPRIVATEKEY, ERR_R_MALLOC_FAILURE);
- return (0);
- }
if ((pkey = EVP_PKEY_new()) == NULL) {
SSLerr(SSL_F_SSL_CTX_USE_RSAPRIVATEKEY, ERR_R_EVP_LIB);
return (0);
if ((pkey = EVP_PKEY_new()) == NULL) {
SSLerr(SSL_F_SSL_CTX_USE_RSAPRIVATEKEY, ERR_R_EVP_LIB);
return (0);
@@
-572,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:
ret = SSL_CTX_use_RSAPrivateKey(ctx, rsa);
RSA_free(rsa);
end:
- if (in != NULL)
- BIO_free(in);
+ BIO_free(in);
return (ret);
}
# endif
return (ret);
}
# endif
@@
-603,10
+578,6
@@
int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey)
SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY, ERR_R_PASSED_NULL_PARAMETER);
return (0);
}
SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY, ERR_R_PASSED_NULL_PARAMETER);
return (0);
}
- if (!ssl_cert_inst(&ctx->cert)) {
- SSLerr(SSL_F_SSL_CTX_USE_PRIVATEKEY, ERR_R_MALLOC_FAILURE);
- return (0);
- }
return (ssl_set_pkey(ctx->cert, pkey));
}
return (ssl_set_pkey(ctx->cert, pkey));
}
@@
-646,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:
ret = SSL_CTX_use_PrivateKey(ctx, pkey);
EVP_PKEY_free(pkey);
end:
- if (in != NULL)
- BIO_free(in);
+ BIO_free(in);
return (ret);
}
#endif
return (ret);
}
#endif
@@
-717,7
+687,10
@@
int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file)
int r;
unsigned long err;
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,
while ((ca = PEM_read_bio_X509(in, NULL,
ctx->default_passwd_callback,
@@
-747,8
+720,7
@@
int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file)
end:
if (x != NULL)
X509_free(x);
end:
if (x != NULL)
X509_free(x);
- if (in != NULL)
- BIO_free(in);
+ BIO_free(in);
return (ret);
}
#endif
return (ret);
}
#endif
@@
-900,10
+872,6
@@
int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo,
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO, SSL_R_INVALID_SERVERINFO_DATA);
return 0;
}
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO, SSL_R_INVALID_SERVERINFO_DATA);
return 0;
}
- if (!ssl_cert_inst(&ctx->cert)) {
- SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO, ERR_R_MALLOC_FAILURE);
- return 0;
- }
if (ctx->cert->key == NULL) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO, ERR_R_INTERNAL_ERROR);
return 0;
if (ctx->cert->key == NULL) {
SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO, ERR_R_INTERNAL_ERROR);
return 0;
@@
-1016,8
+984,7
@@
int SSL_CTX_use_serverinfo_file(SSL_CTX *ctx, const char *file)
OPENSSL_free(header);
OPENSSL_free(extension);
OPENSSL_free(serverinfo);
OPENSSL_free(header);
OPENSSL_free(extension);
OPENSSL_free(serverinfo);
- if (bin != NULL)
- BIO_free(bin);
+ BIO_free(bin);
return ret;
}
# endif /* OPENSSL_NO_STDIO */
return ret;
}
# endif /* OPENSSL_NO_STDIO */