Fixing bug in wc_ecc_sig_size not handling error code

This commit is contained in:
Nickolas Lapp
2015-06-08 14:40:15 -06:00
parent 067f11ff34
commit 9f8862888e

View File

@@ -2705,7 +2705,7 @@ int wc_ecc_size(ecc_key* key)
int wc_ecc_sig_size(ecc_key* key) int wc_ecc_sig_size(ecc_key* key)
{ {
int sz = wc_ecc_size(key); int sz = wc_ecc_size(key);
if (sz < 0) if (sz <= 0)
return sz; return sz;
return sz * 2 + SIG_HEADER_SZ + 4; /* (4) worst case estimate */ return sz * 2 + SIG_HEADER_SZ + 4; /* (4) worst case estimate */