| 144 | |
| 145 | #ifdef USE_OPENSSL |
| 146 | static const EVP_MD *csum_evp_md(struct name_num_item *nni) |
| 147 | { |
| 148 | const EVP_MD *emd; |
| 149 | if (!(nni->flags & NNI_EVP)) |
| 150 | return NULL; |
| 151 | |
| 152 | #ifdef USE_MD5_ASM |
| 153 | if (nni->num == CSUM_MD5) |
| 154 | emd = NULL; |
| 155 | else |
| 156 | #endif |
| 157 | emd = EVP_get_digestbyname(nni->name); |
| 158 | if (emd && !(nni->flags & NNI_EVP_OK)) { /* Make sure it works before we advertise it */ |
| 159 | if (!ctx_evp && !(ctx_evp = EVP_MD_CTX_create())) |
| 160 | out_of_memory("csum_evp_md"); |
| 161 | /* Some routines are marked as legacy and are not enabled in the openssl.cnf file. |
| 162 | * If we can't init the emd, we'll fall back to our built-in code. */ |
| 163 | if (EVP_DigestInit_ex(ctx_evp, emd, NULL) == 0) |
| 164 | emd = NULL; |
| 165 | else |
| 166 | nni->flags = (nni->flags & ~NNI_BUILTIN) | NNI_EVP_OK; |
| 167 | } |
| 168 | if (!emd) |
| 169 | nni->flags &= ~NNI_EVP; |
| 170 | return emd; |
| 171 | } |
| 172 | #endif |
| 173 | |
| 174 | void parse_checksum_choice(int final_call) |
no outgoing calls
no test coverage detected