summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2022-07-30 17:50:17 +0000
committertb <>2022-07-30 17:50:17 +0000
commit3c488e141c422575ee81b7b73c80795290158c96 (patch)
tree9dccd9e417108e1e88a5bd87d25186887e2e1c7a /src
parent85aa2601f93d47f4516c54b1a333fbf7e73c6c4e (diff)
downloadopenbsd-3c488e141c422575ee81b7b73c80795290158c96.tar.gz
openbsd-3c488e141c422575ee81b7b73c80795290158c96.tar.bz2
openbsd-3c488e141c422575ee81b7b73c80795290158c96.zip
Untangle two logic chains in x509_asid.c into something more readable.
ok jsing
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/x509/x509_asid.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/lib/libcrypto/x509/x509_asid.c b/src/lib/libcrypto/x509/x509_asid.c
index 37c38d9b68..6c73018b8d 100644
--- a/src/lib/libcrypto/x509/x509_asid.c
+++ b/src/lib/libcrypto/x509/x509_asid.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_asid.c,v 1.34 2022/05/12 20:00:06 tb Exp $ */ 1/* $OpenBSD: x509_asid.c,v 1.35 2022/07/30 17:50:17 tb Exp $ */
2/* 2/*
3 * Contributed to the OpenSSL Project by the American Registry for 3 * Contributed to the OpenSSL Project by the American Registry for
4 * Internet Numbers ("ARIN"). 4 * Internet Numbers ("ARIN").
@@ -753,9 +753,13 @@ ASIdentifierChoice_canonize(ASIdentifierChoice *choice)
753int 753int
754X509v3_asid_canonize(ASIdentifiers *asid) 754X509v3_asid_canonize(ASIdentifiers *asid)
755{ 755{
756 return (asid == NULL || 756 if (asid == NULL)
757 (ASIdentifierChoice_canonize(asid->asnum) && 757 return 1;
758 ASIdentifierChoice_canonize(asid->rdi))); 758
759 if (!ASIdentifierChoice_canonize(asid->asnum))
760 return 0;
761
762 return ASIdentifierChoice_canonize(asid->rdi);
759} 763}
760 764
761/* 765/*
@@ -900,11 +904,20 @@ const X509V3_EXT_METHOD v3_asid = {
900int 904int
901X509v3_asid_inherits(ASIdentifiers *asid) 905X509v3_asid_inherits(ASIdentifiers *asid)
902{ 906{
903 return (asid != NULL && 907 if (asid == NULL)
904 ((asid->asnum != NULL && 908 return 0;
905 asid->asnum->type == ASIdentifierChoice_inherit) || 909
906 (asid->rdi != NULL && 910 if (asid->asnum != NULL) {
907 asid->rdi->type == ASIdentifierChoice_inherit))); 911 if (asid->asnum->type == ASIdentifierChoice_inherit)
912 return 1;
913 }
914
915 if (asid->rdi != NULL) {
916 if (asid->rdi->type == ASIdentifierChoice_inherit)
917 return 1;
918 }
919
920 return 0;
908} 921}
909 922
910/* 923/*