libopensc: reverse data to sign when signing with the GOST key

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5526 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
vtarasov 2011-05-29 19:23:18 +00:00
parent 2e8df6d226
commit 40cf9a5cca
1 changed files with 7 additions and 0 deletions

View File

@ -253,6 +253,13 @@ int sc_pkcs15_compute_signature(struct sc_pkcs15_card *p15card,
LOG_FUNC_RETURN(ctx, SC_ERROR_BUFFER_TOO_SMALL);
memcpy(buf, in, inlen);
/* revert data to sign when signing with the GOST key.
* TODO: can it be confirmed by the GOST standard?
* TODO: tested with RuTokenECP, has to be validated for RuToken. */
if (obj->type == SC_PKCS15_TYPE_PRKEY_GOSTR3410)
sc_mem_reverse(buf, inlen);
tmp = buf;
/* flags: the requested algo