Skip to content

Commit

Permalink
curl: fix OpenSSL host verification + hostname in certificate CN brok…
Browse files Browse the repository at this point in the history
…en in 7.82.0

Backport upstream fix for:

  curl/curl#8559

Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
  • Loading branch information
armcc committed Apr 20, 2022
1 parent 6b347fd commit 28533d0
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
@@ -0,0 +1,33 @@
From 911714d617c106ed5d553bf003e34ec94ab6a136 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Tue, 8 Mar 2022 13:38:13 +0100
Subject: [PATCH] openssl: fix CN check error code

Due to a missing 'else' this returns error too easily.

Regressed in: d15692ebb

Reported-by: Kristoffer Gleditsch
Fixes #8559
Closes #8560
---
lib/vtls/openssl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c
index 0b79fc50a..4618beeb3 100644
--- a/lib/vtls/openssl.c
+++ b/lib/vtls/openssl.c
@@ -1817,7 +1817,8 @@ CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn,
memcpy(peer_CN, ASN1_STRING_get0_data(tmp), peerlen);
peer_CN[peerlen] = '\0';
}
- result = CURLE_OUT_OF_MEMORY;
+ else
+ result = CURLE_OUT_OF_MEMORY;
}
}
else /* not a UTF8 name */
--
2.24.0

4 changes: 3 additions & 1 deletion meta/recipes-support/curl/curl_7.82.0.bb
Expand Up @@ -9,7 +9,9 @@ SECTION = "console/network"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=190c514872597083303371684954f238"

SRC_URI = "https://curl.se/download/${BP}.tar.xz"
SRC_URI = "https://curl.se/download/${BP}.tar.xz \
file://openssl-fix-CN-check-error-code.patch \
"
SRC_URI[sha256sum] = "0aaa12d7bd04b0966254f2703ce80dd5c38dbbd76af0297d3d690cdce58a583c"

# Curl has used many names over the years...
Expand Down

0 comments on commit 28533d0

Please sign in to comment.