Commit Graph

3460 Commits

Author SHA1 Message Date
s 7cf8760f9f Fix: any of these calls
C_CreateObject(hSession, NULL_PTR, 1, NULL_PTR);
C_GetAttributeValue(hSession, hObject, NULL_PTR, 1);
C_SetAttributeValue(hSession, hObject, NULL_PTR, 1);
C_FindObjectsInit(hSession, NULL_PTR, 1);
C_FindObjects(hSession, NULL_PTR, 0, NULL_PTR);
C_FindObjects(hSession, NULL_PTR, 1, NULL_PTR);
C_FindObjects(hSession, NULL_PTR, 1, pulObjectCount);
C_DigestInit(hSession, NULL_PTR);
C_SignInit(hSession, NULL_PTR, hKey);
C_SignRecoverInit(hSession, NULL_PTR, hKey);
C_DecryptInit(hSession, NULL_PTR, hKey);
C_VerifyInit(hSession, NULL_PTR, hKey);
C_GenerateKeyPair(hSession, NULL_PTR, pubKeyTmpl, arraysize(pubKeyTmpl),
prvKeyTmpl, arraysize(prvKeyTmpl), &hPubKey, &hPrvKey);
C_GenerateKeyPair(hSession, pMechanism, pubKeyTmpl,
arraysize(pubKeyTmpl), NULL_PTR, 1, &hPubKey, &hPrvKey);
C_GenerateKeyPair(hSession, pMechanism, NULL_PTR, 1, prvKeyTmpl,
arraysize(prvKeyTmpl), &hPubKey, &hPrvKey);
=>
Segmentation fault

Remark: Allow calls:
C_FindObjectsInit(hSession, NULL_PTR, 0)
C_GenerateKeyPair(hSession, pMechanism, NULL_PTR, 0, NULL_PTR, 0, phPublicKey, phPrivateKey)
C_UnwrapKey(hSession, pMechanism, hUnwrappingKey, pWrappedKey, ulWrappedKeyLen, NULL_PTR, 0, phKey)



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3891 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-10 14:50:32 +00:00
s 1ec5a6b25d fix: return CKR_ARGUMENTS_BAD from C_Login, C_InitPIN, C_SetPIN, if pPin == NULL_PTR and PinLen > 0
PKCS#11:
"To log into a token with a protected authentication path, the pPin parameter to C_Login should be NULL_PTR."
"To initialize the normal user?s PIN on a token with such a protected authentication path, the pPin parameter to C_InitPIN should be NULL_PTR."
"To modify the current user?s PIN on a token with such a protected authentication path, the pOldPin and pNewPin parameters to C_SetPIN should be NULL_PTR."


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3890 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-10 12:34:04 +00:00
s 9dff2deae1 fix: return CKR_USER_NOT_LOGGED_IN (now CKR_GENERAL_ERROR) from C_GenerateKeyPair for the case where there was no call C_Login
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3889 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-09 13:59:03 +00:00
s 781c3c0fff add to changeset 3887
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3888 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-08 18:34:55 +00:00
s 425ec51f78 fix:
CK_MECHANISM gostMech = { CKM_GOSTR3410_KEY_PAIR_GEN, NULL, 0 };
...
C_GenerateKeyPair(hSession, &gostMech, NULL_PTR, 0, NULL_PTR, 0, &hPubKey, &hPrvKey);
-> CKR_OK and Generate RSA Key Pair


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3887 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-08 18:28:22 +00:00
s 22a950cd0d Fix: return CKR_SESSION_READ_ONLY from C_InitPIN, C_SetPIN,
C_CreateObject, C_CopyObject, C_DestroyObject, C_SetAttributeValue,
C_GenerateKey, C_GenerateKeyPair, C_UnwrapKey, C_DeriveKey if session is
read-only.

PKCS#11:
"C_InitPIN can only be called in the 'R/W SO Functions' state."

"C_SetPIN can only be called in the 'R/W Public Session' state, 'R/W SO
Functions' state, or 'R/W User Functions' state. An attempt to call it
from a session in any other state fails with error CKR_SESSION_READ_ONLY."

"Only session objects can be created/destroyed/modified
(C_CreateObject/C_DestroyObject/C_SetAttributeValue) during a read-only
session."


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3886 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-08 14:29:49 +00:00
s 5881b46ac1 PKCS#11: Spec does not allow CKR_OBJECT_HANDLE_INVALID from C_EncryptInit, C_DecryptInit, C_DigestKey, C_SignInit, C_SignRecoverInit, C_VerifyInit, C_VerifyRecoverInit, C_WrapKey, C_DeriveKey, C_UnwrapKey
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3885 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-07 12:50:59 +00:00
viktor.tarasov 5bf000da18 pkcs15-tool: unblock PIN with pinpad
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3884 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 13:11:56 +00:00
viktor.tarasov 193ca76980 pkcs15-tool: change PIN with pinpad
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3883 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 12:51:12 +00:00
viktor.tarasov 44e94c8c94 opensc-explorer: remove debug messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3882 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 11:59:48 +00:00
aj 4730e98da1 Thomas Uhle: Just this morning I realised that there is
a minor mistake in my patch for opensc_info(). For the Sun Studio 12.1
compiler (__SUNPRO_C == 0x5100) and later versions also, it must be
(__SUNPRO_C >> 4) & 0xFF to split the micro and mask the major version
number.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3881 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 11:13:17 +00:00
viktor.tarasov 6ff96b8c66 pinpad support of PIN changing and unlocking
Oberthur and opensc-explorer


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3880 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 11:11:04 +00:00
viktor.tarasov 490e02b349 after Martin's suggestion: for pcsc do not use '0' protocol when detecting readers
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3879 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 10:47:51 +00:00
aj df4bdaf6f7 Update westcos emulation by François Leblanc.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3878 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 07:18:19 +00:00
aj 93a2b39028 Updated westcos driver by François Leblanc
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3877 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 07:10:24 +00:00
aj 073c9da342 Thomas Uhle: modify Makefile so configure finds the include files
of PC/SC lite.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3876 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 07:05:15 +00:00
aj b2c5ab3209 Thomas Uhle: Add information about sun compiler to opensc-tool.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3875 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 07:03:53 +00:00
aj 06aaa718cc Describe now option for --help.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3874 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-02 11:10:16 +00:00
aj 724c3485a6 remove dead code for now - easy to recreate later.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3873 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-02 11:07:45 +00:00
aj 29407cf2d8 fixed and tested by Viktor TARASOV. Thanks!
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3872 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-02 09:52:12 +00:00
aj 5b21dd6a05 basic command to change startkey,
so far untested.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3871 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-01 21:10:06 +00:00
viktor.tarasov b9935bf410 cardos-tool: invalid parsing of the 'common system keys' info
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3870 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-01 11:47:19 +00:00
s e4780e82ec add to pkcs11-tool: GOST mechanisms and GOSTR3410 key to show objects on token
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3869 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-27 11:15:33 +00:00
s d201a1d86d add get CKA_GOSTR3410_PARAMS attribute for GOST private key
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3868 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-27 11:07:23 +00:00
martin f2d6ec2c76 Always print the slot description (reader name in case of OpenSC)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3867 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-25 18:01:30 +00:00
martin 0756990c44 Patch by João Poupino for Portugese eID card.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3866 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-24 13:43:32 +00:00
s 56dd3ec0ea Modification Rutoken S binary interfaces by Aktiv Co. (OpenSC+Rutoken S driver for Windows works now)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3865 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-23 16:38:02 +00:00
viktor.tarasov 505406c3b0 Oberthur: verify PIN with pinpad
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3864 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-23 13:40:05 +00:00
s b372290e72 correct SEC_ATTR_SIZE name (add prefix)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3863 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-23 11:41:23 +00:00
s 05b96a1f5e CKR_USER_ALREADY_LOGGED_IN: It indicates that the specified user cannot be logged into the session, because it is already logged into the session.
CKR_USER_ANOTHER_ALREADY_LOGGED_IN: It indicates that the specified user cannot be logged into the session, because another user is already logged into the session.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3862 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-20 15:23:12 +00:00
s 7cbe5e5470 use generic iso7816_select_file code, remove duplicate code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3861 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-20 13:15:00 +00:00
s 052775325a remove dead code (in compliance with http://www.opensc-project.org/opensc/changeset/3839#file8)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3860 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-20 12:26:04 +00:00
s 5320ca6fd1 Corrected GOSTR3410 public key structure
Working now with GOST R 34.10:
$ pkcs15-init --store-private-key key --key-usage sign,decrypt --auth-id 2 --id 1 --pin "12345678"
$ pkcs15-init --store-certificate my_cert --id 1 --pin "12345678"

But have problem: no CKA_GOSTR3410_PARAMS by retrieve pub_key from certificate, if pub_key object was removed (see parse_x509_cert, asn1_decode_gostr3410_params)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3859 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-19 15:41:03 +00:00
viktor.tarasov 5ba09f087b logs: time stamp with 1msec resolution in unix. Thanks to Ludovic Rousseau.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3858 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-17 13:27:15 +00:00
viktor.tarasov 4f52e7bba8 reader-pcsc::pcsc_transmit() add log message with the reader's name
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3857 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-17 12:12:17 +00:00
viktor.tarasov b41fcbedd9 logs: time stamp; dump_hex() with the static output buffer
- time stamp in the log messages: for Windows 1msec resolution, otherwise 1sec;
- one more dump hex function, to be easily inserted into the formatted message.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3856 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-17 11:11:05 +00:00
martin 11e9cab070 Fix C coding style to please visual studio. By João Poupino.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3855 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-16 21:41:40 +00:00
martin 1444f8db95 Fix windows build
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3854 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-16 20:45:26 +00:00
martin e931fdfd06 Fix C coding style
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3853 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-16 20:35:15 +00:00
alonbl ff8912c600 Remove plugindir as plugin was removed
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3852 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-16 07:32:46 +00:00
martin c5d2618ea3 Estonian eID: fix charset
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3851 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-15 18:08:10 +00:00
martin c398f55373 Allow to turn off CT-API support
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3850 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-15 18:03:04 +00:00
viktor.tarasov a8dc5bdeef opensc-explorer::do_apdu() number of bytes in printed message 'Sending'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3849 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-14 21:55:17 +00:00
martin 2005bc2e92 Move branches/martin/0.12 to trunk
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3848 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 19:28:13 +00:00
martin df20fe72e1 merge [3823:3844/trunk]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3845 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 19:01:21 +00:00
s 64152699b5 remove dead code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3844 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 14:52:25 +00:00
martin 533a33521f * Update opensc-tool and opensc-explorer man pages
* Remove not implemented pksign/pkdecrypt commands from opensc-explorer. Use pkcs15-crypt instead.


git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3843 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 14:51:32 +00:00
s 2fe567e94d add support for GOSTR3410 keys
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3842 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 14:45:33 +00:00
martin 0eac0fb14c Fix #58: properly document "pkcs15-init -T"
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3841 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 12:25:18 +00:00
martin ca0976ba6f Remove signer and related configure elements
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3840 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 11:48:17 +00:00