Ticket #4381 (closed patch: fixed)
Add HMAC digest to libpurple
| Reported by: | QuLogic | Owned by: | grim |
|---|---|---|---|
| Milestone: | Component: | libpurple | |
| Version: | 2.3.1 | Keywords: | HMAC, digest |
| Cc: |
Description
So khc wanted to take a look at the MSNP15 stuff, so I'm posting these tickets.
This patch adds the HMAC digest to libpurple. A few points:
- The underlying hash function can be set via purple_cipher_context_set_option(cipher, "hash", hash). The blocksize isn't really available, so I just assumed a size of 64 bytes. Fortunately, the supplied hashes all have a blocksize of 64 bytes, but this will need to be fixed if a different hash is added.
- The key can be set with purple_cipher_context_set_key. Because of the way it's implemented, this acts almost like a reset (but without changing the hash).
- Since the key can be of any length, perhaps with NULLs, and _set_key doesn't accept a length, I've had to add purple_cipher_context_set_option(cipher, "keyLen", key_len) so that things would work properly.
- Finally, I've added some tests with both MD5 and SHA1 as underlying hashes from RFC2202.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.



