diff options
author | Matt Caswell <matt@openssl.org> | 2017-08-02 15:29:31 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2017-08-21 08:44:44 +0100 |
commit | 888098304b0a77aee2d5ca5951ee5fccfeb6b1c2 (patch) | |
tree | 6f0e8a65eb1d46c68d1f5bdcd9da1d2ffd9a11fe /crypto/x509v3 | |
parent | 638c2dd0ab504e22af08e4d56b43959a8be2382e (diff) |
More updates following review feedback
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3740)
Diffstat (limited to 'crypto/x509v3')
-rw-r--r-- | crypto/x509v3/v3_addr.c | 21 | ||||
-rw-r--r-- | crypto/x509v3/v3_asid.c | 9 |
2 files changed, 6 insertions, 24 deletions
diff --git a/crypto/x509v3/v3_addr.c b/crypto/x509v3/v3_addr.c index 64d27f26e5..f4e1298ca3 100644 --- a/crypto/x509v3/v3_addr.c +++ b/crypto/x509v3/v3_addr.c @@ -496,8 +496,6 @@ static IPAddressFamily *make_IPAddressFamily(IPAddrBlocks *addr, for (i = 0; i < sk_IPAddressFamily_num(addr); i++) { f = sk_IPAddressFamily_value(addr, i); - if (!ossl_assert(f->addressFamily->data != NULL)) - goto err; if (f->addressFamily->length == keylen && !memcmp(f->addressFamily->data, key, keylen)) return f; @@ -1201,11 +1199,6 @@ static int addr_validate_path_internal(X509_STORE_CTX *ctx, } else { i = 0; x = sk_X509_value(chain, i); - if (!ossl_assert(x != NULL)) { - if (ctx != NULL) - ctx->error = X509_V_ERR_UNSPECIFIED; - return 0; - } if ((ext = x->rfc3779_addr) == NULL) goto done; } @@ -1227,11 +1220,6 @@ static int addr_validate_path_internal(X509_STORE_CTX *ctx, */ for (i++; i < sk_X509_num(chain); i++) { x = sk_X509_value(chain, i); - if (!ossl_assert(x != NULL)) { - if (ctx != NULL) - ctx->error = X509_V_ERR_UNSPECIFIED; - return 0; - } if (!X509v3_addr_is_canonical(x->rfc3779_addr)) validation_err(X509_V_ERR_INVALID_EXTENSION); if (x->rfc3779_addr == NULL) { @@ -1275,11 +1263,6 @@ static int addr_validate_path_internal(X509_STORE_CTX *ctx, /* * Trust anchor can't inherit. */ - if (!ossl_assert(x != NULL)) { - if (ctx != NULL) - ctx->error = X509_V_ERR_UNSPECIFIED; - return 0; - } if (x->rfc3779_addr != NULL) { for (j = 0; j < sk_IPAddressFamily_num(x->rfc3779_addr); j++) { IPAddressFamily *fp = @@ -1304,8 +1287,10 @@ int X509v3_addr_validate_path(X509_STORE_CTX *ctx) { if (ctx->chain == NULL || sk_X509_num(ctx->chain) == 0 - || ctx->verify_cb == NULL) + || ctx->verify_cb == NULL) { + ctx->error = X509_V_ERR_UNSPECIFIED; return 0; + } return addr_validate_path_internal(ctx, ctx->chain, NULL); } diff --git a/crypto/x509v3/v3_asid.c b/crypto/x509v3/v3_asid.c index 66259bae1b..6bc4afd38c 100644 --- a/crypto/x509v3/v3_asid.c +++ b/crypto/x509v3/v3_asid.c @@ -743,11 +743,6 @@ static int asid_validate_path_internal(X509_STORE_CTX *ctx, } else { i = 0; x = sk_X509_value(chain, i); - if (!ossl_assert(x != NULL)) { - if (ctx != NULL) - ctx->error = X509_V_ERR_UNSPECIFIED; - return 0; - } if ((ext = x->rfc3779_asid) == NULL) goto done; } @@ -857,8 +852,10 @@ int X509v3_asid_validate_path(X509_STORE_CTX *ctx) { if (ctx->chain == NULL || sk_X509_num(ctx->chain) == 0 - || ctx->verify_cb == NULL) + || ctx->verify_cb == NULL) { + ctx->error = X509_V_ERR_UNSPECIFIED; return 0; + } return asid_validate_path_internal(ctx, ctx->chain, NULL); } |