/*
- * Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
if (*choice == NULL) {
if ((*choice = ASIdentifierChoice_new()) == NULL)
return 0;
- if (!ossl_assert((*choice)->u.inherit == NULL))
- return 0;
if (((*choice)->u.inherit = ASN1_NULL_new()) == NULL)
return 0;
(*choice)->type = ASIdentifierChoice_inherit;
if (*choice == NULL) {
if ((*choice = ASIdentifierChoice_new()) == NULL)
return 0;
- if (!ossl_assert((*choice)->u.asIdsOrRanges == NULL))
- return 0;
(*choice)->u.asIdsOrRanges = sk_ASIdOrRange_new(ASIdOrRange_cmp);
if ((*choice)->u.asIdsOrRanges == NULL)
return 0;
static int extract_min_max(ASIdOrRange *aor,
ASN1_INTEGER **min, ASN1_INTEGER **max)
{
- if (!ossl_assert(aor != NULL && min != NULL && max != NULL))
+ if (!ossl_assert(aor != NULL))
return 0;
switch (aor->type) {
case ASIdOrRange_id:
for (;; p++) {
if (p >= sk_ASIdOrRange_num(parent))
return 0;
- extract_min_max(sk_ASIdOrRange_value(parent, p), &p_min, &p_max);
+ if (!extract_min_max(sk_ASIdOrRange_value(parent, p), &p_min,
+ &p_max))
+ return 0;
if (ASN1_INTEGER_cmp(p_max, c_max) < 0)
continue;
if (ASN1_INTEGER_cmp(p_min, c_min) > 0)
} 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;
}
{
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);
}