tcpdump/0011-Evp-cipher-buffers.patch

30 lines
1.0 KiB
Diff
Raw Normal View History

2019-09-30 11:18:11 -04:00
diff --git a/print-esp.c b/print-esp.c
2019-12-25 16:08:42 +08:00
index 6fabff1..5818cc8 100644
2019-09-30 11:18:11 -04:00
--- a/print-esp.c
+++ b/print-esp.c
2019-12-25 16:08:42 +08:00
@@ -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");
2019-09-30 11:18:11 -04:00
+ return 0;
2019-12-25 16:08:42 +08:00
}
/*
* 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,
2019-09-30 11:18:11 -04:00
EVP_CIPHER_CTX_free(ctx);
2019-12-25 16:08:42 +08:00
(*ndo->ndo_error)(ndo, "can't allocate memory for decryption buffer");
2019-09-30 11:18:11 -04:00
}
2019-12-25 16:08:42 +08:00
- EVP_Cipher(ctx, output_buffer, input_buffer, len);
2019-09-30 11:18:11 -04:00
+ EVP_Cipher(ctx, output_buffer, input_buffer, buffer_size);
EVP_CIPHER_CTX_free(ctx);
/*
2019-12-25 16:08:42 +08:00
@@ -815,6 +816,7 @@ esp_print(netdissect_options *ndo,
if (input_buffer == NULL) {
2019-09-30 11:18:11 -04:00
EVP_CIPHER_CTX_free(ctx);
2019-12-25 16:08:42 +08:00
(*ndo->ndo_error)(ndo, "can't allocate memory for encrypted data buffer");
+ return 0;
2019-09-30 11:18:11 -04:00
}
/*
2019-12-25 16:08:42 +08:00
* Copy the input data to the encrypted data buffer,