Skip to content

Commit

Permalink
Fix buflen size in sc_pkcs15_compute_signature
Browse files Browse the repository at this point in the history
  • Loading branch information
jozsefd authored and Jakuje committed Nov 19, 2021
1 parent 6afb795 commit 799f178
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libopensc/pkcs15-sec.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ int sc_pkcs15_compute_signature(struct sc_pkcs15_card *p15card,
if (outlen < modlen)
LOG_FUNC_RETURN(ctx, SC_ERROR_BUFFER_TOO_SMALL);

buflen = inlen + 256;
buflen = inlen + modlen;
buf = sc_mem_secure_alloc(buflen);
if (buf == NULL)
LOG_FUNC_RETURN(ctx, SC_ERROR_OUT_OF_MEMORY);
Expand Down

0 comments on commit 799f178

Please sign in to comment.