mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-28 01:27:09 +03:00
oscore: Handle encrypt error return
Check return from cose_encrypt0_encrypt() and correct spelling error.
This commit is contained in:
1 parent
583c52c567
commit
c7cda63092
4 files changed
+12
-6
No files matched your search
@@ -591,6 +591,12 @@ coap_oscore_new_pdu_encrypted(coap_session_t *session,
|
||||
ciphertext_len = cose_encrypt0_encrypt(cose,
|
||||
ciphertext_buffer,
|
||||
plain_pdu->used_size + AES_CCM_TAG);
|
||||
if ((int)ciphertext_len <= 0) {
|
||||
coap_log_warn(
|
||||
"OSCORE: Encryption Failure, result code: %d \n",
|
||||
(int)ciphertext_len);
|
||||
goto error;
|
||||
}
|
||||
assert(ciphertext_len < OSCORE_CRYPTO_BUFFER_SIZE);
|
||||
|
||||
/* Add in OSCORE option (previously computed) */
|
||||
|
||||
Reference in new issue
Block a user