Install custom RAND_METHOD for fuzzing
[openssl.git] / fuzz / cms.c
index b57a6de96a63112cce7bc63e257771a437fb6594..959ef9365ad1f60c1d0405bf78dfa4bfaa0274d5 100644 (file)
 
 #include <openssl/bio.h>
 #include <openssl/cms.h>
+#include <openssl/err.h>
 #include "fuzzer.h"
 
 int FuzzerInitialize(int *argc, char ***argv)
 {
+    OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
+    ERR_get_state();
+    CRYPTO_free_ex_index(0, -1);
     return 1;
 }
 
@@ -41,6 +45,7 @@ int FuzzerTestOneInput(const uint8_t *buf, size_t len)
     }
 
     BIO_free(in);
+    ERR_clear_error();
 
     return 0;
 }