Commit Graph

5374 Commits

Author SHA1 Message Date
Viktor Tarasov b928e814e5 build: bootstrap can be used with options
'branch', 'revision' and 'suffix'
2013-12-29 22:00:29 +01:00
Viktor Tarasov 1d45eea907 md: implement 'CardChangeAuthenticator' 2013-12-29 22:00:29 +01:00
Viktor Tarasov f72c6fe625 md: implement CardUnblockPin 2013-12-29 22:00:28 +01:00
Viktor Tarasov 1dc5a26a8d md: implement CardGetChallenge 2013-12-29 22:00:28 +01:00
Viktor Tarasov 5564b9973b md: when PIN blocked ensure that 0 returned as "tries left" 2013-12-29 22:00:28 +01:00
Viktor Tarasov 89523a99ce md: use "ignore PIN length" configuration option
With this option in 'true' the short PINs will not be ignored by
pkcs#15 framework and applied to card
2013-12-29 22:00:28 +01:00
Viktor Tarasov 15f694f85d pkcs11: introduce 'ignore-pin-length' config option
When doing C_Login default behavior is to ignore the applied PINs with lengths less
then value of PKCS#15 PIN attribure 'min-length'. Such a PINs are not
really verified by card.

With 'ignore-pin-length' option in 'true' all applied PINs are verified by card.
2013-12-29 22:00:28 +01:00
Viktor Tarasov 0761a5ea02 pkcs11: use 'ignore-pin-length' config option
When doing C_Login default behavior is to ignore the applied PINs with lengths less
then value of PKCS#15 PIN attribure 'min-length'. Such a PINs are not
really verified by card.

With 'ignore-pin-length' option in 'true' all applied PINs are verified by card.
2013-12-29 22:00:28 +01:00
Viktor Tarasov b1a5ebfac7 pkcs15init: introduce 'max-unblocks' PIN init parameter 2013-12-29 22:00:28 +01:00
Viktor Tarasov 784f0b8227 pkcs15init: refactoring -- do not use temporary variable 2013-12-29 22:00:28 +01:00
Viktor Tarasov 687fdf2a60 pkcs11-tool: more token flags to display 2013-12-29 22:00:28 +01:00
Viktor Tarasov 77bed45283 pkcs11: implement generic 'init-token' procedure 2013-12-29 22:00:28 +01:00
Viktor Tarasov 161c83ff8b pkcs11: allow bind of non-recognized cards
To prepare C_InitToken of the non-initialized cards
allow bind of the non-recognized card
2013-12-29 22:00:28 +01:00
Viktor Tarasov 98333e56df pkcs11: excessif check of return value
tiny coding style fix
2013-12-29 22:00:28 +01:00
Viktor Tarasov 01ed00dd66 pkcs15init: warning unused variable 2013-12-29 22:00:28 +01:00
Viktor Tarasov 4d5b80fd3f libopensc: general usage method to allocate generalized time 2013-12-29 22:00:12 +01:00
Viktor Tarasov 13d1b8e9f2 pkcs15init: file 'content' and 'prop-attrs' in the card profile
Now it's possible to describe in the card profile
the 'prop-attr' and 'encoded-content' data of the file to create
2013-12-29 20:05:35 +01:00
Viktor Tarasov 51262f00ac pkcs15init: in profile more AC operations are parsed, ...
new AC-OP 'pin-use'
2013-12-29 20:05:35 +01:00
Viktor Tarasov 024cd3b96a pkcs15init: more of the debug messages and macros 2013-12-29 20:05:35 +01:00
Viktor Tarasov 075ff22890 md: generic procedure to get bool config option 2013-12-29 20:05:35 +01:00
Viktor Tarasov aaa4489b7f md: configuration options to refuse create-container mechanism
used rather for the debug -- allows to refuse, for example,
'key-import' create container mechanism and to compel the application (IE)
to generate key on card (rather then generate key by soft and then import it onto card).
2013-12-29 20:05:35 +01:00
Viktor Tarasov f7a9ac90e8 md: config option 'use GUID as crypto object's label' 2013-12-29 20:05:35 +01:00
Viktor Tarasov f71e241f03 md: config option 'GUID as ID'
allows to set the container's GUID value as ID of the key and certificate PKCS#15 objects.
2013-12-29 20:05:35 +01:00
Viktor Tarasov 692791e8ed md: set length of container GUID 2013-12-29 20:05:35 +01:00
Viktor Tarasov 9251d35635 pkcs15init: set key_info->guid value before calling card specific handlers 2013-12-29 20:04:03 +01:00
Viktor Tarasov 7853d67c12 pkcs15init: no const values in private key create/generate data 2013-12-29 19:47:45 +01:00
Viktor Tarasov 0dc39c1125 pkcs15: use value/length pair to hold the object's GUID
GUID can be presented by non-printable string
2013-12-29 19:47:42 +01:00
Viktor Tarasov 98325ab7f2 pkcs15: export 'sc_pkcs15_serialize_guid' ...
change name of exported 'sc_pkcs15_get_guid' to 'sc_pkcs15_get_object_guid' ;
add more 'CALLED' and 'RETURN' macros ;
2013-12-29 19:46:56 +01:00
Viktor Tarasov d7285843f6 pkcs11 framework: more debug logs in 'login' handler 2013-12-29 19:46:56 +01:00
Viktor Tarasov 95b6b4ccd3 pkcs11: changes in framework API
to prepare future enhancements and in the sake of uniformity
in 'struct sc_pkcs11_framework_ops'
the 'struct sc_pkcs11_card' argument of 'init_token' handler is changed for 'struct sc_pkcs11_slot'

coding style issues
2013-12-29 19:46:56 +01:00
Viktor Tarasov f43a9fa41c pkcs11: fix translation of SC error to PKCS11
SC error SC_ERROR_WRONG_CARD and SC_ERROR_NO_CARD_SUPPORT are translated as CKR_TOKEN_NOT_RECOGNIZED
2013-12-29 19:46:56 +01:00
Viktor Tarasov 9fdd9ecaeb pkcs11: PIN-NOT-INITIALIZED error concerns only User PIN
C_Login returns CKR_USER_PIN_NOT_INITIALIZED error when token info flags do not
contains CKF_USER_PIN_INITIALIZED and CKU_USER login type is asked.

This flag is not consulted when CKU_SO or CKU_CONTEXT_SPECIFIC login type is needed
2013-12-29 19:46:56 +01:00
Viktor Tarasov efdab893a7 pkcs15init: NULL pointer dereference error 2013-12-29 19:46:56 +01:00
Viktor Tarasov 7a03f1883b libopensc: create and export 'sc_match_atr_block' 2013-12-29 19:46:56 +01:00
Viktor Tarasov 1fe9ba1b2f opensc-explorer: if available, print DF name 2013-12-29 19:46:56 +01:00
Viktor Tarasov 3140c6c43b md: use, if available, internal cardcf data 2013-12-29 19:46:56 +01:00
Viktor Tarasov 40570143b9 pkcs15: include MD data into sc_pkcs15 data type
New data are used to support the card specific minidriver on-card files.
Beeing included into internal pkcs15 data type,
these new data are accessible at the all frameworks: emulation of pkcs15 and pkcs15init, minidriver.
2013-12-29 19:46:56 +01:00
Viktor Tarasov 411cbfb403 md: use if available the GUID from the prkey info ...
the proprietary on-card data can contain the GUIDs created by proprietary MW,
these data are parsed by card driver and put into the internal pkcs15 private key data
to be accesible in the different OpenSC frameworks
2013-12-29 19:46:56 +01:00
Viktor Tarasov e855ac800e pkcs15: introduce 'cmap-record' data into the private key info
existing  'guid' obejct's data replaced by the one in private-key info
New CMAP record data used by pkcs15init emulator for the cards that have
the MD specific on-card data
2013-12-29 19:46:30 +01:00
Viktor Tarasov 7948a5c83e pkcs15: remove unused macros "SC_PKCS15_KEY_USAGE_*" 2013-12-29 17:38:52 +01:00
Viktor Tarasov 00faad3af6 pkcs15: in 'pkcs15_object' data: new attr. 'md_flags'
also change name of 'guid' attribute for 'md_guid'
These attributes are used to parse and generate the minidriver CMAP records
2013-12-29 17:38:52 +01:00
Viktor Tarasov db9e4c9039 build: suppress warning 'unused-parameter' 2013-12-29 17:38:44 +01:00
Viktor Tarasov 04fbf6ad08 pkcs15init: externalize and change name of select_intrinsic_id() 2013-12-29 17:33:36 +01:00
Viktor Tarasov 6a389f3c4b pkcs15init: reselect file to delete 2013-12-29 14:05:23 +01:00
Viktor Tarasov cb6955c0a7 pkcs15init: keep certificate's blob in cert. info data
always do it, not only when creating a new 'direct' certificate
2013-12-29 14:05:23 +01:00
Martin Paljak 91e3988ef0 macosx: fix typo in distribution descriptor 2013-12-18 10:40:59 +00:00
Martin Paljak d4a3edac08 macosx: update package building to modern tools
PackageMaker has been deprecated since Xcode 4.6.
pkgbuild and productbuild have been available since 10.6.6
2013-12-18 09:49:44 +00:00
Martin Paljak cfe0e7368d macosx: silence the deprecation warnings about OpenSSL 2013-12-11 10:41:19 +00:00
Doug Engert dff25190d2 Merge pull request #197 from CardContact/master
Changing EC Public Key format in PuKDF from raw to spki
2013-12-09 13:15:51 -08:00
Andreas Schwier d4be8ec747 sc_pkcs15_encode_pubkey_as_spki replaces sc_pkcs15_encode_pubkey_with_param.
The name implies what the format of the returned value, a SPKI.

The support for spki as a pkcs15 format of a pubkey, is extended to
work for any algorithm not just EC pubkeys. PKCS#15 appears to allow this.

sc_pkcs15_decode_pubkey_with_param will look for a SPKI
and attempt to use it for any algorithm, including RSA.
(RSA is the null case, as there are no algorithm parameters.)

sc_pkcs15_encode_pubkey_as_spki is exported from libopensc.

pkcs15-piv.c will use sc_pkcs15_encode_pubkey_as_spki to load public keys
as SPKI for RSA and EC.

The pubkey->data is never a SPKI, it is the DER encoding of the
pubkey without the parameters.  If an spki is needed, use the
sc_pkcs15_encode_pubkey_as_spki to get the DER encoding of the spki.

As in the previous set of patches, pkcs15-tool.c will output both
sc_pkcs15_decode_pubkey_with_param and its internal.
This was left for testing, and the pubkey_pem_encode should be deleted
2013-12-06 09:23:57 +01:00