Commit Graph

768 Commits

Author SHA1 Message Date
alonbl a6f9f023a0 [WINDOWS] Remove tool specific file description support resource file
The implementation was based on the previous MSC build, each tool had its own
description in version resource.

This change sets a single version resource to all files, and produces much
simpler build.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3980 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 14:50:42 +00:00
aj 4b2fe63ac2 build only one shared library instead of many.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3971 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-01 15:12:53 +00:00
viktor.tarasov 9eebe0e1a5 pkcs11: by default do not create slot for the User PUK (thanks to Andreas)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3957 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-28 14:15:13 +00:00
viktor.tarasov 55f7f02e18 remove debug message
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3955 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-28 12:42:19 +00:00
viktor.tarasov 031bfc7a07 pkcs11: parametrize disabling of the slot for PUK
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3953 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-28 12:14:48 +00:00
viktor.tarasov ae046cc460 pkcs11: do not create slot for PUK
Ignore PUK for the 'normal' pkcs11 also, not only for 'one-pin-pkcs11'.




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3952 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-28 08:28:25 +00:00
s 33228c7cbc cleanup and correct style
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3945 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-27 16:04:19 +00:00
s 723bcc41ff fix: use of uninitialised value - return parameter (phObject) from C_CreateObject and C_GenerateKeyPair
(In function 'pkcs15_add_object': warning: unused parameter 'pHandle')

Example (C_CreateObject):
Breakpoint 3, C_CreateObject (hSession=134587040, pTemplate=0x8049160, ulCount=5, phObject=0xbff55560)
    at pkcs11-object.c:57
57              rv = sc_pkcs11_lock();
(gdb) x/x phObject
0xbff55560:     0xffffffff
(gdb) finish
0xb7f5c6c0 17:15:09.969 [opensc-pkcs11] framework-pkcs15.c:657:pkcs15_add_object: Setting object handle of 0x0 to 0x805ab80
Run till exit from #0  C_CreateObject (hSession=134587040, pTemplate=0x8049160, ulCount=5,
    phObject=0xbff55560) at pkcs11-object.c:57
0x080487a4 in main ()
Value returned is $1 = 0
(gdb) x/x 0xbff55560
0xbff55560:     0xffffffff
(gdb) c
Continuing.

Breakpoint 4, C_DestroyObject (hSession=134587040, hObject=4294967295) at pkcs11-object.c:106
106             rv = sc_pkcs11_lock();
(gdb) p/x hObject
$2 = 0xffffffff
(gdb) finish
Run till exit from #0  C_DestroyObject (hSession=134587040, hObject=4294967295) at pkcs11-object.c:106
0xb7f5c6c0 17:15:56.581 [opensc-pkcs11] pkcs11-object.c:110:C_DestroyObject: C_DestroyObject(hSession=0x805a2a0, hObject=0xffffffff)
0x080487cb in main ()
Value returned is $3 = 130



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3944 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-27 14:50:35 +00:00
s 66f9ccaa94 fix SIGSEGV:
$ pkcs11-tool --slot 5 --login --pin "12345678" --label 1 --type data --private --write-object tmp.txt
Generated Data Object:
Data object 0
...
$ pkcs11-tool --slot 5 -O --login --pin "12345678"
Data object 135436368
  label:          '1'
  application:    '1'
  app_id:         -1
  flags:           modifiable private
...
(gdb) run
Starting program: /usr/local/bin/pkcs11-tool --slot 5 --login --pin "12345678" --label 1 --type data --delete-object

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210333504 (LWP 7193)]
0xb7cc8181 in slot_token_removed (id=5) at slot.c:319
319                     if (object->ops->release)
(gdb) bt
#0  0xb7cc8181 in slot_token_removed (id=5) at slot.c:319
#1  0xb7cc82dd in card_removed (reader=0x811bdf0) at slot.c:132
#2  0xb7cc43e7 in C_Finalize (pReserved=0x0) at pkcs11-global.c:298
#3  0x08050fc0 in main (argc=11, argv=0xbf98d6f4) at pkcs11-tool.c:677


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3943 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-27 12:22:50 +00:00
martin 0244baa494 pkcs11:
- slots, sessions and objects are kept as lists.
  - change the way slots, cards and readers are managed.
  - re-implement C_WaitForSlotEvent(/C_Finalize) as written in PCKS#11 v2.20, canceling pending blocking calls.
  - implement a "virtual hotplug slot" with a floating slot id to keep NSS working with C_WaitForSlotEvent with a new reader.
    NSS does not call C_GetSlotList(NULL) to re-fetch the list of available slots if C_WaitForSlotEvent returns an event in an already known slot ID.
    By changing the ID of a slot whenever a reader attached  NSS/Firefox can be tricked into recognizing new readers when waiting for events with C_WaitForSlotEvent.
  - change (possibly break something) sc_to_cryptoki_error() to not have side-effects
  - Implement CKU_CONTEXT_SPECIFIC in C_Login to implement CKA_ALWAYS_AUTHENTICATE (keys with user consent) 
 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3935 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-24 20:45:02 +00:00
martin cd9e666926 SC_ERROR_MEMORY_FAILURE signals EEPROM failures on card. Failures to allocate memory on host result in SC_ERROR_OUT_OF_MEMORY.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3927 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-24 12:38:34 +00:00
martin 612d66655d Introduce SC_ERROR_NOT_ENOUGH_MEMORY <=> CKR_DEVICE_MEMORY.
When trying to import a too large keyfile as a data object, TrueCrypt received a CKR_GENERAL_ERROR before this.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3926 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-23 19:12:52 +00:00
martin d43ea3f065 Remove strange characters.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3905 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-10 21:58:48 +00:00
viktor.tarasov e2dae6b97b Unlock User PIN with PKCS#11:
One of the three unblock methods can be activated from the 'opensc-pkcs11' section of opensc.conf:
- C_SetPin() in the unlogged sesssion;
- C_SetPin() in the CKU_SPECIFIC_CONTEXT session;
- C_InitPin() in CKU_SO session (inspired by Pierre Ossman).
-- This last one works, for a while, only for the pkcs15 cards without SOPIN auth object.
   For the pkcs15 cards with SOPIN, this method will be useful for the cards 
   that do not have then modes '00' and '01' of ISO command 'RESET RETRY COUNTER'.

Test commands:
# pkcs11-tool --module ./opensc-pkcs11.so --slot 0 --unlock-pin --puk "123456" --new-pin "9999"
# pkcs11-tool --module ./opensc-pkcs11.so --slot 0 --unlock-pin -l --login-type context-specific --puk "123456" --new-pin "9999"
# pkcs11-tool --module ./opensc-pkcs11.so --slot 0 --init-pin -l --new-pin "9999"



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3901 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-08 15:41:07 +00:00
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 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
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
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 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
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
martin 84de38855f Fix a compiler warning
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3838 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 11:23:16 +00:00
martin 48924f3222 Remove unused variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3832 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 11:14:10 +00:00
martin 3ea5bb7987 Merge [3804:3822/trunk]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3824 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 09:45:21 +00:00
martin 450e1fc5ae Merge [3794:3803/trunk]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3804 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-05 18:27:56 +00:00
martin 30ab50600b Merged [3783:3794/trunk]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3795 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-25 20:22:11 +00:00
martin 56fb57603b Merge [3758:3783/trunk]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3785 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-22 09:18:16 +00:00
martin 95a5ab0654 Re-implement PIN cache on PKCS#15 layer; remove it from PKCS#11. Re-name and log PKCS#15 options to better reflect the purpose.
Data objects and PKCS#15 init are left broken currently.



git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3784 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-22 08:59:59 +00:00
martin ea37069272 Merged r3749:3758 from trunk
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3759 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-05 20:10:07 +00:00
martin 831d1a539e PKCS#11: Fix a crash in C_GetMechanismList if pulCount is NULL
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3732 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 10:12:24 +00:00
martin a614dff522 PKCS#11: Implement more token flags that describe available PIN retries.
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3731 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 10:05:40 +00:00
martin 446fe0f18d PKCS#11: Spec does not allow CKR_DEVICE_ERROR from C_Initialize
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3725 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 08:59:58 +00:00
martin 847e0ade96 PKCS#11: translate SC_ERROR_CARD_UNRESPONSIVE
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3724 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 08:56:39 +00:00
martin 6a48771ce1 Implement CKA_ALWAYS_AUTHENTICATE
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3722 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 08:51:53 +00:00
martin d672fde449 Remove sc_error and sc_ctx_suppress_errors_* in favor of sc_debug/fprintf
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3721 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 08:46:59 +00:00
aj 61b8f0a35d Latest version from scute svn with this change:
Stef Walter: Make all constants UL that should be.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3712 c6295689-39f2-0310-b995-f0e70906c6a9
2009-07-23 08:30:43 +00:00
aj e8b1f540bd Kalev Lember: fix onepin-opensc-pkcs11.dll manifest embedding
with Microsoft compilers.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3707 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 10:08:17 +00:00
ludovic.rousseau 2752c33108 removed unused variable
misc.c:317: warning: unused variable 'i'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3654 c6295689-39f2-0310-b995-f0e70906c6a9
2009-02-25 09:13:35 +00:00
ludovic.rousseau 042d47aaeb iattr_extract(): use sizeof(CK_CERTIFICATE_TYPE) for a
CKA_CERTIFICATE_TYPE

thanks to Wan-Teh Chang for the better patch
http://www.opensc-project.org/pipermail/opensc-devel/2009-February/011892.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3653 c6295689-39f2-0310-b995-f0e70906c6a9
2009-02-25 09:10:38 +00:00
ludovic.rousseau 4987d22c9a attr_extract(): use sizeof(CK_ULONG) instead of sizeof(CKA_CERTIFICATE_TYPE)
Thanks to Marc Rios Valles for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2009-February/011890.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3652 c6295689-39f2-0310-b995-f0e70906c6a9
2009-02-24 17:15:57 +00:00
martin 1bf7e9c418 typo fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3645 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-30 11:59:12 +00:00
martin 24d69c655d hide_empty_tokens should not affect emulated cards (always on)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3644 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-29 11:50:21 +00:00
alonbl 09a849c906 Set default of hide_empty_tokens to true
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3639 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-23 09:30:42 +00:00
alonbl 17cf43eeb1 Rename PKCS#11 v2_20_mode option to plug_and_play
As it is the only feature it controls.
Also, change the default to true.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3637 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-23 09:14:15 +00:00
alonbl fbd51c705e Revert 3630
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3631 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-20 08:42:47 +00:00
alonbl ce5c5f3ae9 Add SCARD_E_NO_SERVICE to internal-winscard.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3630 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-19 19:43:19 +00:00
martin c58bcfab84 Configurable for PKCS#11 v2.20 related changes.
- Correctly report Cryptoki version if v2.20 is used.
 - Consistently report no version for hardware/software we know no version information about.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3627 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-19 12:06:38 +00:00
martin 0876222c5f Make PKCS#11 module default slot configuration more sensible:
* Increase default slot count to 16, which equals 4 concurrent readers by default
  * 2 OpenCT + 2 PC/SC on Linux for example
 * Rename num_slots to slots_per_card
 * Rename internal PKCS#11 variables, remove unneeded defines.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3619 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-16 16:44:35 +00:00
aj a89b14668f Enable lock_login by default for security.
Disable soft_keygen by default for security.
Make defaults code more readable.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3604 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-28 16:01:04 +00:00
martin f4c85e7502 Cosmetic fix for [3595]
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3599 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-05 15:57:51 +00:00
martin 94d0f8d835 Remove ancient unused code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3598 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-05 15:53:31 +00:00
ludovic.rousseau 6f3012d959 add CKM_SHA256* and CKM_SHA384* logs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3596 c6295689-39f2-0310-b995-f0e70906c6a9
2008-11-27 10:44:57 +00:00
martin 1e41d4d267 * Fix issues with pkcs11-tool testing of C_GenerateRandom/C_SeedRandom and OpenSC PKCS#11 implementation of those functions.
Thanks goes to Rickard Bondesson who noticed the issues.

http://www.opensc-project.org/pipermail/opensc-devel/2008-November/011436.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3595 c6295689-39f2-0310-b995-f0e70906c6a9
2008-11-24 22:06:27 +00:00
martin 7b93c51230 Missing SHAs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3593 c6295689-39f2-0310-b995-f0e70906c6a9
2008-11-24 21:53:56 +00:00
ludovic.rousseau 6b89748111 slot_get_token(): return CKR_TOKEN_NOT_PRESENT if CKF_TOKEN_PRESENT is
not set.

Thanks to Douglas E. Engert for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2008-October/011361.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3583 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-10 09:39:27 +00:00
ludovic.rousseau 001f03f18d card_removed(): warning: comparison between signed and unsigned
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3582 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-09 13:05:13 +00:00
ludovic.rousseau 6eb3ecd107 card_initialize(): correctly associate a reader to each virtual slot.
Thanks to Douglas E. Engert for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2008-October/011359.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3581 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-09 12:59:02 +00:00
ludovic.rousseau 56ea99d8a0 print_mech_info(): replace printf by fprintf to correctly redirect the
log


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3554 c6295689-39f2-0310-b995-f0e70906c6a9
2008-08-12 09:51:43 +00:00
alonbl 7d6cf6b694 Prepare for libtool-2
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3528 c6295689-39f2-0310-b995-f0e70906c6a9
2008-06-05 17:03:47 +00:00
ludovic.rousseau 4fd85ce0cf print_generic() & print_print(): size is a CK_ULONG (unsigned) so compare
using "!= (CK_LONG)(-1)" instead of "> 0"


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3525 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-26 08:30:39 +00:00
ludovic.rousseau 4d1218b64f completely initialize pkcs11_secret_key_ops structure with NULL pointers
secretkey.c:225: warning: missing initializer
secretkey.c:225: warning: (near initialization for 'pkcs11_secret_key_ops.destroy_object')


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3524 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-22 12:37:57 +00:00
ludovic.rousseau 28c0c6283d print_ptr_in(): change log format
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3516 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-20 09:47:27 +00:00
ludovic.rousseau 232a26b62d C_Initialize(): log the value of the pInitArgs argument
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3515 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-20 09:41:44 +00:00
ludovic.rousseau d7bb718e24 C_Finalize(): do not unload the module since the application may try to
make PKCS#11 calls again


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3513 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-12 09:41:48 +00:00
ludovic.rousseau 91177e51ec Use size_t instead of int when needed, plus some other minor changes
Patch bug.1 included in Ticket #176


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3510 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-05 13:00:01 +00:00
alonbl e237574742 Plug&Play support
This is not the best solution, but focus on smallest code change.

Changes:

1. Add detect_readers() to reader opts, this adds new readers to the end
   of the readers list until list is full.

2. Add sc_ctx_detect_readers() that calls readers' detect_readers().

3. Fixup pcsc_lock() so that it reconnect to the card and report proper
   error so caller may be notified if session was lost.

4. Allow context to be created without readers.

5. Call sc_ctx_detect_readers() from PKCS#11 C_GetSlotList with NULL_PTR.

6. Allow no reader at detect_card, as reader my be removed.

7. Since I broke ABI, I updated the external module version requirement
   to match OpenSC version. In the future a separate version should be
   maintained for each interface, this should be unrelated to the package
   version.

Alon

---

svn merge -r 3480:3505 https://www.opensc-project.org/svn/opensc/branches/alonbl/pnp

M    src/tools/opensc-tool.c
M    src/pkcs11/pkcs11-global.c
M    src/pkcs11/slot.c
M    src/libopensc/reader-pcsc.c
M    src/libopensc/internal-winscard.h
M    src/libopensc/ctx.c
M    src/libopensc/reader-ctapi.c
M    src/libopensc/libopensc.exports
M    src/libopensc/reader-openct.c
M    src/libopensc/opensc.h


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3506 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-29 17:01:19 +00:00
alonbl 6c740b907e More MSVC fixups by Douglas E. Engert
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3503 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-29 06:09:00 +00:00
ludovic.rousseau 0b239489fc completely initialize the sc_pkcs11_framework_ops structure (using NULL
for undefined callbacks)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3498 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:36:07 +00:00
ludovic.rousseau 040ac682d8 completely initialize the struct fmap fields
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3497 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:33:26 +00:00
alonbl 865f6e9c70 More fixups to maintainer-clean
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3471 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-11 12:52:46 +00:00
alonbl d84077749b Distribute autoconf generated files for MSVC build
Construct resource files and winconfig.h using autoconf
substitutions.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3468 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-08 18:36:42 +00:00
alonbl 5f567f7a3c More MSVC build additions
(1) use the exports for opensc-pkcs11.dll, onepin-opensc-pkcs11.dll,
      and pkcs11-spy.dll

  (2) don't link common.lib with scconf.lib, to avoid duplicate messages
      later.

  (3) add piv-tool to openssl_programs.

By Douglas E. Engert



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3466 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-07 21:35:11 +00:00
alonbl 54c1c735f3 Attached are the latest mode to OpenSC svn 3462 to use the Makefile.mak
files to build on Windows.

I got rutoken to compile, and took out the #ifdef's I had in last week.
The rutoken programmer declared some variables in the middle of a block
rather then having all the declare statements at the beginning of a block
as is normally done in C. The Microsoft compile treats this as an error.
(Actual many errors.)

The makedef.pl is no longer needed, as the exports files can be used.
Note that in the original Makefile.mak files only opensc.def and
pkcs15init.def were created.

winconfig.h has a number of changes. As discussed last week this could
be created by autoconf. I also noted that the Active State Perl that
was required for the makedef.pl has a psed command that could be used
like sed to update winconfig.h.  I did not attempt to do this.



  win32/Make.rules.mak - Use ENABLE_OPENSSL and ENABLE_ZLIB

  src/tools/Makefile.mak - add the rutoken.tool.exe

  src/tools/eidenv.c - use PACKAGE_VERSION

  src/pkcs11/Makefile.mak - reorder the objest to match the list in the
           Makefile.am. Makes it easier to read.

  src/include/winconfig.h - The windows version of the config.h
           Changes based on discussions on the list last week.

  src/common/Makefile.mak - renamed modules.

  src/pkcs15init/Makefile.mak - reordered, and added back the rutoken modules
           replaced the use of makdef.pl to sue the exports file.

  src/scconf/Makefile.mak - reordered objects.

  src/libopensc/card-rutoken.c -
           error. Moved the declares to the beginning of blocks.

  src/libopensc/Makefile.mak - reorder names, and add rutoken.
           Use the libopensc.exports file.

  src/libopensc/pkcs15-prkey-rutoken.c - more moving of declare statements.

By Douglas E. Engert

http://www.opensc-project.org/pipermail/opensc-devel/2008-April/011011.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3464 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-07 19:42:43 +00:00
alonbl 6e65efb257 Some more build cleanups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3462 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-04 20:38:20 +00:00
alonbl e4eeba26cd Fix MSVC compiler error
http://www.opensc-project.org/pipermail/opensc-devel/2008-April/010997.html

Thanks to Douglas E. Engert


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3459 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-04 16:21:08 +00:00
alonbl 87db3c96c2 More separate srcdir fixups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3450 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-01 19:04:33 +00:00
alonbl 39abe22798 More separate srcdir fixups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3449 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-01 17:08:17 +00:00
ludovic.rousseau 7e30721378 use $(srcdir) when needed to be able to build in separate build
directories using: cd foobar ; ../configure srcdir=..

Thanks to Douglas E. Engert for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2008-March/010959.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3445 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-01 12:43:26 +00:00
alonbl 2f997da125 Install PKCS#11 providers at bin for Windows
This will place file in more expected location, and
reduce runtime dependencies as dependency DLL will be located
at the same directory.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3441 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-27 14:13:00 +00:00
alonbl 80a16f686d ruToken cleanups
Move constants out of standard files.
Create ruToken specific interface.
Update symbols.

Thread at:
http://www.opensc-project.org/pipermail/opensc-devel/2008-March/010917.html

Cleanup of:
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010617.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3439 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-26 06:24:37 +00:00
alonbl 314f2a5501 Cygwin should load .dll version of PKCS#11
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3432 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-19 21:23:47 +00:00
alonbl 8ac87f1b1e Remove useless comments
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3414 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-09 21:24:24 +00:00
alonbl 0a809dd5cb Complete rewrite of OpenSC build system.
1.  Build system now supports MinGW (Windows) compilation using msys and cross compilation.
2.  Ability to explicitly disable and enable dependencies of the package.
3.  openct, pcsc and nsplugins features are disabled by default.
4.  Modified pcsc driver to use pcsc dynamically, no compile time dependency is required.
5.  --enable-pcsc-lite configuration option renamed to --enable-pcsc.
6.  Install opensc.conf file (as opensc.conf.new if opensc.conf exists).
7.  Add--enable-doc configuration option, allow installing documentation into target.
8.  Add --disable-man configuration option, allow msys mingw32 users to
    build from svn without extra dependencies.
9.  Add export files to each library in order to export only required symbols.
    Windows native build may use these files instead of scanning objects' symbols.
10. Add opensc-tool --info to display some general information about the build.
11. Create compatibility library to be linked against library instread of recompiling the
    same source files in different places.
12. Add different win32 version resource to each class of outputs.
13. Make xsl-stylesheets location selectable.
14. Some win32 fixups.
15. Some warning fixups.
16. Many other autoconf/automake cleanups.

Alon Bar-Lev

svn diff -r 3315:3399 https://www.opensc-project.org/svn/opensc/branches/alonbl/mingw

_M   .
D    configure.in
_M   src
_M   src/openssh
M    src/openssh/Makefile.am
_M   src/tools
M    src/tools/rutoken-tool.c
M    src/tools/opensc-tool.c
M    src/tools/cardos-info.c
M    src/tools/pkcs15-crypt.c
M    src/tools/pkcs15-init.c
M    src/tools/piv-tool.c
M    src/tools/netkey-tool.c
M    src/tools/eidenv.c
M    src/tools/cryptoflex-tool.c
M    src/tools/util.c
M    src/tools/pkcs11-tool.c
M    src/tools/pkcs15-tool.c
M    src/tools/util.h
M    src/tools/opensc-explorer.c
M    src/tools/Makefile.am
_M   src/pkcs11
M    src/pkcs11/pkcs11-global.c
M    src/pkcs11/framework-pkcs15.c
M    src/pkcs11/mechanism.c
M    src/pkcs11/pkcs11-display.c
M    src/pkcs11/pkcs11-object.c
A    src/pkcs11/opensc-pkcs11.exports
M    src/pkcs11/sc-pkcs11.h
M    src/pkcs11/pkcs11-spy.c
M    src/pkcs11/openssl.c
M    src/pkcs11/Makefile.am
A    src/pkcs11/pkcs11-spy.exports
_M   src/tests
_M   src/tests/regression
M    src/tests/regression/Makefile.am
M    src/tests/sc-test.c
M    src/tests/pintest.c
M    src/tests/Makefile.am
_M   src/include
_M   src/include/opensc
M    src/include/opensc/Makefile.am
A    src/include/opensc/svnignore
M    src/include/Makefile.am
_M   src/signer
_M   src/signer/npinclude
M    src/signer/npinclude/Makefile.am
M    src/signer/Makefile.am
A    src/signer/signer.exports
_M   src/common
A    src/common/compat_dummy.c
D    src/common/getopt.txt
D    src/common/strlcpy.c
D    src/common/LICENSE
A    src/common/compat_getopt.txt
A    src/common/compat_strlcpy.c
A    src/common/LICENSE.compat_getopt
A    src/common/compat_getopt.c
D    src/common/strlcpy.h
D    src/common/ChangeLog
D    src/common/getpass.c
D    src/common/my_getopt.c
A    src/common/compat_strlcpy.h
A    src/common/compat_getpass.c
A    src/common/compat_getopt.h
A    src/common/ChangeLog.compat_getopt
D    src/common/README.strlcpy
D    src/common/my_getopt.h
A    src/common/compat_getpass.h
A    src/common/README.compat_strlcpy
D    src/common/strlcpy.3
A    src/common/README.compat_getopt
D    src/common/getopt.3
D    src/common/README.my_getopt
A    src/common/compat_strlcpy.3
A    src/common/compat_getopt.3
M    src/common/Makefile.am
M    src/Makefile.am
_M   src/pkcs15init
M    src/pkcs15init/pkcs15-oberthur.c
M    src/pkcs15init/profile.c
M    src/pkcs15init/pkcs15-lib.c
M    src/pkcs15init/pkcs15-rutoken.c
A    src/pkcs15init/pkcs15init.exports
M    src/pkcs15init/pkcs15-gpk.c
M    src/pkcs15init/Makefile.am
_M   src/scconf
M    src/scconf/Makefile.am
M    src/scconf/parse.c
A    src/scconf/scconf.exports
_M   src/libopensc
M    src/libopensc/card-rutoken.c
M    src/libopensc/compression.c
M    src/libopensc/sc.c
M    src/libopensc/card-piv.c
M    src/libopensc/pkcs15-openpgp.c
M    src/libopensc/pkcs15-postecert.c
M    src/libopensc/pkcs15-tcos.c
M    src/libopensc/opensc-config.in
M    src/libopensc/reader-pcsc.c
A    src/libopensc/internal-winscard.h
M    src/libopensc/ctx.c
A    src/libopensc/libopensc.exports
M    src/libopensc/pkcs15-piv.c
M    src/libopensc/pkcs15-infocamere.c
M    src/libopensc/internal.h
M    src/libopensc/pkcs15-actalis.c
M    src/libopensc/pkcs15-starcert.c
M    src/libopensc/card-oberthur.c
M    src/libopensc/pkcs15-atrust-acos.c
M    src/libopensc/p15card-helper.c
D    src/libopensc/part10.h
M    src/libopensc/ui.c
M    src/libopensc/card-gpk.c
M    src/libopensc/pkcs15-wrap.c
M    src/libopensc/pkcs15-gemsafeGPK.c
M    src/libopensc/log.c
M    src/libopensc/pkcs15-esteid.c
M    src/libopensc/pkcs15-prkey-rutoken.c
M    src/libopensc/log.h
M    src/libopensc/Makefile.am
M    src/libopensc/reader-openct.c
_M   aclocal
M    aclocal/Makefile.am
_M   win32
M    win32/Makefile.am
A    win32/versioninfo.rc.in
A    win32/ltrc.inc
A    configure.ac
_M   doc
_M   doc/tools
M    doc/tools/pkcs15-profile.xml
D    doc/changelog.sh
D    doc/export-wiki.xsl
_M   doc/api
_M   doc/api/file
M    doc/api/man.xsl
_M   doc/api/asn1
_M   doc/api/apps
_M   doc/api/init
_M   doc/api/types
_M   doc/api/card
M    doc/api/html.xsl
_M   doc/api/misc
_M   doc/api/util
M    doc/Makefile.am
D    doc/export-wiki.sh
AM   doc/nonpersistent
A    doc/nonpersistent/export-wiki.xsl
A    doc/nonpersistent/Makefile.am
A    doc/nonpersistent/export-wiki.sh
A    doc/nonpersistent/svn2cl.xsl
D    doc/generate-man.sh
D    doc/svn2cl.xsl
M    Makefile.am
A    svnignore
_M   etc
M    etc/opensc.conf.in
M    etc/Makefile.am
D    man
_M   solaris
M    solaris/Makefile



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3405 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-06 16:06:59 +00:00
alonbl 56a4322c34 Convert constant SC_PKCS11_MAX_VIRTUAL_SLOTS to configuration option.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3404 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-06 15:04:29 +00:00
alonbl 1875a25c40 PKCS#11 "Application and processes" instructs the sequence
that should be taken after fork().
Applications should call C_Initialize() immediately after fork()
to reinitialize the provider.

The change monitor the pid that calls C_Initialize(), if it is
different than previous C_Finalize() is called.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3402 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-06 14:56:31 +00:00
martin 04942bb4f6 * Correctly return CKR_PIN_INCORRECT if PIN is out of range.
* By Alon Bar-Lev from svn diff -r 3397:3398 https://www.opensc-project.org/svn/opensc/branches/alonbl/pkcs11-login-rv



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3400 c6295689-39f2-0310-b995-f0e70906c6a9
2008-02-29 10:18:51 +00:00
ludovic.rousseau 91288d4955 remove $(pkcs11dir)/opensc-pkcs11.so so that creating the symbolink link
does not fail if the file already exists.

Thanks to Jean-Pierre Szikora for the bug report


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3314 c6295689-39f2-0310-b995-f0e70906c6a9
2008-01-11 16:28:00 +00:00
ludovic.rousseau bf9d6beaac new patch for ruToken support
Thanks to Andrew V. Stepanov
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010631.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3310 c6295689-39f2-0310-b995-f0e70906c6a9
2008-01-03 08:59:14 +00:00
ludovic.rousseau 0ecc294ed8 add support of ruToken
Thanks to Andrew V. Stepanov for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010617.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3304 c6295689-39f2-0310-b995-f0e70906c6a9
2007-12-17 13:39:20 +00:00
ludovic.rousseau 4bf320b304 add support of /usr/lib/pkcs11/ directory. See
http://wiki.cacert.org/wiki/Pkcs11TaskForce

Thanks to Alon Bar-Lev for the better patch


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3300 c6295689-39f2-0310-b995-f0e70906c6a9
2007-11-13 09:38:18 +00:00
aj 177ff402f3 fix typo, found by Gürer Özen.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3259 c6295689-39f2-0310-b995-f0e70906c6a9
2007-08-28 20:34:42 +00:00
aj 9a10cdeebd add cflags for ltdl.h where needed.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3245 c6295689-39f2-0310-b995-f0e70906c6a9
2007-08-13 19:10:26 +00:00
ludovic.rousseau 345ce22c63 use LTLIB_CFLAGS and LTLIB_LIBS instead of the global LIBS to find and use
libltdl

thanks to Alon Bar-Lev for the patch


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3243 c6295689-39f2-0310-b995-f0e70906c6a9
2007-08-13 08:30:19 +00:00
aj dea6f8b090 update pkcs11.h header file from scute.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3196 c6295689-39f2-0310-b995-f0e70906c6a9
2007-07-03 14:14:58 +00:00
aj 4ca4eba365 silence more warnings by gcc/sparse.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3189 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 13:58:38 +00:00
aj 0c604cb294 silence more warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3183 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 12:58:57 +00:00
aj c66889dc9e fix broken changes.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3182 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 12:14:50 +00:00
aj de0ca91355 make sc_pkcs11_print_attrs non static.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3181 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 12:06:33 +00:00
aj 4f0329cd18 silence more gcc/sparse warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3180 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 12:01:39 +00:00
aj 4cc1a50a49 Alessandro Premoli:
add support for reading, writing and deleting private (require cache_pins) and
public data objects in PKCS11. updated the pkcs11-tool and fixed a few
bugs in the code. Tested on an aladdin etoken.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3176 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 09:37:18 +00:00
aj a4cd33e77f Douglas E. Engert:
Looking at framework-pkcs11.c, it looks like there is a bug in the handling of
auth_count, if there is more then one pin, and one of the pins is a
SC_PKCS15_PIN_FLAG_SO_PIN. 

The for loop at line 767 will add a slot for each non SO_PIN or UNBLOCKING_PIN.
But at line 812, the auth_count is still set to the number of pins, even though
the SO_PIN did not cause a new slot to be allocated and thus the test of
hide_empty_tokens will not be used. 

With the attached patch, I can get the expected behavior when hide_empty_tokens
= yes in the opensc.conf from pkcs11-tool -L, pkcs11-tool -O and pkcs11-tool -O
-l 

There is only 1 slot allocated, the pkcs11-tool -O shows all the public
objects, and pkcs11-tool -O -l (after PIN) shows all the objects, and Heimdal
PKINIT still runs. 

I still think that if two or more slots need to be allocated for multiple auth
pins, then all the public objects should be added to each. I have an additional
mod for this too. 

Since the cards I am working with only have 1 pin, the attached mods works for
me. Note it looks like the pkcs15-openpgp.c might also be affected by this
change as it defines two pins an auth pin and a SO_PIN, much like the PIV card
does.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3175 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 07:11:21 +00:00
aj f065546ccd The framework-pkcs15 will filed the modulus in a certificate and copy it to a
pubkey or from apubkey to a privkey object. But it does not copy the
modulus_len. 

This patch will look at pub_info->modulus_len and prv_info->modulus_len and
copy the modulus_len while copying the modulus.  This will be used with the
pkcs15-piv code when it creates pub and priv objects, as it has no way other
then from the certificates to know the modulus_len.

By  Douglas E. Engert.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3171 c6295689-39f2-0310-b995-f0e70906c6a9
2007-05-25 20:06:59 +00:00
aj e3935077e1 enable pin caching by default.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3158 c6295689-39f2-0310-b995-f0e70906c6a9
2007-04-24 07:54:18 +00:00
nils ef7d8ffa86 bugfix: don't use the size of a void pointer, thanks to Carl Przybylek <crprzyby@gmail.com>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3146 c6295689-39f2-0310-b995-f0e70906c6a9
2007-04-01 17:03:08 +00:00
martin d0a0103c70 Build a pkcs11 module with only one pin exposed to overcome issues described in #132. Closes #132
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3145 c6295689-39f2-0310-b995-f0e70906c6a9
2007-03-29 10:25:16 +00:00
aj eab8ade2ec changes by Douglas E. Engert:
change the do_decompress* to sc_decompress* and the initialize_* to
sc_pkcs15emu_initialize_* in the new code.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3126 c6295689-39f2-0310-b995-f0e70906c6a9
2007-03-12 20:15:39 +00:00
nils a2f622a215 implement support for SHA2 (still experimental)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3115 c6295689-39f2-0310-b995-f0e70906c6a9
2007-02-02 22:15:14 +00:00
aj 5db87927d4 convert to utf-8.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3086 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-19 21:33:15 +00:00
aj d537651ab7 update to latest pkcs11.h version.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3075 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-18 07:42:06 +00:00
nils f23ddbdba1 make it work with my compiler, add missing parenthesis
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3074 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-10 13:33:34 +00:00
aj 9aa18ea1ce update to latest pkcs11.h from Marcus.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3073 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-10 07:57:22 +00:00
aj 44d54b68dd pkcs11.h with updates from Alon.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3071 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-09 15:41:27 +00:00
aj b9daff9b28 replace rsa pkcs#11 header files with rewrite.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3066 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-30 08:11:58 +00:00
nils 65658db6e4 make the decision which locking functions to use more explicit; patch supplied by Martin
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3040 c6295689-39f2-0310-b995-f0e70906c6a9
2006-10-02 17:26:48 +00:00
nils a946dc98bf set CKF_USER_PIN_INITIALIZED only if we really have a pin object
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3033 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-27 22:10:12 +00:00
ludovic.rousseau 3e2e82dde9 C_GetInfo(): use "OpenSC (www.opensc-project.org)" instead of
"OpenSC Project (www.opensc-project.org)" for the manufacturerID to
avoid a truncation at 32 characters


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3012 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-14 08:55:06 +00:00
aj 198b68a6d3 shorten string, fixing #98.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3009 c6295689-39f2-0310-b995-f0e70906c6a9
2006-08-27 18:25:43 +00:00
aj 4608716c53 Douglas E. Engert:
Change PKCS11-Spy so it looks in HKEY_LOCAL_MACHINE, before
HKEY_LOCAL_USER.

This should not cause any problems, as the HKEY_LOCAL_MACHINE,
"Software\PKCS11-Spy" would not normally be set, accept while
the sysadmin of the machine as trying to debug a login type problem. 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3006 c6295689-39f2-0310-b995-f0e70906c6a9
2006-08-13 21:20:05 +00:00
nils aec987df38 build fixes for win; patch supplied by Douglas E. Engert <deengert@anl.gov>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3005 c6295689-39f2-0310-b995-f0e70906c6a9
2006-08-03 21:05:59 +00:00
nils 42ad6be451 win build fixes; patch supplied by Douglas E. Engert <deengert@anl.gov>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3003 c6295689-39f2-0310-b995-f0e70906c6a9
2006-08-02 19:31:34 +00:00
nils 6df2a05975 bring implementation in accordance with the docu in opensc.conf
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2976 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-21 20:05:17 +00:00
aj f9dd89e53b sprintf bad. maybe even potential exploitable?
bug found by ville skytta using pscan.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2964 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-23 20:53:15 +00:00
aj 0f64e9d3f1 make objects on piv card public.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2957 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-20 16:06:42 +00:00
aj c7a5ce3b50 revert prior change as it breaks the regression tests.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2956 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-20 16:05:14 +00:00
nils bfe05f31dc check for existing public key before creating one from the certificate; patch supplied by Albert Solana <asb@c3po.es>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2953 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-15 18:48:30 +00:00
aj 45007b3da7 compile fixes for win32.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2949 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-12 20:01:26 +00:00
nils b28f8ed9c4 improve buffer length check
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2943 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-09 21:35:07 +00:00
nils 0c39b21b99 set the default for lock_login to false (as documented in opensc.conf)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2941 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-05 10:35:02 +00:00
aj 449a1841b1 free(data)
(allocated by sc_pkcs15_read_data_object, no reference kept anywhere).


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2930 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:20:22 +00:00
aj ab0066b0d7 fix printf size_t problem with "%lu" and (unsigned long) cast.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2923 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:02:50 +00:00
aj 41ff15ec1f fix signed and size_t warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2916 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-26 11:41:57 +00:00
aj beb55b8104 not sure it is a good idea to ignore the return value.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2898 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-26 10:00:23 +00:00
aj 347c5b0496 remove a function that is no longer used at all.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2888 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-18 15:15:45 +00:00
nils b791b1d6bc check the private flag of public key objects; patch supplied by Albert Solana <asb@c3po.es>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2879 c6295689-39f2-0310-b995-f0e70906c6a9
2006-03-24 10:55:33 +00:00
martin 9213a29a34 Small fixes for windows compilation (Visual Studio Express 2005)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2855 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-23 11:02:24 +00:00
nils 1f65fbe10e a unblocking pin could be used for authentication as well
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2844 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-14 22:46:54 +00:00
nils 55631edf3b support private certificates; patch supplied by Douglas E. Engert <deengert@anl.gov>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2836 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-09 20:05:20 +00:00
nils 8e77e87551 sc_mutex_destroy should have a return value
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2832 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-05 19:35:55 +00:00
nils 5c3aed1189 - remove dependence on a specific threading library
- add two new structures: sc_thread_context_t which let
  the user specify the mutex functions to use and
  sc_context_param_t to specify parameters for the sc_context_t
  creation (including mutex functions) using sc_create_context()
- add new function sc_context_create()  
- remove timestamp code from libopensc


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2829 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-01 22:59:42 +00:00
aj b07df40932 change more opensc.org references to opensc-project.org till dns is back.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2818 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-22 21:15:07 +00:00
sth 551bcc89fa Referted the 'Fireofox 1.5' fix in log.c and replaced it by letting a blocking C_WaitForSlotEvent() return CKR_FUNCTION_NOT_SUPPORTED. This isn't a solution for the multihread problems (things hang or try to log to a released context) but at least it solves the Ff 1.5 problems
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2777 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-23 10:15:17 +00:00
sth 912946bf3f Fix for ticket #45: Firefox 1.5 and new Mozilla's crash when they are closed because there's a blocking C_WaitForSlotEvent() called from another thread then the 'main' thread that calls C_Finalize(); and this cause C_WaitForSlotEvent() to log to a NULL context -> assertion failure.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2762 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-08 20:25:54 +00:00
aj 40c67035c5 no code change, only easier to parse :)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2724 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-05 21:53:13 +00:00
nils 346486ee70 fix problem with uninitialized pointer; this patch resolves opensc ticket #61
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2698 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-04 23:23:25 +00:00
nils ad647c66fa use sc_ctx_get_reader
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2676 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-30 21:44:05 +00:00
nils 47ee84e72d add functions
void sc_ctx_suppress_errors_on(sc_context_t *ctx);
	void sc_ctx_suppress_errors_off(sc_context_t *ctx);
to turn on/off error suppression (to avoid accessing
sc_context_t directly) and use it.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2671 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-30 19:08:06 +00:00
sth 8f230f5c1d Do an sc_lock() before an sc_pkcs15init_bind(). Reason: in sc_pkcs15init_bind() an sc_lock() and sc_unlock() is done; and when the lock_login config option is set to false, the sc_unlock() will call logout() which for some cards means a SELECT(3F00) -> unwanted change of the current EF/DF causing errors
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2629 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-01 18:51:34 +00:00
aj 9d4d8ec98a reomve unneeded ifdefs.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2628 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-30 17:44:42 +00:00
sth 6effc69169 Removed the bundle on Mac
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2627 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-30 11:17:06 +00:00
aj 1d251cfa7a Document cryptoki header files.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2617 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-22 13:15:11 +00:00
aj 7d5d0ecfb2 scconf no longer needed for pkcs#11 spy.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2614 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-21 20:18:37 +00:00
aj d05e28d1f5 do not install bundles on mac os X. no reason to.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2613 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-21 20:17:22 +00:00
martin 3c47bb093c Fix makefiles
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2611 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-21 12:52:36 +00:00
aj 881c80d839 pkcs11-spy no longer uses a config file.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2602 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-18 11:00:00 +00:00
nils 6abeaf1f1c add a new function
void sc_mem_clear(void *ptr, size_t len);
to clear a memory buffer. If OpenSSL is used this function
is a wrapper for OPENSSL_cleanse, otherwise memset is currenlty used.

Use this function to clear memory buffers with sensitive content.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2601 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-17 10:44:45 +00:00
nils 5123be2b85 add two new functions
sc_reader_t *sc_ctx_get_reader(sc_context_t *ctx, unsigned int i);
	unsigned int sc_ctx_get_reader_count(sc_context_t *ctx);
to access the reader_count and the sc_reader objects (to avoid accessing
the sc_context members directly).
Use these functions in src/pkcs11 + error checking to avoid accessing
invalid sc_reader objects.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2595 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-16 10:18:55 +00:00
sth e15c54e1c5 Win32: we now need the external libtool package
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2592 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-15 05:55:53 +00:00
sth fd86e44094 Typo fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2570 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-11 19:57:43 +00:00
aj 21e3b71029 use ltdl not scdl.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2564 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-09 14:43:59 +00:00
aj c9e80e95ea we use libtool for linking, so it can calucalte the dependencies using
LTLIBLTDL better. Thanks to Ralf Wildenhues.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2558 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-08 17:21:58 +00:00
aj ce14d27cb3 AC_SUBSTed variables are better used with $(..). Thanks to Ralf Wildenhues.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2557 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-08 17:15:07 +00:00
martin 8596348a75 * Get rid of reset card error that comes from pcsc only and deal with reset situations with SCardReconnect
* Add some options to control pcsc behavior.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2553 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-08 11:35:26 +00:00
nils 7a2fec9b86 remove dependence on libopensc, instead use scconf directly.
Note: this code is still experimental !


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2552 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-07 20:05:13 +00:00
nils 9f26a4ae35 fix warning
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2551 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-07 09:34:27 +00:00
nils d37315ec35 cleanup key usage handling, cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2550 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-07 09:32:52 +00:00
aj 08a640c94b users of libpcs11.c also need @LIBLTDL@ libraries.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2544 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-06 20:22:15 +00:00
nils ffb7928f6e we need lt_dlinit()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2538 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-05 17:05:26 +00:00
aj ff62b88e1c big configure update.
use pkg-config for openct, openssl, pcsc.
do not compilke libp11. do not compile sslengines.
remove scdl. use libltdl instead.
use libassuan.m4 macro for m4 detection.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2528 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-01 14:01:58 +00:00
sth 891ed0f197 Added Netscape/Mozilla specific types etc.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2524 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-29 12:49:53 +00:00
martin 924a118501 Don't cache pins that protect a userconsent slot.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2502 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-21 18:39:43 +00:00
nils 6dc33041aa include sys/types.h if stdint.h doesn't exist + fix typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2476 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-09 21:27:50 +00:00
nils f59a51397c apply Stef's patch which puts all public objects in first slot if only one pin is present (and hide_empty_tokens is true)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2448 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-24 14:06:02 +00:00
aj c26dde1a82 fix compiling without openssl.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2447 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-21 21:05:40 +00:00
nils e09bdac57b don't use software prng
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2436 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-18 20:20:22 +00:00
aj dd08853693 remove code dealing with random numbers for now.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2420 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-17 20:18:31 +00:00
aj 2445a52ad4 do not install libpkcs11 as shared library.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2388 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-10 17:03:15 +00:00
nils 65eec98c71 enhance attribute support; patch supplied by supplied by Marc Bevand <bevand_m@epita.fr>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2386 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-08 21:16:31 +00:00
nils 9c011b0cab fix check of the return value in C_GetAttributeValue; supplied by Marc Bevand <bevand_m@epita.fr>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2385 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-08 21:04:23 +00:00
martin 3d0f17bc95 Annoying typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2365 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-27 13:52:08 +00:00
aj bf6808e3d8 "smart card" not "smartcard" or "SmartCard".
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2354 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-16 19:35:31 +00:00
aj 4568015476 move libraries from lib/pkcs11 to lib/,
rename the engine dir to engine, and
make it "openssl" so openssl can load
the engines automaticaly.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2350 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-15 08:56:15 +00:00
nils a248911ed2 cleanup, patch supplied by Marc Bevand
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2344 c6295689-39f2-0310-b995-f0e70906c6a9
2005-05-20 09:55:13 +00:00
sth fa333542db Don't used cashed PINs for a UserConsent key!
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2342 c6295689-39f2-0310-b995-f0e70906c6a9
2005-05-11 14:00:03 +00:00
nils d953492739 bugfix; supplied by Marc Bevand <marc.bevand@smartjog.com>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2318 c6295689-39f2-0310-b995-f0e70906c6a9
2005-04-24 09:28:27 +00:00
sth 9221f1b2b2 Added opensc-to-pks11 error mapping
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2283 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-26 20:00:14 +00:00
aj 7133146d28 put new version in pkcs11-global.c, too.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2259 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-23 22:37:06 +00:00
aj 8d27151cf6 remove .cvsignore files.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2243 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-23 21:08:13 +00:00
bert eb4717ea17 API fixup: use defined type instead of struct for exposed structs (part 2)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2233 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-09 00:04:44 +00:00
pisi 118c1f914a test label
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2190 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-15 14:41:30 +00:00
aet df5e357694 - Whitespace cleanup from me and Martin Paljak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2181 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-11 20:09:34 +00:00
nils c30494a942 declare some functions static + some type fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2144 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-06 10:28:43 +00:00
nils 54f8794267 indent fixes and cleanup by Martin Paljak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2126 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-03 22:44:19 +00:00
nils c95726c782 bugfix: reselect application directory when lock_login=false
is set (at the moment only for pkcs15_prkey_sign and
pkcs15_prkey_decrypt), see:
http://www.opensc.org/pipermail/opensc-devel/2005-January/005345.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2120 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-01 19:02:15 +00:00
nils 485cc32f9b even more indent issues
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2086 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-19 20:12:55 +00:00
nils 14ff6bdfc5 fix indent again
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2084 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-19 19:52:08 +00:00
nils cb5d576267 some indent fixes from Martin Paljak plus some additional changes from me
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2083 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-19 18:15:43 +00:00
sth 08c3cc90fa Simplified the procedure to link with openssl on Windows: now you only need to slightly change Make.rules.mak instead of hacking in several Makefile.mak files
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2077 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-16 21:12:38 +00:00
nils f509f00d17 some cleanup + improved error checking
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2052 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-03 17:25:18 +00:00
nils 3931ee708d cleanup ...
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2041 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-22 10:17:00 +00:00
nils 01f549da22 fix public key reference
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2026 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-20 19:44:38 +00:00
nils 8673508a43 fix memory leak, cleanup: use object specific release method
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2024 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-18 14:14:57 +00:00
nils 56a37d6c48 use object specific release method (if existing)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2000 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-12 19:13:17 +00:00
sth 17fa73fb5d scdl.lib needed for for the link step due to the recent changes in dynamic loading
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1955 c6295689-39f2-0310-b995-f0e70906c6a9
2004-10-27 05:10:34 +00:00
nils bfd5b49436 pkcs15-init etc. support for pkcs15 data objects
patch supplied by Victor Tarasov <vtarasov@idealx.com>


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1877 c6295689-39f2-0310-b995-f0e70906c6a9
2004-07-26 18:47:23 +00:00
sth 1c51a8f0dd Fix: if a card couldnt be read (e.g. inverted upside down), allow to retry it later when asked
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1817 c6295689-39f2-0310-b995-f0e70906c6a9
2004-07-09 15:33:35 +00:00
aj 4b4c20196b better checking for null values.
found and fixed reported by Victor Tarasov <vtarasov@idealx.com>


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1777 c6295689-39f2-0310-b995-f0e70906c6a9
2004-04-21 21:11:06 +00:00
aj 6e15c2421e check parameters in strcpy_bp
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1760 c6295689-39f2-0310-b995-f0e70906c6a9
2004-03-29 20:34:30 +00:00
okir 393de85ac1 - Don't crash if card->serial_number is NULL
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1749 c6295689-39f2-0310-b995-f0e70906c6a9
2004-02-02 10:24:31 +00:00
aet 85d6bc7922 - Warning fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1731 c6295689-39f2-0310-b995-f0e70906c6a9
2004-01-08 15:23:11 +00:00
sth 9779f07467 Fix: no keycaching if USE_PKCS15_INIT is not #defined
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1730 c6295689-39f2-0310-b995-f0e70906c6a9
2004-01-08 14:16:02 +00:00
aet 6473d2d2b3 - Unify with pkcs11.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1728 c6295689-39f2-0310-b995-f0e70906c6a9
2004-01-08 14:05:32 +00:00
aj 115bd355ed config.h is not used in pkcs11.h or any file included by it.
but pkcs11.h is a public header file, so it shouldn't do so anyway.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1721 c6295689-39f2-0310-b995-f0e70906c6a9
2004-01-08 11:54:54 +00:00
sth 844ec9bc23 If the maximum allowed number of virtual slots per card is reached, then silently discard all objects that haven't been added yet instead of returning an error
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1717 c6295689-39f2-0310-b995-f0e70906c6a9
2004-01-08 09:47:23 +00:00
sth 7daafeb5da Update to the new keycache functions for caching the user and SO PINs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1716 c6295689-39f2-0310-b995-f0e70906c6a9
2004-01-08 08:32:46 +00:00
okir f6aa07d991 - Another fix from Remo wrt keygen_args.pubkey_label
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1705 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-30 08:20:52 +00:00
okir 8a97a69d1d - C_CloseAllSessions would block on some Win32 versions because it tried
to acquire the global pkcs11 mutex twice.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1704 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-30 08:00:10 +00:00
aet 20a707002c - Install unix.h and win32.h as well
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1701 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-29 16:54:31 +00:00
aet 13030f54b1 - Minor bundle handling fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1671 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-12 09:32:34 +00:00
aet d6713aff9a - Minor naming convention harmonisation for pc/sc and ct-api
related things


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1669 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-10 14:52:58 +00:00
okir cfdd62bd49 - When generating a key in pkcs15init, allow the caller to specify a
public key label (Remo Inverardi)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1663 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-08 12:02:28 +00:00
sth 4d68e1a28e Fix: allow a C_GetAttributeValue(privkey, CKA_MODULUS) after a C_GenerateKeyPair() -- M. Buechler
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1658 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-04 16:42:03 +00:00
sth 720b2810ee Little fix: forgotten to log an input param
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1657 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-04 15:07:26 +00:00
okir 5b1d6dd926 - Support raw RSA on decryption (Martin Buechler)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1641 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-26 13:12:26 +00:00
sth af462ab212 Removed the exceptional (and incorrect) handling of the signature inputs of 16 and 20 bytes with pkcs11's CKM_RSA_PKCS11 signaturemechanism; and made sc_pkcs15_compute_signature() a bit more powerfull: if a digestinfo+hash input is given but the card only accepts hashes, the digestinfo is removed
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1636 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-23 16:11:32 +00:00
sth 30fba619b9 Added an error code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1634 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-23 15:33:56 +00:00
okir 3fbdc4fbe9 - Link the spy against libopensc (Patch by Mathias Brossard)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1619 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-20 14:16:20 +00:00
sth 0b7b3dff9c Support comparison of large object attributes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1616 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-20 09:17:57 +00:00
sth 43c4fe5ff5 Fix: correctly set the labels of the public and private key during keypairgeneration (Remo Inverardi)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1603 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-12 19:06:33 +00:00
sth dfba889fba Fix: allow keypair generation of keys other then the default length (Victor Tarasov)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1602 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-12 18:28:03 +00:00
sth f5f5f7f57c Fix: link the simbolic PIN to the real name
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1595 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-01 19:13:21 +00:00
okir af0bd61682 pkcs11/framework-pkcs15.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1538 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-18 12:40:22 +00:00
aet 14b49ccb81 - Forgot to commit
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1526 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-14 22:11:11 +00:00
aet 603ccec619 - Fixed nightly snapshot generation
- Link keycache.h to src/include/opensc
- Move mutex function declarations to opensc.h


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1525 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-14 21:56:56 +00:00
okir fffe5b79ef - Error logging changes: replace ctx->log_errors with ctx->suppress_errors
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1520 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-14 09:57:50 +00:00
okir 12a4ef75ef - replace sc_pkcs15init_set_pin_data -> sc_keycache_put_key
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1515 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-14 08:33:20 +00:00
sth f003360c17 Fix: added all required OpenSC libs to the link dependencies (Ivo)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1496 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-10 14:24:26 +00:00
aet fac4bd6008 Tweak out some compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1486 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-02 08:29:32 +00:00
sth ebca5c681c Added C_DecryptInit() and C_Decrypt() for RSA keys
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1485 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-01 06:51:49 +00:00
sth 7bd2723f6a Some fixes that accidentially crept in
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1476 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-29 14:29:43 +00:00
sth d9fbbc6ec3 Fix: the hash-based RSA algo's can only do sign/verify, no wrap, encrypt, ...)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1475 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-29 13:54:39 +00:00
aet d208a04872 Cleanups to scconf handling
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1473 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-29 09:00:11 +00:00
sth b5984fccd6 Some changes for the spy: (1) renamed opens-spy to pkcs11-spy, (2) exported all pkcs11 functions, (3) start the log with the name of the module-to-be-loaded, (4) first look in the opensc.conf file for the module and log names
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1471 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-28 19:22:30 +00:00
aet 6857ffa11a Update PKCS#11 library version to 0.8.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1443 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-12 10:36:23 +00:00
sth c5eea382ee Fix: C_GenerateKeyPair(), C_CreateObject() returned CKR_USER_NOT_LOGGED_IN if lock_login is set to false in the config file, because then the pkcs15_init functions do a logoff internally
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1441 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-11 12:11:52 +00:00
sth 68c885ebe1 Added version info to the Win32 binaries, and set the version number to 0.8.0.0 (4 numbers seems to be needed)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1437 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-10 14:08:29 +00:00
aet f2575116d0 Remove extra semicolons
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1435 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-10 10:41:48 +00:00
aet ba1a685c8e Don't bother exposing sc_pkcs11_module_t and scdl_context_t
to public headers, use void instead.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1424 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-06 16:18:15 +00:00
sth 4f580598b0 Fix: don't print the contents of a NULL pointer
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1423 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-06 13:36:59 +00:00
sth 1decd28185 Typo fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1422 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-06 13:35:33 +00:00
sth 1941bc79b8 Build the pkcs11 spy on Win32
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1421 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-06 13:13:15 +00:00
aet 915ddc91ca PKCS#11 spy fixes by Mathias Brossard
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1416 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-04 13:50:30 +00:00
aet 3bd77d0f2b Fix make distcheck to work again, weird that it
stopped working only after the opensc-spy patching.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1415 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-03 21:53:18 +00:00
aet d63e83d4e3 - Linking cleanups for libpkcs11 / opensc-pkcs11
- Build fixes for PKCS#11 spy module by Mathias,
  so far untested. TODO: C_UnloadModule?


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1410 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-03 18:08:54 +00:00
aet 3a2a4463b1 Add PKCS#11 spy sources by Mathias Brossard <mathias dot brossard AT idealx
dot com>


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1408 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-03 17:19:08 +00:00
aet 86475ea7c0 - Remove sslengines/libpkcs11.h, it's almost identical
to libpkcs11's pkcs11.h.
- Move default PKCS#11 library defines to pkcs11.h,
  so they can be used by 3rdparty applications as
  well.
- Minor cleanups


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1407 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-03 17:07:15 +00:00
aet bac2b601a9 Move scdl to it's own subdirectory, although it's merely
for internal purposes only.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1403 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-01 08:43:38 +00:00
aet bd54ea7a62 - Move all dynamic loading related code to src/common/scdl.c,
probably needs some more work.

As a side bonus, we now have a working CT-API support for MacOS X.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1402 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-29 16:29:52 +00:00
aet 763fc16704 Rename libopensc specific error/debug to sc_error/sc_debug
We should have done this ages ago.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1392 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-25 14:21:18 +00:00
aet 2b3db944e0 - Rename sysdep_timestamp_t to sc_timestamp_t
- Add missing function prototype for sc_current_time


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1384 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-18 14:54:37 +00:00
aet 8cf5945900 Add common versioning to all libraries
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1383 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-18 14:28:47 +00:00
aet e6258f8049 - Install OpenSSL engines as bundles as well
- Don't bother "renaming" opensc-pkcs11.so
  when installing as bundle.
- More irrelevant cleanups


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1382 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-18 13:45:37 +00:00
aet 40b747a612 Minor cleanups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1381 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-18 12:06:35 +00:00
aet bfc584e3ef - Allow MacOS X build to be able to support simultaneously
loading of .dylibs, .bundles (native MacOS X) and bundle
  objects (.so) created by GNU libtool, if dlcompat is found.
  Otherwise just support .dylibs and .bundles.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1359 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-14 12:45:22 +00:00
aet 890d6ee2bc Cleanups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1358 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-14 11:47:17 +00:00
aet 0aaed9f3cf - Minor cleanups
- Add preliminary support for MacOS X bundle installation


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1357 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-14 11:37:46 +00:00
okir 11e38e8d29 - first stab at user_consent handling
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1350 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-11 14:39:01 +00:00
aet 8dd292fc4b Blah, unify the string handling a bit
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1337 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-06 12:01:40 +00:00
aet c42a3bfc0f - Fixed a mac specific compiler warning
- Fixed libdl-specific code to work with Fink's dlcompat package


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1335 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-06 08:45:57 +00:00
aet 6e29c9f599 Fixed a typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1334 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-06 07:36:38 +00:00
sth ce51dac5e9 Fixed the verification, so that it corresponds completely with the signature functions (more specifically: the special cases are provided for SHA-1 and MD5 signatures with the RSA_PKCS1_PADDING mechanism)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1333 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-05 19:26:07 +00:00
aet 3e1dd82f4f Remove some compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1332 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-05 17:28:29 +00:00
okir 77432ee438 - indentation fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1320 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-31 08:10:23 +00:00
sth af50810d0f Fix: if a pkcs11 attribute is requested that valid for that type of object, but that we don't have, then we should return length = 0 instead of returning CKR_ATTRIBUTE_TYPE_INVALID
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1319 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-30 14:46:27 +00:00
aet a9f05d1100 Remove CFLAGS_OPENSC, cleanups to INCLUDES handling.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1316 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-30 09:50:18 +00:00
aet a327d1994a Minor cleanups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1309 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-28 12:11:03 +00:00
sth 01a36a8aed Added some debugging info
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1280 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-17 22:59:12 +00:00
sth 47489c5567 Added some debugging info
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1279 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-17 22:53:48 +00:00
sth f8c5da9ccc Fix: if a pkcs11 operation fails, it should be ended
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1278 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-17 22:09:18 +00:00
aet 118c7a4dcc Resync .cvsignore files
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1271 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-17 12:39:11 +00:00
sth 34fbb4219a Fix of the previous patch: show only 1 public key if both public key and cert exist
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1265 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-16 05:20:58 +00:00
sth e8cf96af9f Fix of the previous patch: if there are a public key and cert with the same ID, show the public key derived from the cert
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1262 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-14 17:34:50 +00:00
sth 864f261679 Fix: if there was a public key and cert with the same ID, you'd see the public key twice in pkcs11: once the 'real' one and once the one derived from the cert
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1261 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-14 17:28:30 +00:00
sth b093146578 If C_SetAttributeValue() wants to change the CKA_SUBJECT, simply return OK. This is OK as we don't save the CKA_SUBJECT of a public key anyway, and it's needed for doing keypair gen + cert writing with Mozilla
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1254 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-11 20:14:48 +00:00
aet c4d2611d12 - Various build fixes for various operating systems and compilers
- Add missing .cvsignore files
- Remove tools/ and make configure to work again


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1251 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-11 16:31:06 +00:00
aj d94de46a59 remove old text files.
new documentation is in opensc/docs/opensc.html (and .xml)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1244 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-10 10:44:23 +00:00
sth 7b7f2106f2 Implemented the C_VerifyXXX() functions
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1236 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-27 15:26:17 +00:00
sth b7d92d3127 Removed the CKF_WRITE_PROTECTED tokeninfo flag
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1235 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-27 13:29:51 +00:00
sth 4fdecc39c2 Fix: register CKF_GENERATE_KEY_PAIR in a correct way
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1232 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-27 12:11:19 +00:00
sth ffadf4770c Implemented C_SetAttributeValue() that can change the CKA_VALUE and CKA_ID
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1230 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-27 12:00:43 +00:00
sth 4dc226d05f Added a little extra logging to C_GenerateKeyPair()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1224 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-25 10:57:41 +00:00
sth 09650d29a3 Changed SC_PKCS15_MAX_PINS to MAX_OBJECTS in pkcs15_create_tokens()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1220 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-24 11:31:02 +00:00
sth 11660330f4 Added a safer locking mechanism, based on sc_lock/sc_unlock (Olaf)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1219 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-24 11:26:17 +00:00
sth a8724bea78 In slot_initialize(): Bugfix in a memset and added a pool_initialize()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1218 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-24 11:11:49 +00:00
sth 97da0b6149 Now you can specify your card profile for pkcs15init, both on the command line if you use the pkcs15init tool and in the opensc.conf file. Not specifying gives the default one, like before.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1212 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-18 08:07:12 +00:00
sth bd3eab81e4 Added #include <openssl/rsa.h>, this is needed for openssl 0.9.8 and higher where openssl/evp.h wont include the algorithms anymore (Nils)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1198 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-13 06:51:26 +00:00
sth c85913c5c7 Fix in pkcs15_gen_keypair(): labels didnt work
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1184 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-04 19:17:51 +00:00
sth fe3cb3de3f some fixes to pkcs15_create_object() and pkcs15_gen_keypair()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1181 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-04 12:26:06 +00:00