Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix parallel/test-crypto-getcipherinfo crash
- Loading branch information
1 parent
7c3feb7
commit 84aa6ca
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
patches/boringssl/ensure_name_not_null_in_evp_get_cipherbyname.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Shelley Vohr <shelley.vohr@gmail.com> | ||
Date: Wed, 2 Jun 2021 11:58:18 +0200 | ||
Subject: Ensure name not null in EVP_get_cipherbyname | ||
|
||
This adds a check to EVP_get_cipherbyname which ensures that name | ||
is not null when passed to OPENSSL_strcasecmp, which cannot handle | ||
null values. | ||
|
||
OpenSSL already ensures this in their implementation of | ||
EVP_get_cipherbyname by using OBJ_NAME_get, so this improves parity. | ||
|
||
Upstreamed at https://boringssl-review.googlesource.com/c/boringssl/+/47844. | ||
|
||
diff --git a/crypto/cipher_extra/cipher_extra.c b/crypto/cipher_extra/cipher_extra.c | ||
index e771ed6589b4579cc35300d5b2a1b68d92e444f5..8205e121c152fe4e2d8df34a1ac2fe0498381f31 100644 | ||
--- a/crypto/cipher_extra/cipher_extra.c | ||
+++ b/crypto/cipher_extra/cipher_extra.c | ||
@@ -89,6 +89,10 @@ const EVP_CIPHER *EVP_get_cipherbynid(int nid) { | ||
} | ||
|
||
const EVP_CIPHER *EVP_get_cipherbyname(const char *name) { | ||
+ if (name == NULL) { | ||
+ return NULL; | ||
+ } | ||
+ | ||
if (OPENSSL_strcasecmp(name, "rc4") == 0) { | ||
return EVP_rc4(); | ||
} else if (OPENSSL_strcasecmp(name, "des-cbc") == 0) { |