Fix d2i_ECPKParameters_fp and i2d_ECPKParameters_fp macros
authorNicola Tuveri <nic.tuv@gmail.com>
Wed, 15 Jul 2020 23:02:16 +0000 (02:02 +0300)
committerNicola Tuveri <nic.tuv@gmail.com>
Mon, 30 Aug 2021 12:18:14 +0000 (15:18 +0300)
These functions are part of the public API but we don't have tests
covering their usage.
They are actually implemented as macros and the absence of tests has
caused them to fall out-of-sync with the latest changes to ASN1 related
functions and cause compilation warnings.

This commit fixes the public headers to reflect these changes.

Fixes #12443

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16355)

include/openssl/ec.h

index 8b1abcebb7d7faf2143474f3615635bdc85c4736..f59b4f9288521616988067c9f7061478075a00c0 100644 (file)
@@ -915,10 +915,10 @@ int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);
 #  define i2d_ECPKParameters_bio(bp,x) \
     ASN1_i2d_bio_of(EC_GROUP, i2d_ECPKParameters, bp, x)
 #  define d2i_ECPKParameters_fp(fp,x) \
-    (EC_GROUP *)ASN1_d2i_fp(NULL, (char *(*)())d2i_ECPKParameters, (fp), \
-                            (unsigned char **)(x))
+    (EC_GROUP *)ASN1_d2i_fp(NULL, (d2i_of_void *)d2i_ECPKParameters, (fp), \
+                            (void **)(x))
 #  define i2d_ECPKParameters_fp(fp,x) \
-    ASN1_i2d_fp(i2d_ECPKParameters,(fp), (unsigned char *)(x))
+    ASN1_i2d_fp((i2d_of_void *)i2d_ECPKParameters, (fp), (void *)(x))
 
 #  ifndef OPENSSL_NO_DEPRECATED_3_0
 OSSL_DEPRECATEDIN_3_0 int ECPKParameters_print(BIO *bp, const EC_GROUP *x,