[Pidgin] #4381: Add HMAC digest to libpurple
Pidgin
trac at pidgin.im
Wed Dec 12 21:31:30 EST 2007
#4381: Add HMAC digest to libpurple
--------------------------+-------------------------------------------------
Reporter: QuLogic | Type: patch
Status: new | Priority: minor
Component: libpurple | Version: 2.3.1
Keywords: HMAC, digest | Pending: 0
--------------------------+-------------------------------------------------
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.
--
Ticket URL: <http://developer.pidgin.im/ticket/4381>
Pidgin <http://pidgin.im>
Pidgin
More information about the Tracker
mailing list