Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/crltest.c: Add check for glue2bio #17718

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 22 additions & 2 deletions test/crltest.c
Expand Up @@ -200,9 +200,16 @@ static BIO *glue2bio(const char **pem, char **out)
*/
static X509_CRL *CRL_from_strings(const char **pem)
{
X509_CRL *crl;
char *p;
BIO *b = glue2bio(pem, &p);
X509_CRL *crl = PEM_read_bio_X509_CRL(b, NULL, NULL, NULL);

if (b == NULL) {
OPENSSL_free(p);
return NULL;
}

crl = PEM_read_bio_X509_CRL(b, NULL, NULL, NULL);

OPENSSL_free(p);
BIO_free(b);
Expand All @@ -214,9 +221,16 @@ static X509_CRL *CRL_from_strings(const char **pem)
*/
static X509 *X509_from_strings(const char **pem)
{
X509 *x;
char *p;
BIO *b = glue2bio(pem, &p);
X509 *x = PEM_read_bio_X509(b, NULL, NULL, NULL);

if (b == NULL) {
OPENSSL_free(p);
return NULL;
}

x = PEM_read_bio_X509(b, NULL, NULL, NULL);

OPENSSL_free(p);
BIO_free(b);
Expand Down Expand Up @@ -363,6 +377,12 @@ static int test_reuse_crl(void)
char *p;
BIO *b = glue2bio(kRevokedCRL, &p);

if (b == NULL) {
OPENSSL_free(p);
X509_CRL_free(reused_crl);
return 0;
}

reused_crl = PEM_read_bio_X509_CRL(b, &reused_crl, NULL, NULL);

OPENSSL_free(p);
Expand Down