static X509 *test_root2 = NULL;
static X509 *test_leaf2 = NULL;
-/*
- * Glue an array of strings together. Return a BIO and put the string
- * into |*out| so we can free it.
- */
-static BIO *glue2bio(const char **pem, char **out)
-{
- size_t s = 0;
-
- *out = glue_strings(pem, &s);
- return BIO_new_mem_buf(*out, (int)s);
-}
-
-/*
- * Create a CRL from an array of strings.
- */
-static X509_CRL *CRL_from_strings(const char **pem)
-{
- X509_CRL *crl;
- char *p;
- BIO *b = glue2bio(pem, &p);
-
- if (b == NULL) {
- OPENSSL_free(p);
- return NULL;
- }
-
- crl = PEM_read_bio_X509_CRL(b, NULL, NULL, NULL);
-
- OPENSSL_free(p);
- BIO_free(b);
- return crl;
-}
-
-/*
- * Create an X509 from an array of strings.
- */
-static X509 *X509_from_strings(const char **pem)
-{
- X509 *x;
- char *p;
- BIO *b = glue2bio(pem, &p);
-
- if (b == NULL) {
- OPENSSL_free(p);
- return NULL;
- }
-
- x = PEM_read_bio_X509(b, NULL, NULL, NULL);
-
- OPENSSL_free(p);
- BIO_free(b);
- return x;
-}
-
/*
* Verify |leaf| certificate (chained up to |root|). |crls| if
* not NULL, is a list of CRLs to include in the verification. It is
STACK_OF(X509) *load_certs_pem(const char *file);
X509_REQ *load_csr_der(const char *file, OSSL_LIB_CTX *libctx);
time_t test_asn1_string_to_time_t(const char *asn1_string);
-
int compare_with_reference_file(BIO *membio, const char *reffile);
+/*
+ * Create an X509 from an array of strings.
+ */
+X509 *X509_from_strings(const char **pem);
+/*
+ * Create a CRL from an array of strings.
+ */
+X509_CRL *CRL_from_strings(const char **pem);
+/*
+ * Glue an array of strings together. Return a BIO and put the string
+ * into |*out| so we can free it.
+ */
+BIO *glue2bio(const char **pem, char **out);
+
#endif /* OSSL_TESTUTIL_H */
BIO_free(bio);
return csr;
}
+
+/*
+ * Glue an array of strings together. Return a BIO and put the string
+ * into |*out| so we can free it.
+ */
+BIO *glue2bio(const char **pem, char **out)
+{
+ size_t s = 0;
+
+ *out = glue_strings(pem, &s);
+ return BIO_new_mem_buf(*out, (int)s);
+}
+
+/*
+ * Create a CRL from an array of strings.
+ */
+X509_CRL *CRL_from_strings(const char **pem)
+{
+ X509_CRL *crl;
+ char *p;
+ BIO *b = glue2bio(pem, &p);
+
+ if (b == NULL) {
+ OPENSSL_free(p);
+ return NULL;
+ }
+
+ crl = PEM_read_bio_X509_CRL(b, NULL, NULL, NULL);
+
+ OPENSSL_free(p);
+ BIO_free(b);
+ return crl;
+}
+
+/*
+ * Create an X509 from an array of strings.
+ */
+X509 *X509_from_strings(const char **pem)
+{
+ X509 *x;
+ char *p;
+ BIO *b = glue2bio(pem, &p);
+
+ if (b == NULL) {
+ OPENSSL_free(p);
+ return NULL;
+ }
+
+ x = PEM_read_bio_X509(b, NULL, NULL, NULL);
+
+ OPENSSL_free(p);
+ BIO_free(b);
+ return x;
+}