Cleansing all the temporary data for s390x
authorDmitry Belyavskiy <beldmit@gmail.com>
Wed, 12 Jan 2022 15:54:45 +0000 (16:54 +0100)
committerDmitry Belyavskiy <beldmit@gmail.com>
Thu, 13 Jan 2022 17:23:01 +0000 (18:23 +0100)
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17486)

(cherry picked from commit 79c7acc59bb98c2b8451b048ed1dd8cc517df76e)

crypto/ec/ecp_s390x_nistp.c

index 5c70b2d67840c22a455418a11ed37ecfccb5b7c5..c5726c638bddf20ecc531168833ba4a8b5075990 100644 (file)
@@ -116,7 +116,7 @@ ret:
     /* Otherwise use default. */
     if (rc == -1)
         rc = ossl_ec_wNAF_mul(group, r, scalar, num, points, scalars, ctx);
-    OPENSSL_cleanse(param + S390X_OFF_SCALAR(len), len);
+    OPENSSL_cleanse(param, sizeof(param));
     BN_CTX_end(ctx);
     BN_CTX_free(new_ctx);
     return rc;
@@ -212,7 +212,7 @@ static ECDSA_SIG *ecdsa_s390x_nistp_sign_sig(const unsigned char *dgst,
 
     ok = 1;
 ret:
-    OPENSSL_cleanse(param + S390X_OFF_K(len), 2 * len);
+    OPENSSL_cleanse(param, sizeof(param));
     if (ok != 1) {
         ECDSA_SIG_free(sig);
         sig = NULL;