@@ -12340,7 +12340,7 @@ static int GenerateDNSEntryIPString(DNS_entry* entry, void* heap)
1234012340}
1234112341#endif /* OPENSSL_ALL || WOLFSSL_IP_ALT_NAME */
1234212342
12343- #if defined(OPENSSL_ALL)
12343+ #if defined(OPENSSL_ALL) && defined(WOLFSSL_ASN_TEMPLATE)
1234412344/* used to set the human readable string for the registeredID with an
1234512345 * ASN_RID_TYPE DNS entry
1234612346 * return 0 on success
@@ -12363,9 +12363,14 @@ static int GenerateDNSEntryRIDString(DNS_entry* entry, void* heap)
1236312363 }
1236412364 rid = entry->name;
1236512365
12366+ #if defined(HAVE_OID_DECODING) || defined(WOLFSSL_ASN_PRINT)
1236612367 /* Decode OBJECT_ID into dotted form array. */
1236712368 ret = DecodeObjectId((const byte*)(rid),(word32)entry->len, tmpName,
1236812369 (word32*)&tmpSize);
12370+ #else
12371+ ret = NOT_COMPILED_IN;
12372+ #endif
12373+
1236912374 if (ret == 0) {
1237012375 j = 0;
1237112376 /* Append each number of dotted form. */
@@ -12398,7 +12403,7 @@ static int GenerateDNSEntryRIDString(DNS_entry* entry, void* heap)
1239812403
1239912404 return ret;
1240012405}
12401- #endif /* OPENSSL_ALL */
12406+ #endif /* OPENSSL_ALL && WOLFSSL_ASN_TEMPLATE */
1240212407
1240312408#ifdef WOLFSSL_ASN_TEMPLATE
1240412409
@@ -12478,17 +12483,19 @@ static int SetDNSEntry(DecodedCert* cert, const char* str, int strLen,
1247812483 XMEMCPY(dnsEntry->name, str, (size_t)strLen);
1247912484 dnsEntry->name[strLen] = '\0';
1248012485
12481- #if defined(OPENSSL_ALL) || defined(WOLFSSL_IP_ALT_NAME)
12482- /* store IP addresses as a string */
12483- if (type == ASN_IP_TYPE ) {
12484- if ((ret = GenerateDNSEntryIPString (dnsEntry, cert->heap)) != 0) {
12486+ #if defined(OPENSSL_ALL)
12487+ /* store registeredID as a string */
12488+ if (type == ASN_RID_TYPE ) {
12489+ if ((ret = GenerateDNSEntryRIDString (dnsEntry, cert->heap)) != 0) {
1248512490 XFREE(dnsEntry->name, cert->heap, DYNAMIC_TYPE_ALTNAME);
1248612491 XFREE(dnsEntry, cert->heap, DYNAMIC_TYPE_ALTNAME);
1248712492 }
1248812493 }
12489- /* store registeredID as a string */
12490- else if (type == ASN_RID_TYPE) {
12491- if ((ret = GenerateDNSEntryRIDString(dnsEntry, cert->heap)) != 0) {
12494+ #endif
12495+ #if defined(OPENSSL_ALL) || defined(WOLFSSL_IP_ALT_NAME)
12496+ /* store IP addresses as a string */
12497+ if (type == ASN_IP_TYPE) {
12498+ if ((ret = GenerateDNSEntryIPString(dnsEntry, cert->heap)) != 0) {
1249212499 XFREE(dnsEntry->name, cert->heap, DYNAMIC_TYPE_ALTNAME);
1249312500 XFREE(dnsEntry, cert->heap, DYNAMIC_TYPE_ALTNAME);
1249412501 }
0 commit comments