Removed unnecessary spaces from framework-pkc15.c as requested.

pkcs15: added explicit comparison when checking return value of sc_compare_oid() to make the logic more obvious.
This commit is contained in:
Hannu Honkanen 2018-11-14 09:39:03 +02:00 committed by Frank Morgner
parent 7f91b6e07f
commit aa8f666f46
2 changed files with 8 additions and 8 deletions

View File

@ -2587,7 +2587,7 @@ sc_pkcs15_get_specific_supported_algo(struct sc_pkcs15_card *p15card, unsigned o
for (ii=0;ii<SC_MAX_SUPPORTED_ALGORITHMS && p15card->tokeninfo->supported_algos[ii].reference; ii++)
if ((p15card->tokeninfo->supported_algos[ii].operations & operation)
&& (p15card->tokeninfo->supported_algos[ii].mechanism == mechanism)
&& sc_compare_oid(algo_oid, &p15card->tokeninfo->supported_algos[ii].algo_id))
&& sc_compare_oid(algo_oid, &p15card->tokeninfo->supported_algos[ii].algo_id) == 1)
break;
if (ii < SC_MAX_SUPPORTED_ALGORITHMS && p15card->tokeninfo->supported_algos[ii].reference) {

View File

@ -565,8 +565,8 @@ CK_RV C_GetTokenInfo(CK_SLOT_ID slotID, CK_TOKEN_INFO_PTR pInfo)
slot->token_info.flags &= ~(CKF_USER_PIN_COUNT_LOW|CKF_USER_PIN_FINAL_TRY|CKF_USER_PIN_LOCKED);
auth = slot_data_auth(slot->fw_data);
sc_log(context,
"C_GetTokenInfo() auth. object %p, token-info flags 0x%lX", auth,
slot->token_info.flags);
"C_GetTokenInfo() auth. object %p, token-info flags 0x%lX", auth,
slot->token_info.flags);
if (auth) {
pin_info = (struct sc_pkcs15_auth_info*) auth->data;
@ -1980,7 +1980,7 @@ pkcs15_init_pin(struct sc_pkcs11_slot *slot, CK_CHAR_PTR pPin, CK_ULONG ulPinLen
}
sc_log(context, "Init PIN: pin %p:%lu; unblock style %i", pPin,
ulPinLen, sc_pkcs11_conf.pin_unblock_style);
ulPinLen, sc_pkcs11_conf.pin_unblock_style);
fw_data = (struct pkcs15_fw_data *) p11card->fws_data[slot->fw_data_idx];
if (!fw_data)
@ -2782,8 +2782,8 @@ get_X509_usage_privk(CK_ATTRIBUTE_PTR pTempl, CK_ULONG ulCount, unsigned long *x
*x509_usage |= SC_PKCS15INIT_X509_NON_REPUDIATION;
if (typ == CKA_VERIFY || typ == CKA_WRAP || typ == CKA_ENCRYPT) {
sc_log(context,
"get_X509_usage_privk(): invalid typ = 0x%0lx",
typ);
"get_X509_usage_privk(): invalid typ = 0x%0lx",
typ);
return CKR_ATTRIBUTE_TYPE_INVALID;
}
}
@ -2810,8 +2810,8 @@ get_X509_usage_pubk(CK_ATTRIBUTE_PTR pTempl, CK_ULONG ulCount, unsigned long *x5
*x509_usage |= SC_PKCS15INIT_X509_KEY_AGREEMENT;
if (typ == CKA_SIGN || typ == CKA_UNWRAP || typ == CKA_DECRYPT) {
sc_log(context,
"get_X509_usage_pubk(): invalid typ = 0x%0lx",
typ);
"get_X509_usage_pubk(): invalid typ = 0x%0lx",
typ);
return CKR_ATTRIBUTE_TYPE_INVALID;
}
}