aboutsummaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-connectivity/mbedtls/mbedtls/fix-incorrect-EOF-check-in-ssl_context_info.patch
diff options
context:
space:
mode:
authorAlexander Vickberg <wickbergster@gmail.com>2020-12-09 16:44:38 +0100
committerKhem Raj <raj.khem@gmail.com>2020-12-09 10:14:57 -0800
commit6f1139a717cf5da3b68f0bf7b0bccc40ba65da43 (patch)
tree9d4f6d23479cfb7243168cd9c82db81d6e3dcb04 /meta-networking/recipes-connectivity/mbedtls/mbedtls/fix-incorrect-EOF-check-in-ssl_context_info.patch
parentfa8cbd8817f4d780e8af3da43b7858491542e97d (diff)
downloadmeta-openembedded-contrib-6f1139a717cf5da3b68f0bf7b0bccc40ba65da43.tar.gz
mbedtls: upgrade to 2.24.0
Download archives are no longer updated so fetch from Github. Add build fix from upstream. The file LICENSE now contains the full Apache 2.0 license text. Signed-off-by: Alexander Vickberg <wickbergster@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-connectivity/mbedtls/mbedtls/fix-incorrect-EOF-check-in-ssl_context_info.patch')
-rw-r--r--meta-networking/recipes-connectivity/mbedtls/mbedtls/fix-incorrect-EOF-check-in-ssl_context_info.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/mbedtls/mbedtls/fix-incorrect-EOF-check-in-ssl_context_info.patch b/meta-networking/recipes-connectivity/mbedtls/mbedtls/fix-incorrect-EOF-check-in-ssl_context_info.patch
new file mode 100644
index 0000000000..836fce91e6
--- /dev/null
+++ b/meta-networking/recipes-connectivity/mbedtls/mbedtls/fix-incorrect-EOF-check-in-ssl_context_info.patch
@@ -0,0 +1,57 @@
+From d696e7d91e42a190d06760279d2e396392143454 Mon Sep 17 00:00:00 2001
+From: Nayna Jain <nayna@linux.ibm.com>
+Date: Thu, 13 Aug 2020 19:17:53 +0000
+Subject: [PATCH] programs/ssl: Fix incorrect EOF check in ssl_context_info.c
+
+In `read_next_b64_code()`, the result of fgetc() is stored into a char,
+but later compared against EOF, which is generally -1. On platforms
+where char is unsigned, this generates a compiler warning/error that the
+comparison will never be true (causing a build failure). The value will
+never match, with the function ultimately bailing with a "Too many bad
+symbols are detected" error.
+
+On platforms with signed char, EOF is detected, but a file containing a
+0xFF character will causes a premature end of file exit of the loop.
+
+Fix this by changing the result to an int.
+
+Fixes #3794.
+
+Signed-off-by: Nayna Jain <nayna@linux.ibm.com>
+Signed-off-by: David Brown <david.brown@linaro.org>
+---
+ ChangeLog.d/bugfix_3794.txt | 4 ++++
+ programs/ssl/ssl_context_info.c | 4 ++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+ create mode 100644 ChangeLog.d/bugfix_3794.txt
+
+diff --git a/ChangeLog.d/bugfix_3794.txt b/ChangeLog.d/bugfix_3794.txt
+new file mode 100644
+index 0000000000..a483ea76ae
+--- /dev/null
++++ b/ChangeLog.d/bugfix_3794.txt
+@@ -0,0 +1,4 @@
++Bugfix
++ * Fix handling of EOF against 0xff bytes and on platforms with
++ unsigned chars. Fixes a build failure on platforms where char is
++ unsigned. Fixes #3794.
+diff --git a/programs/ssl/ssl_context_info.c b/programs/ssl/ssl_context_info.c
+index df8819a804..d109c1e6f7 100644
+--- a/programs/ssl/ssl_context_info.c
++++ b/programs/ssl/ssl_context_info.c
+@@ -377,13 +377,13 @@ size_t read_next_b64_code( uint8_t **b64, size_t *max_len )
+ int valid_balance = 0; /* balance between valid and invalid characters */
+ size_t len = 0;
+ char pad = 0;
+- char c = 0;
++ int c = 0;
+
+ while( EOF != c )
+ {
+ char c_valid = 0;
+
+- c = (char) fgetc( b64_file );
++ c = fgetc( b64_file );
+
+ if( pad > 0 )
+ {