2019-08-10 20:07:22 +08:00
|
|
|
/*
|
2020-04-23 20:55:52 +08:00
|
|
|
* Copyright 2007-2020 The OpenSSL Project Authors. All Rights Reserved.
|
2019-08-10 20:07:22 +08:00
|
|
|
* Copyright Nokia 2007-2019
|
|
|
|
* Copyright Siemens AG 2015-2019
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
|
|
|
* this file except in compliance with the License. You can obtain a copy
|
|
|
|
* in the file LICENSE in the source distribution or at
|
|
|
|
* https://www.openssl.org/source/license.html
|
|
|
|
*/
|
|
|
|
|
2019-09-28 06:45:57 +08:00
|
|
|
#ifndef OSSL_TEST_CMP_TESTLIB_H
|
|
|
|
# define OSSL_TEST_CMP_TESTLIB_H
|
2019-08-10 20:07:22 +08:00
|
|
|
|
|
|
|
# include <openssl/cmp.h>
|
|
|
|
# include <openssl/pem.h>
|
|
|
|
# include <openssl/rand.h>
|
2020-09-24 17:42:23 +08:00
|
|
|
# include "crypto/x509.h" /* for x509_set0_libctx() and x509_dup_ex() */
|
2019-08-10 20:07:22 +08:00
|
|
|
|
2019-11-05 16:56:59 +08:00
|
|
|
# include "../crypto/cmp/cmp_local.h"
|
2019-08-10 20:07:22 +08:00
|
|
|
|
|
|
|
# include "testutil.h"
|
|
|
|
|
|
|
|
# ifndef OPENSSL_NO_CMP
|
|
|
|
# define CMP_TEST_REFVALUE_LENGTH 15 /* arbitrary value */
|
2020-08-23 16:06:06 +08:00
|
|
|
EVP_PKEY *load_pem_key(const char *file, OPENSSL_CTX *libctx);
|
2020-08-13 04:20:23 +08:00
|
|
|
X509 *load_pem_cert(const char *file, OPENSSL_CTX *libctx);
|
2019-08-10 20:07:22 +08:00
|
|
|
X509_REQ *load_csr(const char *file);
|
2019-12-17 13:07:51 +08:00
|
|
|
OSSL_CMP_MSG *load_pkimsg(const char *file);
|
2019-08-10 20:07:22 +08:00
|
|
|
int valid_asn1_encoding(const OSSL_CMP_MSG *msg);
|
|
|
|
int STACK_OF_X509_cmp(const STACK_OF(X509) *sk1, const STACK_OF(X509) *sk2);
|
|
|
|
int STACK_OF_X509_push1(STACK_OF(X509) *sk, X509 *cert);
|
2020-03-11 00:32:57 +08:00
|
|
|
int print_to_bio_out(const char *func, const char *file, int line,
|
|
|
|
OSSL_CMP_severity level, const char *msg);
|
2019-08-10 20:07:22 +08:00
|
|
|
# endif
|
|
|
|
|
2019-09-28 06:45:57 +08:00
|
|
|
#endif /* OSSL_TEST_CMP_TESTLIB_H */
|