Changes due to API change.

pull/299/head
Anthony Hu 2022-03-02 17:45:26 -05:00
parent 488c018c8f
commit 0b1795e00a
1 changed files with 7 additions and 4 deletions

View File

@ -36,14 +36,16 @@
defined(HAVE_OID_DECODING) && defined(WOLFSSL_CUSTOM_OID) && \
defined(WOLFSSL_CERT_EXT)
static int myCustomExtCallback(const word16* oid, word32 oidSz, int crit,
static int myCustomExtCallback(const byte* oid, word32 oidSz, int crit,
const unsigned char* der, word32 derSz) {
word32 i;
const word16 *out = (word16 *)oid;
printf("Custom Extension found!\n");
printf("(");
for (i = 0; i < oidSz; i ++) {
printf("%d", oid[i]);
for (i = 0; i < oidSz; i += 2) {
printf("%d", *out);
out ++;
if (i < oidSz - 1) {
printf(".");
}
@ -104,7 +106,8 @@ int main(void)
InitDecodedCert(&decodedCert, derBuffer, (word32) bytes, 0);
SetUnknownExtCallback(&decodedCert, myCustomExtCallback);
ret = wc_SetUnknownExtCallback(&decodedCert, myCustomExtCallback);
check_ret("wc_SetUnknownExtCallback", ret);
ret = ParseCert(&decodedCert, CERT_TYPE, NO_VERIFY, NULL);
check_ret("ParseCert", ret);