starcos: fixed key reference for "local" key id

This commit is contained in:
Frank Morgner 2018-02-20 14:45:54 +01:00
parent 1d4f59ea51
commit b05273b01e
1 changed files with 5 additions and 1 deletions

View File

@ -1338,7 +1338,11 @@ static int starcos_set_security_env(sc_card_t *card,
* algorithm / cipher from PKCS#1 padding prefix */
*p++ = 0x84;
*p++ = 0x01;
*p++ = *env->key_ref;
if (env->flags & SC_SEC_ENV_FILE_REF_PRESENT) {
*p++ = *env->key_ref | 0x80;
} else {
*p++ = *env->key_ref;
}
/* algorithm / cipher selector? */
*p++ = 0x89;