Merge pull request #5388 from lealem47/crlPrint

Adding X509_CRL_print() function
This commit is contained in:
David Garske
2022-08-22 17:16:19 -07:00
committed by GitHub
8 changed files with 772 additions and 116 deletions

View File

@@ -52702,9 +52702,9 @@ static int test_wolfSSL_X509_print(void)
#if defined(OPENSSL_ALL) || defined(WOLFSSL_IP_ALT_NAME)
/* Will print IP address subject alt name. */
AssertIntEQ(BIO_get_mem_data(bio, NULL), 3240);
AssertIntEQ(BIO_get_mem_data(bio, NULL), 3255);
#else
AssertIntEQ(BIO_get_mem_data(bio, NULL), 3218);
AssertIntEQ(BIO_get_mem_data(bio, NULL), 3233);
#endif
BIO_free(bio);
@@ -52731,6 +52731,33 @@ static int test_wolfSSL_X509_print(void)
return 0;
}
static int test_wolfSSL_X509_CRL_print(void)
{
#if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) && defined(HAVE_CRL)\
&& !defined(NO_FILESYSTEM) && defined(XSNPRINTF)
X509_CRL* crl;
BIO *bio;
XFILE fp;
printf(testingFmt, "test_X509_CRL_print");
fp = XFOPEN("./certs/crl/crl.pem", "rb");
AssertTrue((fp != XBADFILE));
AssertNotNull(crl = (X509_CRL*)PEM_read_X509_CRL(fp, (X509_CRL **)NULL,
NULL, NULL));
XFCLOSE(fp);
AssertNotNull(bio = BIO_new(BIO_s_mem()));
AssertIntEQ(X509_CRL_print(bio, crl), SSL_SUCCESS);
X509_CRL_free(crl);
BIO_free(bio);
printf(resultFmt, passed);
#endif
return 0;
}
static int test_wolfSSL_BIO_get_len(void)
{
#if defined(OPENSSL_EXTRA) && !defined(NO_BIO)
@@ -57602,6 +57629,7 @@ TEST_CASE testCases[] = {
TEST_DECL(test_wolfSSL_X509_get_version),
#ifndef NO_BIO
TEST_DECL(test_wolfSSL_X509_print),
TEST_DECL(test_wolfSSL_X509_CRL_print),
TEST_DECL(test_wolfSSL_BIO_get_len),
#endif