Change RNG test to block oriented instead of request oriented, add option
[openssl.git] / fips / fips.h
index af36f0323645aacd1e2fe0a7ff7b4047b7ed7522..79160bbaace10f46a59638196d0de7f8b8df0086 100644 (file)
@@ -92,9 +92,11 @@ void FIPS_corrupt_ec_keygen(void);
 void FIPS_corrupt_rng(void);
 void FIPS_corrupt_drbg(void);
 void FIPS_rng_stick(void);
+void FIPS_drbg_stick(void);
 int FIPS_selftest_rng(void);
 int FIPS_selftest_hmac(void);
 int FIPS_selftest_drbg(void);
+int FIPS_selftest_cmac(void);
 
 unsigned int FIPS_incore_fingerprint(unsigned char *sig,unsigned int len);
 int FIPS_check_incore_fingerprint(void);
@@ -121,6 +123,10 @@ void FIPS_set_locking_callbacks(void (*func)(int mode, int type,
                                int (*add_cb)(int *pointer, int amount,
                                        int type, const char *file, int line));
 
+void FIPS_set_malloc_callbacks(
+               void *(*malloc_cb)(int num, const char *file, int line),
+               void (*free_cb)(void *));
+
 #define FIPS_ERROR_IGNORED(alg) OpenSSLDie(__FILE__, __LINE__, \
                alg " previous FIPS forbidden algorithm error ignored");
 
@@ -159,6 +165,8 @@ void FIPS_set_locking_callbacks(void (*func)(int mode, int type,
 #define EVP_CIPHER_CTX_ctrl FIPS_cipher_ctx_ctrl
 #define EVP_CIPHER_CTX_new FIPS_cipher_ctx_new
 #define EVP_CIPHER_CTX_free FIPS_cipher_ctx_free
+#define EVP_CIPHER_CTX_copy FIPS_cipher_ctx_copy
+#define EVP_CIPHER_CTX_set_key_length FIPS_cipher_ctx_set_key_length
 
 #define DSA_SIG_new FIPS_dsa_sig_new
 #define DSA_SIG_free FIPS_dsa_sig_free
@@ -181,6 +189,7 @@ void ERR_load_FIPS_strings(void);
 
 /* Function codes. */
 #define FIPS_F_DH_BUILTIN_GENPARAMS                     100
+#define FIPS_F_DRBG_CPRNG_TEST                          141
 #define FIPS_F_DSA_BUILTIN_PARAMGEN                     101
 #define FIPS_F_DSA_BUILTIN_PARAMGEN2                    126
 #define FIPS_F_DSA_DO_SIGN                              102
@@ -194,16 +203,19 @@ void ERR_load_FIPS_strings(void);
 #define FIPS_F_FIPS_CIPHERINIT                          128
 #define FIPS_F_FIPS_DIGESTINIT                          127
 #define FIPS_F_FIPS_DRBG_GENERATE                       132
+#define FIPS_F_FIPS_DRBG_GENERATE_INTERNAL              138
 #define FIPS_F_FIPS_DRBG_HEALTH_CHECK                   137
 #define FIPS_F_FIPS_DRBG_INIT                           136
 #define FIPS_F_FIPS_DRBG_INSTANTIATE                    133
 #define FIPS_F_FIPS_DRBG_NEW                            134
 #define FIPS_F_FIPS_DRBG_RESEED                                 135
+#define FIPS_F_FIPS_DRBG_SINGLE_KAT                     140
 #define FIPS_F_FIPS_DSA_CHECK                           107
 #define FIPS_F_FIPS_MODE_SET                            108
 #define FIPS_F_FIPS_PKEY_SIGNATURE_TEST                         109
 #define FIPS_F_FIPS_SELFTEST_AES                        110
 #define FIPS_F_FIPS_SELFTEST_AES_GCM                    130
+#define FIPS_F_FIPS_SELFTEST_CMAC                       139
 #define FIPS_F_FIPS_SELFTEST_DES                        111
 #define FIPS_F_FIPS_SELFTEST_DSA                        112
 #define FIPS_F_FIPS_SELFTEST_ECDSA                      131
@@ -225,6 +237,7 @@ void ERR_load_FIPS_strings(void);
 #define FIPS_R_CANNOT_READ_EXE                          103
 #define FIPS_R_CANNOT_READ_EXE_DIGEST                   104
 #define FIPS_R_CONTRADICTING_EVIDENCE                   114
+#define FIPS_R_DRBG_STUCK                               142
 #define FIPS_R_ENTROPY_ERROR_UNDETECTED                         133
 #define FIPS_R_ENTROPY_NOT_REQUESTED_FOR_RESEED                 134
 #define FIPS_R_ERROR_INITIALISING_DRBG                  120
@@ -242,6 +255,7 @@ void ERR_load_FIPS_strings(void);
 #define FIPS_R_GENERATE_ERROR_UNDETECTED                136
 #define FIPS_R_INSTANTIATE_ERROR                        125
 #define FIPS_R_INSUFFICIENT_SECURITY_STRENGTH           132
+#define FIPS_R_INTERNAL_ERROR                           143
 #define FIPS_R_INVALID_KEY_LENGTH                       109
 #define FIPS_R_IN_ERROR_STATE                           126
 #define FIPS_R_KEY_TOO_SHORT                            108