- Whitespace cleanup from me and Martin Paljak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2181 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
df12bfb5b1
commit
df5e357694
|
@ -116,13 +116,12 @@ static int setcos_init(struct sc_card *card)
|
||||||
|
|
||||||
/* Handle unknown or forced cards */
|
/* Handle unknown or forced cards */
|
||||||
if (card->type < 0) {
|
if (card->type < 0) {
|
||||||
|
card->type = SC_CARD_TYPE_SETCOS_GENERIC;
|
||||||
#if 0
|
#if 0
|
||||||
/* Hmm. For now, assume it's a bank card with FinEID application */
|
/* Hmm. For now, assume it's a bank card with FinEID application */
|
||||||
if (match_hist_bytes(card, "AVANT", 0)) {
|
if (match_hist_bytes(card, "AVANT", 0)) {
|
||||||
card->type = SC_CARD_TYPE_SETCOS_FINEID;
|
card->type = SC_CARD_TYPE_SETCOS_FINEID;
|
||||||
} else
|
|
||||||
#endif
|
#endif
|
||||||
card->type = SC_CARD_TYPE_SETCOS_GENERIC;
|
|
||||||
}
|
}
|
||||||
if (card->type == SC_CARD_TYPE_SETCOS_FINEID) {
|
if (card->type == SC_CARD_TYPE_SETCOS_FINEID) {
|
||||||
card->cla = 0x00;
|
card->cla = 0x00;
|
||||||
|
|
|
@ -64,7 +64,6 @@ static int ccid_build_verify_pin_block(u8 * buf, size_t * size, struct sc_pin_cm
|
||||||
|
|
||||||
if (!data->pin1.min_length || !data->pin1.max_length)
|
if (!data->pin1.min_length || !data->pin1.max_length)
|
||||||
return SC_ERROR_INVALID_ARGUMENTS;
|
return SC_ERROR_INVALID_ARGUMENTS;
|
||||||
|
|
||||||
buf[count++] = data->pin1.max_length; /* wPINMaxExtraDigit: max */
|
buf[count++] = data->pin1.max_length; /* wPINMaxExtraDigit: max */
|
||||||
buf[count++] = data->pin1.min_length; /* wPINMaxExtraDigit: min */
|
buf[count++] = data->pin1.min_length; /* wPINMaxExtraDigit: min */
|
||||||
|
|
||||||
|
@ -150,7 +149,7 @@ ccid_pin_cmd(struct sc_reader *reader, sc_slot_info_t * slot,
|
||||||
|
|
||||||
/* The slot must be manually locked, as the control does not pass through card.c
|
/* The slot must be manually locked, as the control does not pass through card.c
|
||||||
* wrappers that lock the card (card_transmit is not OK in this case, as it assumes
|
* wrappers that lock the card (card_transmit is not OK in this case, as it assumes
|
||||||
* a proper APDU as a parameter, not a arbitary binary blob to be sent to the reader)
|
* a proper APDU as a parameter, not an arbitary binary blob to be sent to the reader)
|
||||||
*/
|
*/
|
||||||
r = reader->ops->lock(reader, slot);
|
r = reader->ops->lock(reader, slot);
|
||||||
SC_TEST_RET(reader->ctx, r, "CCID PIN: Could not lock!");
|
SC_TEST_RET(reader->ctx, r, "CCID PIN: Could not lock!");
|
||||||
|
|
|
@ -63,10 +63,8 @@ sc_pkcs15emu_esteid_init (sc_pkcs15_card_t * p15card)
|
||||||
set_string (&p15card->label, "EstEID isikutunnistus");
|
set_string (&p15card->label, "EstEID isikutunnistus");
|
||||||
set_string (&p15card->manufacturer_id, "AS Sertifitseerimiskeskus");
|
set_string (&p15card->manufacturer_id, "AS Sertifitseerimiskeskus");
|
||||||
|
|
||||||
select_esteid_df (card);
|
|
||||||
|
|
||||||
/* read the serial (document number) */
|
/* read the serial (document number) */
|
||||||
sc_format_path ("5044", &tmppath);
|
sc_format_path ("3f00eeee5044", &tmppath);
|
||||||
tmppath.type = SC_PATH_TYPE_PATH;
|
tmppath.type = SC_PATH_TYPE_PATH;
|
||||||
r = sc_select_file (card, &tmppath, NULL);
|
r = sc_select_file (card, &tmppath, NULL);
|
||||||
SC_TEST_RET (card->ctx, r, "select esteid PD failed");
|
SC_TEST_RET (card->ctx, r, "select esteid PD failed");
|
||||||
|
|
|
@ -1568,12 +1568,10 @@ static CK_RV pkcs15_cert_get_attribute(struct sc_pkcs11_session *session,
|
||||||
break;
|
break;
|
||||||
case CKA_SUBJECT:
|
case CKA_SUBJECT:
|
||||||
return asn1_sequence_wrapper(cert->cert_data->subject,
|
return asn1_sequence_wrapper(cert->cert_data->subject,
|
||||||
cert->cert_data->subject_len,
|
cert->cert_data->subject_len, attr);
|
||||||
attr);
|
|
||||||
case CKA_ISSUER:
|
case CKA_ISSUER:
|
||||||
return asn1_sequence_wrapper(cert->cert_data->issuer,
|
return asn1_sequence_wrapper(cert->cert_data->issuer,
|
||||||
cert->cert_data->issuer_len,
|
cert->cert_data->issuer_len, attr);
|
||||||
attr);
|
|
||||||
default:
|
default:
|
||||||
return CKR_ATTRIBUTE_TYPE_INVALID;
|
return CKR_ATTRIBUTE_TYPE_INVALID;
|
||||||
}
|
}
|
||||||
|
@ -1892,8 +1890,7 @@ pkcs15_prkey_decrypt(struct sc_pkcs11_session *ses, void *obj,
|
||||||
}
|
}
|
||||||
|
|
||||||
rv = sc_pkcs15_decipher(fw_data->p15_card, prkey->prv_p15obj,
|
rv = sc_pkcs15_decipher(fw_data->p15_card, prkey->prv_p15obj,
|
||||||
flags,
|
flags, pEncryptedData, ulEncryptedDataLen,
|
||||||
pEncryptedData, ulEncryptedDataLen,
|
|
||||||
decrypted, sizeof(decrypted));
|
decrypted, sizeof(decrypted));
|
||||||
|
|
||||||
/* Do we have to try a re-login and then try to decrypt again? */
|
/* Do we have to try a re-login and then try to decrypt again? */
|
||||||
|
@ -1901,8 +1898,7 @@ pkcs15_prkey_decrypt(struct sc_pkcs11_session *ses, void *obj,
|
||||||
rv = revalidate_pin(data, ses);
|
rv = revalidate_pin(data, ses);
|
||||||
if (rv == 0)
|
if (rv == 0)
|
||||||
rv = sc_pkcs15_decipher(fw_data->p15_card, prkey->prv_p15obj,
|
rv = sc_pkcs15_decipher(fw_data->p15_card, prkey->prv_p15obj,
|
||||||
flags,
|
flags, pEncryptedData, ulEncryptedDataLen,
|
||||||
pEncryptedData, ulEncryptedDataLen,
|
|
||||||
decrypted, sizeof(decrypted));
|
decrypted, sizeof(decrypted));
|
||||||
}
|
}
|
||||||
sc_unlock(ses->slot->card->card);
|
sc_unlock(ses->slot->card->card);
|
||||||
|
@ -2227,7 +2223,6 @@ struct sc_pkcs11_object_ops pkcs15_dobj_ops = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get_attribute helpers
|
* get_attribute helpers
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -392,8 +392,7 @@ static int do_info(int argc, char **argv)
|
||||||
printf("unable to select file: %s\n", sc_strerror(r));
|
printf("unable to select file: %s\n", sc_strerror(r));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
goto usage;
|
goto usage;
|
||||||
|
|
||||||
switch (file->type) {
|
switch (file->type) {
|
||||||
|
|
|
@ -1375,7 +1375,6 @@ show_dobj(CK_SESSION_HANDLE sess, CK_OBJECT_HANDLE obj)
|
||||||
if (getPRIVATE(sess, obj))
|
if (getPRIVATE(sess, obj))
|
||||||
printf(" private");
|
printf(" private");
|
||||||
printf ("\n");
|
printf ("\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in New Issue