summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorjob <>2021-09-02 15:54:40 +0000
committerjob <>2021-09-02 15:54:40 +0000
commit7daf39340a6088bdd0268abdbafcc61fd0c987f8 (patch)
tree9c02579512205525c74dd212fa95565c3e91789a /src/lib
parentcb50e4cba7c57348005d6d7be62fcea1ee889b2e (diff)
downloadopenbsd-7daf39340a6088bdd0268abdbafcc61fd0c987f8.tar.gz
openbsd-7daf39340a6088bdd0268abdbafcc61fd0c987f8.tar.bz2
openbsd-7daf39340a6088bdd0268abdbafcc61fd0c987f8.zip
Replace ossl_assert()/assert() with OPENSSL_assert()
OK tb@
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/x509/x509_addr.c8
-rw-r--r--src/lib/libcrypto/x509/x509_asid.c20
2 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/libcrypto/x509/x509_addr.c b/src/lib/libcrypto/x509/x509_addr.c
index 2bbecaec97..5946c71238 100644
--- a/src/lib/libcrypto/x509/x509_addr.c
+++ b/src/lib/libcrypto/x509/x509_addr.c
@@ -971,7 +971,7 @@ int X509v3_addr_canonize(IPAddrBlocks *addr)
971 } 971 }
972 (void)sk_IPAddressFamily_set_cmp_func(addr, IPAddressFamily_cmp); 972 (void)sk_IPAddressFamily_set_cmp_func(addr, IPAddressFamily_cmp);
973 sk_IPAddressFamily_sort(addr); 973 sk_IPAddressFamily_sort(addr);
974 if (!ossl_assert(X509v3_addr_is_canonical(addr))) 974 if (!OPENSSL_assert(X509v3_addr_is_canonical(addr)))
975 return 0; 975 return 0;
976 return 1; 976 return 1;
977} 977}
@@ -1277,9 +1277,9 @@ static int addr_validate_path_internal(X509_STORE_CTX *ctx,
1277 int i, j, ret = 1; 1277 int i, j, ret = 1;
1278 X509 *x; 1278 X509 *x;
1279 1279
1280 if (!ossl_assert(chain != NULL && sk_X509_num(chain) > 0) 1280 if (!OPENSSL_assert(chain != NULL && sk_X509_num(chain) > 0)
1281 || !ossl_assert(ctx != NULL || ext != NULL) 1281 || !OPENSSL_assert(ctx != NULL || ext != NULL)
1282 || !ossl_assert(ctx == NULL || ctx->verify_cb != NULL)) { 1282 || !OPENSSL_assert(ctx == NULL || ctx->verify_cb != NULL)) {
1283 if (ctx != NULL) 1283 if (ctx != NULL)
1284 ctx->error = X509_V_ERR_UNSPECIFIED; 1284 ctx->error = X509_V_ERR_UNSPECIFIED;
1285 return 0; 1285 return 0;
diff --git a/src/lib/libcrypto/x509/x509_asid.c b/src/lib/libcrypto/x509/x509_asid.c
index 4e45c7ac80..56283cbe2b 100644
--- a/src/lib/libcrypto/x509/x509_asid.c
+++ b/src/lib/libcrypto/x509/x509_asid.c
@@ -218,11 +218,11 @@ static int ASIdOrRange_cmp(const ASIdOrRange *const *a_,
218{ 218{
219 const ASIdOrRange *a = *a_, *b = *b_; 219 const ASIdOrRange *a = *a_, *b = *b_;
220 220
221 assert((a->type == ASIdOrRange_id && a->u.id != NULL) || 221 OPENSSL_assert((a->type == ASIdOrRange_id && a->u.id != NULL) ||
222 (a->type == ASIdOrRange_range && a->u.range != NULL && 222 (a->type == ASIdOrRange_range && a->u.range != NULL &&
223 a->u.range->min != NULL && a->u.range->max != NULL)); 223 a->u.range->min != NULL && a->u.range->max != NULL));
224 224
225 assert((b->type == ASIdOrRange_id && b->u.id != NULL) || 225 OPENSSL_assert((b->type == ASIdOrRange_id && b->u.id != NULL) ||
226 (b->type == ASIdOrRange_range && b->u.range != NULL && 226 (b->type == ASIdOrRange_range && b->u.range != NULL &&
227 b->u.range->min != NULL && b->u.range->max != NULL)); 227 b->u.range->min != NULL && b->u.range->max != NULL));
228 228
@@ -328,7 +328,7 @@ int X509v3_asid_add_id_or_range(ASIdentifiers *asid,
328static int extract_min_max(ASIdOrRange *aor, 328static int extract_min_max(ASIdOrRange *aor,
329 ASN1_INTEGER **min, ASN1_INTEGER **max) 329 ASN1_INTEGER **min, ASN1_INTEGER **max)
330{ 330{
331 if (!ossl_assert(aor != NULL)) 331 if (!OPENSSL_assert(aor != NULL))
332 return 0; 332 return 0;
333 switch (aor->type) { 333 switch (aor->type) {
334 case ASIdOrRange_id: 334 case ASIdOrRange_id:
@@ -494,7 +494,7 @@ static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice)
494 /* 494 /*
495 * Make sure we're properly sorted (paranoia). 495 * Make sure we're properly sorted (paranoia).
496 */ 496 */
497 if (!ossl_assert(ASN1_INTEGER_cmp(a_min, b_min) <= 0)) 497 if (!OPENSSL_assert(ASN1_INTEGER_cmp(a_min, b_min) <= 0))
498 goto done; 498 goto done;
499 499
500 /* 500 /*
@@ -584,7 +584,7 @@ static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice)
584 } 584 }
585 585
586 /* Paranoia */ 586 /* Paranoia */
587 if (!ossl_assert(ASIdentifierChoice_is_canonical(choice))) 587 if (!OPENSSL_assert(ASIdentifierChoice_is_canonical(choice)))
588 goto done; 588 goto done;
589 589
590 ret = 1; 590 ret = 1;
@@ -833,9 +833,9 @@ static int asid_validate_path_internal(X509_STORE_CTX *ctx,
833 int i, ret = 1, inherit_as = 0, inherit_rdi = 0; 833 int i, ret = 1, inherit_as = 0, inherit_rdi = 0;
834 X509 *x; 834 X509 *x;
835 835
836 if (!ossl_assert(chain != NULL && sk_X509_num(chain) > 0) 836 if (!OPENSSL_assert(chain != NULL && sk_X509_num(chain) > 0)
837 || !ossl_assert(ctx != NULL || ext != NULL) 837 || !OPENSSL_assert(ctx != NULL || ext != NULL)
838 || !ossl_assert(ctx == NULL || ctx->verify_cb != NULL)) { 838 || !OPENSSL_assert(ctx == NULL || ctx->verify_cb != NULL)) {
839 if (ctx != NULL) 839 if (ctx != NULL)
840 ctx->error = X509_V_ERR_UNSPECIFIED; 840 ctx->error = X509_V_ERR_UNSPECIFIED;
841 return 0; 841 return 0;
@@ -885,7 +885,7 @@ static int asid_validate_path_internal(X509_STORE_CTX *ctx,
885 */ 885 */
886 for (i++; i < sk_X509_num(chain); i++) { 886 for (i++; i < sk_X509_num(chain); i++) {
887 x = sk_X509_value(chain, i); 887 x = sk_X509_value(chain, i);
888 if (!ossl_assert(x != NULL)) { 888 if (!OPENSSL_assert(x != NULL)) {
889 if (ctx != NULL) 889 if (ctx != NULL)
890 ctx->error = X509_V_ERR_UNSPECIFIED; 890 ctx->error = X509_V_ERR_UNSPECIFIED;
891 return 0; 891 return 0;
@@ -935,7 +935,7 @@ static int asid_validate_path_internal(X509_STORE_CTX *ctx,
935 /* 935 /*
936 * Trust anchor can't inherit. 936 * Trust anchor can't inherit.
937 */ 937 */
938 if (!ossl_assert(x != NULL)) { 938 if (!OPENSSL_assert(x != NULL)) {
939 if (ctx != NULL) 939 if (ctx != NULL)
940 ctx->error = X509_V_ERR_UNSPECIFIED; 940 ctx->error = X509_V_ERR_UNSPECIFIED;
941 return 0; 941 return 0;