@@ -41889,6 +41889,7 @@ static int test_wolfSSL_GENERAL_NAME_print(void)
4188941889 X509_EXTENSION* ext = NULL;
4189041890 AUTHORITY_INFO_ACCESS* aia = NULL;
4189141891 ACCESS_DESCRIPTION* ad = NULL;
41892+ ASN1_IA5STRING *dnsname = NULL;
4189241893
4189341894 const unsigned char v4Addr[] = {192,168,53,1};
4189441895 const unsigned char v6Addr[] =
@@ -41943,6 +41944,17 @@ static int test_wolfSSL_GENERAL_NAME_print(void)
4194341944 X509_free(x509);
4194441945 x509 = NULL;
4194541946
41947+ /* Lets test for setting as well. */
41948+ ExpectNotNull(gn = GENERAL_NAME_new());
41949+ ExpectNotNull(dnsname = ASN1_IA5STRING_new());
41950+ ExpectIntEQ(ASN1_STRING_set(dnsname, "example.com", -1), 1);
41951+ GENERAL_NAME_set0_value(gn, GEN_DNS, dnsname);
41952+ dnsname = NULL;
41953+ ExpectIntEQ(GENERAL_NAME_print(out, gn), 1);
41954+ XMEMSET(outbuf, 0, sizeof(outbuf));
41955+ ExpectIntGT(BIO_read(out, outbuf, sizeof(outbuf)), 0);
41956+ ExpectIntEQ(XSTRNCMP((const char*)outbuf, dnsStr, XSTRLEN(dnsStr)), 0);
41957+
4194641958 /* test for GEN_URI */
4194741959
4194841960 ExpectTrue((f = XFOPEN("./certs/ocsp/root-ca-cert.pem", "rb")) != XBADFILE);
0 commit comments