Changeset dacb555 for functions.c
- Timestamp:
- Feb 9, 2010, 9:49:41 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- a52eeb1
- Parents:
- d35d2ba
- git-author:
- Anders Kaseorg <andersk@mit.edu> (02/07/10 22:55:21)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (02/09/10 21:49:41)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r2a17b63 rdacb555 406 406 char *cryptmsg; 407 407 owl_message *m; 408 #ifdef OWL_ENABLE_ZCRYPT409 int ret;410 #endif411 408 412 409 /* create the zwrite and send the message */ … … 419 416 mymsg=owl_zwrite_get_message(&z); 420 417 #ifdef OWL_ENABLE_ZCRYPT 421 /* Allocate enough space for the crypted message. For each byte of 422 * the message, the encoded cyphertext will have two bytes. Block 423 * size is 8 bytes of input, or 16 bytes of output, so make sure we 424 * have at least one block worth of space allocated. If the message 425 * is empty, no blocks are sent, but we still allocate one 426 * block. The additional 16 bytes also provide space for the null 427 * terminator, as we will never use all of it for cyphertext. 428 */ 429 cryptmsg=owl_malloc((strlen(mymsg)*2)+16); 430 ret=owl_zcrypt_encrypt(cryptmsg, mymsg, owl_zwrite_get_class(&z), owl_zwrite_get_instance(&z)); 431 if (ret) { 418 cryptmsg = owl_zcrypt_encrypt(mymsg, owl_zwrite_get_class(&z), owl_zwrite_get_instance(&z)); 419 if (!cryptmsg) { 432 420 owl_function_error("Error in zcrypt, possibly no key found. Message not sent."); 433 421 owl_function_beep(); 434 owl_free(cryptmsg);435 422 owl_zwrite_free(&z); 436 423 return;
Note: See TracChangeset
for help on using the changeset viewer.