| 166 | #endif |
| 167 | |
| 168 | static void compute_auth(const void *src, apr_size_t len, |
| 169 | const char *passphrase, apr_size_t passlen, |
| 170 | unsigned char auth[AP_SIPHASH_DSIZE]) |
| 171 | { |
| 172 | unsigned char key[APR_MD5_DIGESTSIZE]; |
| 173 | |
| 174 | /* XXX: if we had a way to get the raw bytes from an apr_crypto_key_t |
| 175 | * we could use them directly (not available in APR-1.5.x). |
| 176 | * MD5 is 128bit too, so use it to get a suitable siphash key |
| 177 | * from the passphrase. |
| 178 | */ |
| 179 | apr_md5(key, passphrase, passlen); |
| 180 | |
| 181 | ap_siphash24_auth(auth, src, len, key); |
| 182 | } |
| 183 | |
| 184 | /** |
| 185 | * Initialise the encryption as per the current config. |
no test coverage detected