xref: /netbsd-src/crypto/external/bsd/openssl/dist/providers/fips/self_test.h (revision b0d1725196a7921d003d2c66a14f186abda4176b)
1*b0d17251Schristos /*
2*b0d17251Schristos  * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
3*b0d17251Schristos  *
4*b0d17251Schristos  * Licensed under the Apache License 2.0 (the "License").  You may not use
5*b0d17251Schristos  * this file except in compliance with the License.  You can obtain a copy
6*b0d17251Schristos  * in the file LICENSE in the source distribution or at
7*b0d17251Schristos  * https://www.openssl.org/source/license.html
8*b0d17251Schristos  */
9*b0d17251Schristos 
10*b0d17251Schristos #include <openssl/core_dispatch.h>
11*b0d17251Schristos #include <openssl/types.h>
12*b0d17251Schristos #include <openssl/self_test.h>
13*b0d17251Schristos 
14*b0d17251Schristos typedef struct self_test_post_params_st {
15*b0d17251Schristos     /* FIPS module integrity check parameters */
16*b0d17251Schristos     const char *module_filename;            /* Module file to perform MAC on */
17*b0d17251Schristos     const char *module_checksum_data;       /* Expected module MAC integrity */
18*b0d17251Schristos 
19*b0d17251Schristos     /* Used for KAT install indicator integrity check */
20*b0d17251Schristos     const char *indicator_version;          /* version - for future proofing */
21*b0d17251Schristos     const char *indicator_data;             /* data to perform MAC on */
22*b0d17251Schristos     const char *indicator_checksum_data;    /* Expected MAC integrity value */
23*b0d17251Schristos 
24*b0d17251Schristos     /* Used for continuous tests */
25*b0d17251Schristos     const char *conditional_error_check;
26*b0d17251Schristos 
27*b0d17251Schristos     /* BIO callbacks supplied to the FIPS provider */
28*b0d17251Schristos     OSSL_FUNC_BIO_new_file_fn *bio_new_file_cb;
29*b0d17251Schristos     OSSL_FUNC_BIO_new_membuf_fn *bio_new_buffer_cb;
30*b0d17251Schristos     OSSL_FUNC_BIO_read_ex_fn *bio_read_ex_cb;
31*b0d17251Schristos     OSSL_FUNC_BIO_free_fn *bio_free_cb;
32*b0d17251Schristos     OSSL_CALLBACK *cb;
33*b0d17251Schristos     void *cb_arg;
34*b0d17251Schristos     OSSL_LIB_CTX *libctx;
35*b0d17251Schristos 
36*b0d17251Schristos } SELF_TEST_POST_PARAMS;
37*b0d17251Schristos 
38*b0d17251Schristos int SELF_TEST_post(SELF_TEST_POST_PARAMS *st, int on_demand_test);
39*b0d17251Schristos int SELF_TEST_kats(OSSL_SELF_TEST *event, OSSL_LIB_CTX *libctx);
40*b0d17251Schristos 
41*b0d17251Schristos void SELF_TEST_disable_conditional_error_state(void);
42