Return true if B64_DIGEST is the same as the base64 digest of the DIGEST_LENGTH/8 bytes at BIN_BUFFER. */
| 1327 | /* Return true if B64_DIGEST is the same as the base64 digest of the |
| 1328 | DIGEST_LENGTH/8 bytes at BIN_BUFFER. */ |
| 1329 | static bool |
| 1330 | b64_equal (unsigned char const *b64_digest, unsigned char const *bin_buffer) |
| 1331 | { |
| 1332 | idx_t b64_n_bytes = BASE64_LENGTH (digest_length >> 3); |
| 1333 | char b64[BASE64_LENGTH (DIGEST_BIN_BYTES) + 1]; |
| 1334 | base64_encode ((char const *) bin_buffer, digest_length >> 3, |
| 1335 | b64, sizeof b64); |
| 1336 | return memeq (b64_digest, b64, b64_n_bytes + 1); |
| 1337 | } |
| 1338 | #endif |
| 1339 | |
| 1340 | /* Return true if HEX_DIGEST is the same as the hex-encoded digest of the |