Latest update.
This commit is contained in:
+13
-4
@@ -253,11 +253,20 @@ void ssl_cert_free(CERT *c)
|
||||
int ssl_cert_set0_chain(SSL *s, SSL_CTX *ctx, STACK_OF(X509) *chain)
|
||||
{
|
||||
int i, r;
|
||||
CERT_PKEY *cpk = s ? s->cert->key : ctx->cert->key;
|
||||
CERT_PKEY *cpk = s != NULL ? s->cert->key : ctx->cert->key;
|
||||
SSL_CTX *realctx = s != NULL ? s->ctx : ctx;
|
||||
|
||||
if (!cpk)
|
||||
return 0;
|
||||
for (i = 0; i < sk_X509_num(chain); i++) {
|
||||
r = ssl_security_cert(s, ctx, sk_X509_value(chain, i), 0, 0);
|
||||
X509 *x = sk_X509_value(chain, i);
|
||||
|
||||
if (!X509v3_cache_extensions(x, realctx->libctx, realctx->propq)) {
|
||||
SSLerr(0, ERR_LIB_X509);
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = ssl_security_cert(s, ctx, x, 0, 0);
|
||||
if (r != 1) {
|
||||
SSLerr(SSL_F_SSL_CERT_SET0_CHAIN, r);
|
||||
return 0;
|
||||
@@ -377,7 +386,7 @@ int ssl_verify_cert_chain(SSL *s, STACK_OF(X509) *sk)
|
||||
else
|
||||
verify_store = s->ctx->cert_store;
|
||||
|
||||
ctx = X509_STORE_CTX_new();
|
||||
ctx = X509_STORE_CTX_new_with_libctx(s->ctx->libctx, s->ctx->propq);
|
||||
if (ctx == NULL) {
|
||||
SSLerr(SSL_F_SSL_VERIFY_CERT_CHAIN, ERR_R_MALLOC_FAILURE);
|
||||
return 0;
|
||||
@@ -860,7 +869,7 @@ int ssl_build_cert_chain(SSL *s, SSL_CTX *ctx, int flags)
|
||||
untrusted = cpk->chain;
|
||||
}
|
||||
|
||||
xs_ctx = X509_STORE_CTX_new();
|
||||
xs_ctx = X509_STORE_CTX_new_with_libctx(s->ctx->libctx, s->ctx->propq);
|
||||
if (xs_ctx == NULL) {
|
||||
SSLerr(SSL_F_SSL_BUILD_CERT_CHAIN, ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
|
||||
Reference in New Issue
Block a user