Some versions of OpenSSL removed ripemd160 from the default provider. Check * and load the legacy provider if necessary. */
| 15 | /* Some versions of OpenSSL removed ripemd160 from the default provider. Check |
| 16 | * and load the legacy provider if necessary. */ |
| 17 | void init(int *argc, char ***argv) |
| 18 | { |
| 19 | const char data[] = "hash test data"; |
| 20 | u8 openssl_hash[RIPEMD160_DIGEST_LENGTH]; |
| 21 | unsigned hash_size; |
| 22 | |
| 23 | ripemd160_algo = EVP_MD_fetch(NULL, "RIPEMD-160", NULL); |
| 24 | if (!ripemd160_algo) { |
| 25 | OSSL_PROVIDER_load(NULL, "legacy"); |
| 26 | ripemd160_algo = EVP_MD_fetch(NULL, "RIPEMD-160", NULL); |
| 27 | assert(ripemd160_algo); |
| 28 | } |
| 29 | |
| 30 | assert(EVP_Digest(data, sizeof(data), openssl_hash, &hash_size, |
| 31 | ripemd160_algo, NULL)); |
| 32 | assert(hash_size == RIPEMD160_DIGEST_LENGTH); |
| 33 | } |
| 34 | |
| 35 | /* Test that splitting the data and hashing via multiple updates yields the same |
| 36 | * result as not splitting the data. */ |
nothing calls this directly
no outgoing calls
no test coverage detected