[openssl] OpenSSL_1_1_1-stable update

patrick.steuer at de.ibm.com patrick.steuer at de.ibm.com
Wed Nov 13 17:15:39 UTC 2019


The branch OpenSSL_1_1_1-stable has been updated
       via  1e5565ddc20062f6bc581ed3a7825827833b8a32 (commit)
      from  3c25ac2d2e614c16a8b76e0b863eb761ab436804 (commit)


- Log -----------------------------------------------------------------
commit 1e5565ddc20062f6bc581ed3a7825827833b8a32
Author: Joerg Schmidbauer <jschmidb at de.ibm.com>
Date:   Tue Nov 12 10:26:47 2019 +0100

    chacha_enc.c: fix for EBCDIC platforms
    
    Signed-off-by: Joerg Schmidbauer <jschmidb at de.ibm.com>
    
    Reviewed-by: Patrick Steuer <patrick.steuer at de.ibm.com>
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/10417)
    
    (cherry picked from commit c31950b964a2f3f7b9e6ad98076954178ee1e77d)

-----------------------------------------------------------------------

Summary of changes:
 crypto/chacha/chacha_enc.c | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/crypto/chacha/chacha_enc.c b/crypto/chacha/chacha_enc.c
index afe5b5136a..18251eac08 100644
--- a/crypto/chacha/chacha_enc.c
+++ b/crypto/chacha/chacha_enc.c
@@ -12,6 +12,7 @@
 #include <string.h>
 
 #include "crypto/chacha.h"
+#include "crypto/ctype.h"
 
 typedef unsigned int u32;
 typedef unsigned char u8;
@@ -78,10 +79,18 @@ void ChaCha20_ctr32(unsigned char *out, const unsigned char *inp,
     size_t todo, i;
 
     /* sigma constant "expand 32-byte k" in little-endian encoding */
-    input[0] = ((u32)'e') | ((u32)'x'<<8) | ((u32)'p'<<16) | ((u32)'a'<<24);
-    input[1] = ((u32)'n') | ((u32)'d'<<8) | ((u32)' '<<16) | ((u32)'3'<<24);
-    input[2] = ((u32)'2') | ((u32)'-'<<8) | ((u32)'b'<<16) | ((u32)'y'<<24);
-    input[3] = ((u32)'t') | ((u32)'e'<<8) | ((u32)' '<<16) | ((u32)'k'<<24);
+    input[0] = ((u32)ossl_toascii('e')) | ((u32)ossl_toascii('x') << 8)
+               | ((u32)ossl_toascii('p') << 16)
+               | ((u32)ossl_toascii('a') << 24);
+    input[1] = ((u32)ossl_toascii('n')) | ((u32)ossl_toascii('d') << 8)
+               | ((u32)ossl_toascii(' ') << 16)
+               | ((u32)ossl_toascii('3') << 24);
+    input[2] = ((u32)ossl_toascii('2')) | ((u32)ossl_toascii('-') << 8)
+               | ((u32)ossl_toascii('b') << 16)
+               | ((u32)ossl_toascii('y') << 24);
+    input[3] = ((u32)ossl_toascii('t')) | ((u32)ossl_toascii('e') << 8)
+               | ((u32)ossl_toascii(' ') << 16)
+               | ((u32)ossl_toascii('k') << 24);
 
     input[4] = key[0];
     input[5] = key[1];


More information about the openssl-commits mailing list