tcpdump/0011-Evp-cipher-buffers.patch
Troy Dawson 003dfc75b3 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/tcpdump#c826254321bd487875f65880797171e3efa441ab
2020-10-15 10:25:35 -07:00

30 lines
1.0 KiB
Diff

diff --git a/print-esp.c b/print-esp.c
index 6fabff1..5818cc8 100644
--- a/print-esp.c
+++ b/print-esp.c
@@ -242,6 +242,7 @@ int esp_print_decrypt_buffer_by_ikev2(netdissect_options *ndo,
if (input_buffer == NULL) {
EVP_CIPHER_CTX_free(ctx);
(*ndo->ndo_error)(ndo, "can't allocate memory for encrypted data buffer");
+ return 0;
}
/*
* Copy the input data to the encrypted data buffer, and pad it
@@ -259,7 +260,7 @@ int esp_print_decrypt_buffer_by_ikev2(netdissect_options *ndo,
EVP_CIPHER_CTX_free(ctx);
(*ndo->ndo_error)(ndo, "can't allocate memory for decryption buffer");
}
- EVP_Cipher(ctx, output_buffer, input_buffer, len);
+ EVP_Cipher(ctx, output_buffer, input_buffer, buffer_size);
EVP_CIPHER_CTX_free(ctx);
/*
@@ -815,6 +816,7 @@ esp_print(netdissect_options *ndo,
if (input_buffer == NULL) {
EVP_CIPHER_CTX_free(ctx);
(*ndo->ndo_error)(ndo, "can't allocate memory for encrypted data buffer");
+ return 0;
}
/*
* Copy the input data to the encrypted data buffer,