summaryrefslogtreecommitdiff
path: root/tests/openssl_get_subj_alt_dns.c
diff options
context:
space:
mode:
authorJannis Hoffmann <jannis@fehcom.de>2024-07-14 13:34:29 +0200
committerJannis Hoffmann <jannis@fehcom.de>2024-07-14 13:34:29 +0200
commita6f36af0db13198afc6af17a27fec0561a180d91 (patch)
treeaaf20f7016cf19cf4b2a5d0e926566e6218fbe98 /tests/openssl_get_subj_alt_dns.c
parent298fd6bf83b584345f0ba67f92fd3c232039b70a (diff)
clang format fixesmeson
Diffstat (limited to 'tests/openssl_get_subj_alt_dns.c')
-rw-r--r--tests/openssl_get_subj_alt_dns.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/tests/openssl_get_subj_alt_dns.c b/tests/openssl_get_subj_alt_dns.c
index 29cd111..00969aa 100644
--- a/tests/openssl_get_subj_alt_dns.c
+++ b/tests/openssl_get_subj_alt_dns.c
@@ -33,25 +33,26 @@ int main()
const GENERAL_NAME *current_name = sk_GENERAL_NAME_value(san, i);
switch (current_name->type) {
- case GEN_DNS:
- printf("DNS: %s\n", ASN1_STRING_get0_data(current_name->d.dNSName));
- break;
- case GEN_EMAIL:
- printf("Email: %s\n", ASN1_STRING_get0_data(current_name->d.rfc822Name));
- break;
- case GEN_URI:
- printf("URI: %s\n", ASN1_STRING_get0_data(current_name->d.uniformResourceIdentifier));
- break;
- case GEN_IPADD:
- int len = ASN1_STRING_length(current_name->d.iPAddress);
- if (len != 4) {
- fprintf(stderr, "Length mismatch in ip\n");
- return 1;
- }
- const unsigned char *data = ASN1_STRING_get0_data(current_name->d.iPAddress);
- printf("IP Address: %d.%d.%d.%d\n", data[0], data[1], data[2], data[3]);
- break;
- // Add more types if needed
+ case GEN_DNS:
+ // these are alternative host names
+ printf("DNS: %s\n", ASN1_STRING_get0_data(current_name->d.dNSName));
+ break;
+ case GEN_EMAIL:
+ printf("Email: %s\n", ASN1_STRING_get0_data(current_name->d.rfc822Name));
+ break;
+ case GEN_URI:
+ printf("URI: %s\n", ASN1_STRING_get0_data(current_name->d.uniformResourceIdentifier));
+ break;
+ case GEN_IPADD:
+ int len = ASN1_STRING_length(current_name->d.iPAddress);
+ if (len != 4) {
+ fprintf(stderr, "Length mismatch in ip\n");
+ return 1;
+ }
+ const unsigned char *data = ASN1_STRING_get0_data(current_name->d.iPAddress);
+ printf("IP Address: %d.%d.%d.%d\n", data[0], data[1], data[2], data[3]);
+ break;
+ // Add more types if needed
}
}
GENERAL_NAMES_free(san);