PKCS15: set the PRNG flag on PKCS#15 card object even if it was not set in TokenFlags if RNG capability is reported by the low level card driver.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4045 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
martin 2010-02-20 08:34:40 +00:00
parent 26f1750cd7
commit 30924e4e9d
1 changed files with 4 additions and 0 deletions

View File

@ -756,6 +756,10 @@ int sc_pkcs15_bind(sc_card_t *card,
goto error;
}
done:
/* If card driver states that it has a (P)RNG, overwrite (possibly missing) tokeninfo flags */
if (card->caps & SC_CARD_CAP_RNG)
p15card->flags |= SC_PKCS15_CARD_FLAG_PRN_GENERATION;
/* for cardos cards initialized by Siemens: sign with decrypt */
if (strcmp(p15card->card->driver->short_name,"cardos") == 0
&& scconf_get_bool(conf_block, "enable_sign_with_decrypt_workaround", 1)