mirror of
https://github.com/pumpitupdev/pumptools.git
synced 2026-09-22 22:28:03 +03:00
prinet-proxy: Bugfix handling of decryption data length
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user