Skip to content

Commit 8aea08f

Browse files
committed
Return 0 from csr_w_ed25519_example and rsa-public-decrypt-app
1 parent 166e6c4 commit 8aea08f

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

certgen/csr_w_ed25519_example.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ int main(void)
121121
}
122122
printf("%s", pem);
123123

124+
/* wc_DerToPem returns a length, so only a negative value is an error */
125+
if (ret > 0)
126+
ret = 0;
127+
124128
exit:
125129
wc_ForceZero(der, sizeof(der));
126130
wc_ForceZero(pem, sizeof(pem));

pk/enc-through-sign-rsa/rsa-public-decrypt-app.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ int main(void)
9191
check_ret(ret, "wc_RsaSSL_Verify");
9292
printf("Here is the recovered AES KEY!\n%s\n", plain);
9393

94+
/* wc_RsaSSL_Verify returns the recovered length, so only a negative value
95+
* is an error */
96+
if (ret > 0)
97+
ret = 0;
98+
9499
return ret;
95100
}
96101

0 commit comments

Comments
 (0)