test: TLS1.3 and new ciphers for kTLS
[openssl.git] / test / cmp_testlib.c
index d63242427280f840ca459b3178510f340874002b..d25ab7468b592dac92125c9ff5fdf6787dc5ea7e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2007-2019 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
  * Copyright Nokia 2007-2019
  * Copyright Siemens AG 2015-2019
  *
@@ -12,6 +12,8 @@
 #include "cmp_testlib.h"
 #include <openssl/rsa.h> /* needed in case config no-deprecated */
 
+DEFINE_STACK_OF(X509)
+
 EVP_PKEY *load_pem_key(const char *file)
 {
     EVP_PKEY *key = NULL;
@@ -40,6 +42,14 @@ X509 *load_pem_cert(const char *file)
     return cert;
 }
 
+OSSL_CMP_MSG *load_pkimsg(const char *file)
+{
+    OSSL_CMP_MSG *msg;
+
+    (void)TEST_ptr((msg = ossl_cmp_msg_load(file)));
+    return msg;
+}
+
 X509_REQ *load_csr(const char *file)
 {
     X509_REQ *csr = NULL;
@@ -118,3 +128,9 @@ int STACK_OF_X509_push1(STACK_OF(X509) *sk, X509 *cert)
         X509_free(cert); /* down-ref */
     return res;
 }
+
+int print_to_bio_out(const char *func, const char *file, int line,
+                     OSSL_CMP_severity level, const char *msg)
+{
+    return OSSL_CMP_print_to_bio(bio_out, func, file, line, level, msg);
+}