prinet-proxy: Bugfix handling of decryption data length

This commit is contained in:
icex2
2021-01-23 23:46:13 +01:00
parent 8747fce0ca
commit 60f61d2de5
2 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ static bool _transform_data_request(const struct pumpnet_prinet_proxy_packet* pa
enc_data_len,
dec_data->bytes);
if (dec_data_len != enc_data_len) {
if (dec_data_len < 0) {
log_error("Decrypting data failed");
return false;
}
+2 -1
View File
@@ -83,7 +83,8 @@ size_t sec_prinet_decrypt(
return -1;
}
return enc_data_len;
// cut off the macbytes at the end of the message
return enc_data_len - crypto_box_MACBYTES;
}
size_t sec_prinet_encrypt(