MCPcopy Create free account
hub / github.com/apache/httpd / compute_auth

Function compute_auth

modules/session/mod_session_crypto.c:168–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166#endif
167
168static 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.

Callers 2

encrypt_stringFunction · 0.85
decrypt_stringFunction · 0.85

Calls 1

ap_siphash24_authFunction · 0.85

Tested by

no test coverage detected