Ticket #4380 (closed patch: fixed)

Opened 2 years ago

Last modified 2 years ago

Add Triple-DES cipher to libpurple

Reported by: QuLogic Owned by: khc
Milestone: Component: libpurple
Version: 2.3.1 Keywords: triple-des, des3, cipher
Cc:

Description

So khc wanted to take a look at the MSNP15 stuff, so I'm posting these tickets.

This patch adds the Triple-DES cipher to libpurple. It is available as "des3". You can only use EDE3 mode with 3 keys and not anything else because that's all I needed. It can be run in ECB or CBC batch mode by using purple_cipher_context_set_option(cipher, "batchMode", PurpleCipherBatchMode mode).

Finally, there are a few tests from NIST added to test_cipher.c. They check both encrypting and decrypting, so I've added decryption to the DES cipher as well.

Attachments

purple-tripledes-cipher.diff (28.7 kB) - added by QuLogic 2 years ago.
Adds Triple-DES Cipher to libpurple. Uses the reserved fields for some new accessors.

Change History

Changed 2 years ago by khc

  • owner set to grim

Changed 2 years ago by grim

  • owner changed from grim to khc

The patch looks good except that I see no way for a cipher to [gs]et the batch mode. While we're bumping the minor for the enum, we might as well add the accessors and store it in PurpleCipherContext?.

Changed 2 years ago by QuLogic

What I have right now is that the batch mode can be [gs]et with purple_cipher_context_[gs]et_option with the option "batchMode".

Changed 2 years ago by grim

Well since theres a public enum for it, this seems like it'd be another good canidate for padding use.http://developer.pidgin.im/ticket/4380#comment:3

Changed 2 years ago by grim

uh... ignore the link that ended up in there... stupid malfunctioning mouse...

Changed 2 years ago by QuLogic

OK, here's an updated patch that uses purple_cipher_context_[gs]et_batch_mode instead. I also snuck in a couple grammatical fixes that rekkanoryo told me to throw in.

Changed 2 years ago by QuLogic

Adds Triple-DES Cipher to libpurple. Uses the reserved fields for some new accessors.

Changed 2 years ago by grim

This has my blessing, good work!

What should I use for the author on the commit?

Changed 2 years ago by QuLogic

Cool. You can use Elliott Sales de Andrade, it should be in the Authors list already.

Changed 2 years ago by grim

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.