wolfSSL / wolfssl

The wolfSSL library is a small, fast, portable implementation of TLS/SSL for embedded devices to the cloud. wolfSSL supports up to TLS 1.3 and DTLS 1.3!
https://www.wolfssl.com
GNU General Public License v2.0
2.36k stars 834 forks source link

Fix missing cast #8191

Closed bandi13 closed 6 days ago

bandi13 commented 6 days ago

Description

Introduced in PR #8176. Shows up in wolfSSL/job/nightly-g++-test-v2/1399/parsed_console/ test.

In file included from tests/api.c:32:
tests/api.c: In function ‘int test_wolfSSL_X509V3_EXT_aia()’:

tests/api.c:76350:47: error: invalid conversion from ‘void*’ to ‘WOLFSSL_AUTHORITY_INFO_ACCESS*’ {aka ‘WOLFSSL_STACK*’} [-fpermissive]
76350 |     ExpectNotNull(aia = wolfSSL_X509V3_EXT_d2i(ext));
      |                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~
      |                                               |
      |                                               void*
./tests/unit.h:182:15: note: in definition of macro ‘Expect’
  182 |         if (!(test))                                                         \
      |               ^~~~
tests/api.c:76350:5: note: in expansion of macro ‘ExpectNotNull’
76350 |     ExpectNotNull(aia = wolfSSL_X509V3_EXT_d2i(ext));
      |     ^~~~~~~~~~~~~

tests/api.c:76370:47: error: invalid conversion from ‘void*’ to ‘WOLFSSL_AUTHORITY_INFO_ACCESS*’ {aka ‘WOLFSSL_STACK*’} [-fpermissive]
76370 |     ExpectNotNull(aia = wolfSSL_X509V3_EXT_d2i(ext));
      |                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~
      |                                               |
      |                                               void*
./tests/unit.h:182:15: note: in definition of macro ‘Expect’
  182 |         if (!(test))                                                         \
      |               ^~~~
tests/api.c:76370:5: note: in expansion of macro ‘ExpectNotNull’
76370 |     ExpectNotNull(aia = wolfSSL_X509V3_EXT_d2i(ext));
      |     ^~~~~~~~~~~~~

Testing

Tested patch on same server which can reproduce it.