Skip to content

Fixed argument passing in SetMPI/GetMPIData#19

Merged
SparkiDev merged 1 commit intowolfSSL:masterfrom
danielinux:mp_int_pointer
Aug 21, 2023
Merged

Fixed argument passing in SetMPI/GetMPIData#19
SparkiDev merged 1 commit intowolfSSL:masterfrom
danielinux:mp_int_pointer

Conversation

@danielinux
Copy link
Member

When compiling with wolfboot, I spotted the following:

lib/wolfPKCS11/src/internal.c: In function 'WP11_Object_SetEcKey':
lib/wolfPKCS11/src/internal.c:4725:26: error: passing argument 1 of 'SetMPI' from incompatible pointer type [-Werror=incompatible-pointer-types]
 4725 |             ret = SetMPI(&key->k, data[1], (int)len[1]);
      |                          ^~~~~~~
      |                          |
      |                          mp_int (*)[1] {aka sp_int (*)[1]}
lib/wolfPKCS11/src/internal.c:4506:27: note: expected 'mp_int *' {aka 'sp_int *'} but argument is of type 'mp_int (*)[1]' {aka 'sp_int (*)[1]'}
 4506 | static int SetMPI(mp_int* mpi, unsigned char* data, int len)
      |                   ~~~~~~~~^~~
lib/wolfPKCS11/src/internal.c: In function 'EcObject_GetAttr':
lib/wolfPKCS11/src/internal.c:5215:34: error: passing argument 1 of 'GetMPIData' from incompatible pointer type [-Werror=incompatible-pointer-types]
 5215 |                 ret = GetMPIData(&object->data.ecKey.k, data, len);
      |                                  ^~~~~~~~~~~~~~~~~~~~~
      |                                  |
      |                                  mp_int (*)[1] {aka sp_int (*)[1]}
lib/wolfPKCS11/src/internal.c:4922:31: note: expected 'mp_int *' {aka 'sp_int *'} but argument is of type 'mp_int (*)[1]' {aka 'sp_int (*)[1]'}
 4922 | static int GetMPIData(mp_int* mpi, byte* data, CK_ULONG* len)
      |                       ~~~~~~~~^~~
cc1: all warnings being treated as errors
make: *** [Makefile:314: lib/wolfPKCS11/src/internal.o] Error 1

@SparkiDev SparkiDev merged commit 877719d into wolfSSL:master Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants