fail case for pkcs12

pull/192/head
Jacob Barthelmeh 2020-03-24 22:08:30 -06:00
parent 81827fac5d
commit 5c45cde3d0
1 changed files with 2 additions and 2 deletions

View File

@ -63,7 +63,7 @@ int main()
/* convert the DER file into an internal structure */
ret = wc_d2i_PKCS12(buffer, bytes, pkcs12);
printf("return value of d2i pkcs12 = %d %s\n", ret, (ret == 1)? "SUCCESS": "FAIL");
if (ret != 1) {
if (ret != 0) {
printf("\t error converting pkcs12 to an internal structure\n");
wc_PKCS12_free(pkcs12);
return -1;
@ -73,7 +73,7 @@ int main()
ret = wc_PKCS12_parse(pkcs12, "wolfSSL test", &keyDer, &keySz,
&certDer, &certSz, &list);
printf("return value of parsing pkcs12 = %d %s\n", ret, (ret == 1)? "SUCCESS": "FAIL");
if (ret != 1 || keyDer == NULL || certDer == NULL) {
if (ret != 0 || keyDer == NULL || certDer == NULL) {
printf("\t error parsing pkcs12\n");
wc_PKCS12_free(pkcs12);
return -1;