]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix warning in gf_serialize
authorJuergen Christ <jchrist@linux.ibm.com>
Thu, 20 May 2021 11:27:43 +0000 (13:27 +0200)
committerTomas Mraz <tomas@openssl.org>
Mon, 24 May 2021 12:39:01 +0000 (14:39 +0200)
Compiling under -Werror fails in gf_serialize:

crypto/ec/curve448/f_generic.c:21:27: error: argument 1 of type 'uint8_t[56]' {aka 'unsigned char[56]'} with mismatched bound [-Werror=array-parameter=]
   21 | void gf_serialize(uint8_t serial[SER_BYTES], const gf x, int with_hibit)
      |                   ~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from crypto/ec/curve448/f_generic.c:12:
crypto/ec/curve448/field.h:65:28: note: previously declared as 'uint8_t *' {aka 'unsigned char *'}
void gf_serialize(uint8_t *serial, const gf x, int with_highbit);
                  ~~~~~~~~~^~~~~~
Changed parameter to pointer to fix this warning.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15376)

crypto/ec/curve448/f_generic.c

index 7e63998a2192d96e5e0a6f4acbbcf2240799ba83..3f4d7c7a9efed0118b3e690f8dde16f31fc93a37 100644 (file)
@@ -18,7 +18,7 @@ static const gf MODULUS = {
 };
 
 /* Serialize to wire format. */
-void gf_serialize(uint8_t serial[SER_BYTES], const gf x, int with_hibit)
+void gf_serialize(uint8_t *serial, const gf x, int with_hibit)
 {
     unsigned int j = 0, fill = 0;
     dword_t buffer = 0;