[openssl] master update

tomas at openssl.org tomas at openssl.org
Fri Sep 17 12:49:38 UTC 2021

The branch master has been updated
       via  a7f58bdc1abe245dd09790e8f97d91df271578f4 (commit)
      from  9e51f877930dbd4216438a5da3c9612bf4d0a918 (commit)

- Log -----------------------------------------------------------------
commit a7f58bdc1abe245dd09790e8f97d91df271578f4
Author: Bernd Edlinger <bernd.edlinger at hotmail.de>
Date:   Sun Aug 22 21:28:51 2021 +0200

    Fix the parameter type of gf_serialize
    It is better to use array bounds for improved
    gcc warning checks.
    While "uint8_t*" allows arbitrary pointer arithmetic
    using "uint8_t[SER_BYTES]" limits the pointer arithmetic
    to the range 0..SER_BYTES.
    Reviewed-by: Paul Dale <pauli at openssl.org>
    Reviewed-by: Tomas Mraz <tomas at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/16376)


Summary of changes:
 crypto/ec/curve448/f_generic.c | 2 +-
 crypto/ec/curve448/field.h     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/crypto/ec/curve448/f_generic.c b/crypto/ec/curve448/f_generic.c
index 4c571810d3..7bb7df6b60 100644
--- a/crypto/ec/curve448/f_generic.c
+++ b/crypto/ec/curve448/f_generic.c
@@ -18,7 +18,7 @@ static const gf MODULUS = {
 /* Serialize to wire format. */
-void gf_serialize(uint8_t *serial, const gf x, int with_hibit)
+void gf_serialize(uint8_t serial[SER_BYTES], const gf x, int with_hibit)
     unsigned int j = 0, fill = 0;
     dword_t buffer = 0;
diff --git a/crypto/ec/curve448/field.h b/crypto/ec/curve448/field.h
index e1c6333789..0350322553 100644
--- a/crypto/ec/curve448/field.h
+++ b/crypto/ec/curve448/field.h
@@ -62,7 +62,7 @@ mask_t gf_eq(const gf x, const gf y);
 mask_t gf_lobit(const gf x);
 mask_t gf_hibit(const gf x);
-void gf_serialize(uint8_t *serial, const gf x, int with_highbit);
+void gf_serialize(uint8_t serial[SER_BYTES], const gf x, int with_highbit);
 mask_t gf_deserialize(gf x, const uint8_t serial[SER_BYTES], int with_hibit,
                       uint8_t hi_nmask);

More information about the openssl-commits mailing list