From: job Date: Thu, 2 Sep 2021 15:54:40 +0000 (+0000) Subject: Replace ossl_assert()/assert() with OPENSSL_assert() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=fdc18a964223a67a4ea861959e2b817ad6574322;p=openbsd Replace ossl_assert()/assert() with OPENSSL_assert() OK tb@ --- diff --git a/lib/libcrypto/x509/x509_addr.c b/lib/libcrypto/x509/x509_addr.c index 2bbecaec975..5946c71238d 100644 --- a/lib/libcrypto/x509/x509_addr.c +++ b/lib/libcrypto/x509/x509_addr.c @@ -971,7 +971,7 @@ int X509v3_addr_canonize(IPAddrBlocks *addr) } (void)sk_IPAddressFamily_set_cmp_func(addr, IPAddressFamily_cmp); sk_IPAddressFamily_sort(addr); - if (!ossl_assert(X509v3_addr_is_canonical(addr))) + if (!OPENSSL_assert(X509v3_addr_is_canonical(addr))) return 0; return 1; } @@ -1277,9 +1277,9 @@ static int addr_validate_path_internal(X509_STORE_CTX *ctx, int i, j, ret = 1; X509 *x; - if (!ossl_assert(chain != NULL && sk_X509_num(chain) > 0) - || !ossl_assert(ctx != NULL || ext != NULL) - || !ossl_assert(ctx == NULL || ctx->verify_cb != NULL)) { + if (!OPENSSL_assert(chain != NULL && sk_X509_num(chain) > 0) + || !OPENSSL_assert(ctx != NULL || ext != NULL) + || !OPENSSL_assert(ctx == NULL || ctx->verify_cb != NULL)) { if (ctx != NULL) ctx->error = X509_V_ERR_UNSPECIFIED; return 0; diff --git a/lib/libcrypto/x509/x509_asid.c b/lib/libcrypto/x509/x509_asid.c index 4e45c7ac805..56283cbe2b2 100644 --- a/lib/libcrypto/x509/x509_asid.c +++ b/lib/libcrypto/x509/x509_asid.c @@ -218,11 +218,11 @@ static int ASIdOrRange_cmp(const ASIdOrRange *const *a_, { const ASIdOrRange *a = *a_, *b = *b_; - assert((a->type == ASIdOrRange_id && a->u.id != NULL) || + OPENSSL_assert((a->type == ASIdOrRange_id && a->u.id != NULL) || (a->type == ASIdOrRange_range && a->u.range != NULL && a->u.range->min != NULL && a->u.range->max != NULL)); - assert((b->type == ASIdOrRange_id && b->u.id != NULL) || + OPENSSL_assert((b->type == ASIdOrRange_id && b->u.id != NULL) || (b->type == ASIdOrRange_range && b->u.range != NULL && b->u.range->min != NULL && b->u.range->max != NULL)); @@ -328,7 +328,7 @@ int X509v3_asid_add_id_or_range(ASIdentifiers *asid, static int extract_min_max(ASIdOrRange *aor, ASN1_INTEGER **min, ASN1_INTEGER **max) { - if (!ossl_assert(aor != NULL)) + if (!OPENSSL_assert(aor != NULL)) return 0; switch (aor->type) { case ASIdOrRange_id: @@ -494,7 +494,7 @@ static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice) /* * Make sure we're properly sorted (paranoia). */ - if (!ossl_assert(ASN1_INTEGER_cmp(a_min, b_min) <= 0)) + if (!OPENSSL_assert(ASN1_INTEGER_cmp(a_min, b_min) <= 0)) goto done; /* @@ -584,7 +584,7 @@ static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice) } /* Paranoia */ - if (!ossl_assert(ASIdentifierChoice_is_canonical(choice))) + if (!OPENSSL_assert(ASIdentifierChoice_is_canonical(choice))) goto done; ret = 1; @@ -833,9 +833,9 @@ static int asid_validate_path_internal(X509_STORE_CTX *ctx, int i, ret = 1, inherit_as = 0, inherit_rdi = 0; X509 *x; - if (!ossl_assert(chain != NULL && sk_X509_num(chain) > 0) - || !ossl_assert(ctx != NULL || ext != NULL) - || !ossl_assert(ctx == NULL || ctx->verify_cb != NULL)) { + if (!OPENSSL_assert(chain != NULL && sk_X509_num(chain) > 0) + || !OPENSSL_assert(ctx != NULL || ext != NULL) + || !OPENSSL_assert(ctx == NULL || ctx->verify_cb != NULL)) { if (ctx != NULL) ctx->error = X509_V_ERR_UNSPECIFIED; return 0; @@ -885,7 +885,7 @@ static int asid_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 (!OPENSSL_assert(x != NULL)) { if (ctx != NULL) ctx->error = X509_V_ERR_UNSPECIFIED; return 0; @@ -935,7 +935,7 @@ static int asid_validate_path_internal(X509_STORE_CTX *ctx, /* * Trust anchor can't inherit. */ - if (!ossl_assert(x != NULL)) { + if (!OPENSSL_assert(x != NULL)) { if (ctx != NULL) ctx->error = X509_V_ERR_UNSPECIFIED; return 0;