mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-03 20:46:28 +00:00
Do not crash if key is NULL
This commit is contained in:
parent
bfe175f853
commit
1b74fdadef
1 changed files with 3 additions and 0 deletions
|
|
@ -421,6 +421,8 @@ int lime_encryptFile(void **cryptoContext, unsigned char *key, size_t length, ch
|
|||
int lime_decryptFile(void **cryptoContext, unsigned char *key, size_t length, char *plain, char *cipher) {
|
||||
bctbx_aes_gcm_context_t *gcmContext;
|
||||
|
||||
if (key == NULL) return -1;
|
||||
|
||||
if (*cryptoContext == NULL) { /* first call to the function, allocate a crypto context and initialise it */
|
||||
/* key contains 192bits of key || 64 bits of Initialisation Vector, no additional data */
|
||||
gcmContext = bctbx_aes_gcm_context_new(key, 24, NULL, 0, key+24, 8, BCTBX_GCM_DECRYPT);
|
||||
|
|
@ -895,6 +897,7 @@ int lime_im_encryption_engine_process_downloading_file_cb(LinphoneImEncryptionEn
|
|||
LinphoneContent *content = linphone_chat_message_get_file_transfer_information(msg);
|
||||
if (!content)
|
||||
return -1;
|
||||
|
||||
if (!linphone_content_get_key(content)) {
|
||||
linphone_content_unref(content);
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue