Changeset 54e1fe4 for functions.c
- Timestamp:
- Mar 1, 2010, 8:33:48 PM (13 years ago)
- Branches:
- release-1.5
- Children:
- 8fff19a
- Parents:
- b381b55
- git-author:
- Anders Kaseorg <andersk@mit.edu> (02/07/10 22:55:21)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (03/01/10 20:33:48)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
rcce5dbd r54e1fe4 425 425 char *cryptmsg; 426 426 owl_message *m; 427 #ifdef OWL_ENABLE_ZCRYPT428 int ret;429 #endif430 427 431 428 /* create the zwrite and send the message */ … … 438 435 mymsg=owl_zwrite_get_message(&z); 439 436 #ifdef OWL_ENABLE_ZCRYPT 440 /* Allocate enough space for the crypted message. For each byte of 441 * the message, the encoded cyphertext will have two bytes. Block 442 * size is 8 bytes of input, or 16 bytes of output, so make sure we 443 * have at least one block worth of space allocated. If the message 444 * is empty, no blocks are sent, but we still allocate one 445 * block. The additional 16 bytes also provide space for the null 446 * terminator, as we will never use all of it for cyphertext. 447 */ 448 cryptmsg=owl_malloc((strlen(mymsg)*2)+16); 449 ret=owl_zcrypt_encrypt(cryptmsg, mymsg, owl_zwrite_get_class(&z), owl_zwrite_get_instance(&z)); 450 if (ret) { 437 cryptmsg = owl_zcrypt_encrypt(mymsg, owl_zwrite_get_class(&z), owl_zwrite_get_instance(&z)); 438 if (!cryptmsg) { 451 439 owl_function_error("Error in zcrypt, possibly no key found. Message not sent."); 452 440 owl_function_beep(); 453 owl_free(cryptmsg);454 441 owl_zwrite_free(&z); 455 442 return;
Note: See TracChangeset
for help on using the changeset viewer.