Commit Graph

276 Commits

Author SHA1 Message Date
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 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
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 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 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 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 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 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 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 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 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
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
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 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 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
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 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
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 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
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
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
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
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
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
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 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
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
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 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
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
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 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
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 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
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
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
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
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 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 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
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
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
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
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
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
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 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 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 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
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 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
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
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 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
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
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 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 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 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
sth c8c2cf725b First implementation of C_GenerateKeyPair()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1179 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-03 13:57:52 +00:00
okir 9d6227ec64 - return value of pkcs15_login was ignored
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1165 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-27 09:58:39 +00:00
sth fc31b65a88 added sc_logout() functionality
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1153 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-20 08:30:46 +00:00
sth 053b10e2bf If signing/decryption fails because the card lost its security status, try to log in again and then do another attempt to sign/decrypt
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1113 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-15 10:34:03 +00:00
sth fb417772fb Allow non-repudation as a signature usage
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1050 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-18 15:42:04 +00:00
okir 41a22174dc - bugfix for unwrap
- support getattr(CKA_VALUE) for public key objects


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1045 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-17 14:38:00 +00:00
okir c94d72f3ea - fixed signing and hopefully unwrap for split keys
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1041 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-17 13:13:48 +00:00
okir 9fae9999ea - fix for the previous change
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1040 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-17 13:03:49 +00:00
okir d2075b2c13 - implemented split-key support for CardOS
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1038 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-17 12:38:08 +00:00
okir c53043a97e - in getattr(CKA_LABEL), do not include trailing NUL
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1020 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-16 14:17:02 +00:00
sth 92c5e24572 Have allways a label in CK_TOKEN_INFO
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1010 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-14 17:29:19 +00:00
sth 0abafd0e9a Fix: root certs could be shown more then once
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@965 c6295689-39f2-0310-b995-f0e70906c6a9
2003-03-27 16:08:10 +00:00
sth a2ff6d66b4 take the last 8 bytes of the card as the pkcs11 serialNumber
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@935 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-28 15:16:56 +00:00
okir 9173c9934e - new pkcs15 object creation stuff
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@929 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-23 17:50:33 +00:00
sth 252cbd51d2 login should return CKR_ARGUMENTS_BAD if wrong pin length
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@924 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-21 12:27:24 +00:00
sth a7a5701e0c added support for max pin length
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@922 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-20 23:19:01 +00:00
sth 5c1b8d9411 selection between SHA-1 and RIPEMD160 sigs when 35 bytes supplied
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@887 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-28 15:37:54 +00:00
okir a7551e1822 - Patches from Stef implementing PKCS11 RNG related functions
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@866 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-16 20:10:28 +00:00
okir 0af2a35b9c - Another go at the empty slot/empty token issue
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@857 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-13 21:38:43 +00:00
okir 9c5782e2b2 - pin pad changes from Stef
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@839 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-06 19:28:48 +00:00
okir 1c22c55655 - Try to fix pkcs11.hide_empty_slots
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@818 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-03 11:40:11 +00:00
okir 36930668fb - Added run-time option pkcs11.cache_pins, default false
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@816 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-03 11:09:45 +00:00
okir 8e6dc966b5 - Added run-time option pkcs11.lock_login
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@815 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-03 10:49:07 +00:00
okir 8abb5fa801 - Getattr(CKA_MODULUS_BITS) would fail for keys w/o certificate
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@813 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-02 15:23:08 +00:00
okir 4419574608 - NUL-terminate strings returned by getattr(CKA_LABEL)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@809 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-23 17:02:05 +00:00
okir d1fa35e1d0 - slightly changed previous patch; new flag hide_empty_slots
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@805 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-22 11:50:41 +00:00
okir 0babb91194 - Allow the admin to configure how many slots are used per card
(opensc.conf; pkcs11.num_slots)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@804 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-21 16:45:37 +00:00
okir d22d1b13a4 - Another fix to mechanism handling: ripemd160 signatures should work now
- Got rid of get_mechanism_{list,info} in framework_ops, as they're not
  needed anymore.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@795 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-19 09:27:08 +00:00
okir fc26b49ee5 - Values of CKA_SIGN and similar attributes now based on the pkcs15
usage flags rather than on some hardwired defaults.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@792 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-18 19:26:18 +00:00
okir 647d4bcdef - Register only those mechanisms the card actually supports
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@783 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-17 20:16:31 +00:00
okir 21dfabee27 - New mechanism framework
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@775 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-17 11:49:12 +00:00
okir 2e6af762c3 - Added support for CKM_RSA_X_509 (Stef Hoeben)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@768 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-10 17:47:10 +00:00
okir c55b8d8377 - Fixed CKM_SHA1_RSA_PKCS: if OpenSSL is available, use it to hash the supplied
data.  If OpenSSL is unavailable, CKM_SHA1_RSA_PKCS is not advertised to the
  user.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@750 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-04 13:50:23 +00:00
okir 08f4d67cec - Avoid segfaults: if we cannot parse the certificate, do not create a
cert object.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@735 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-02 14:40:30 +00:00
okir 828819a1ec - get_mechanism_list now reports correct number of mechanisms
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@719 c6295689-39f2-0310-b995-f0e70906c6a9
2002-11-22 09:07:43 +00:00
okir 1556f98ba5 - put the definition of USE_PKCS15_INIT into a place where it can actually work
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@675 c6295689-39f2-0310-b995-f0e70906c6a9
2002-08-19 17:13:46 +00:00
fabled e2af6a1c8e - Ported pkcs11 module to win32.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@670 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-20 13:16:22 +00:00
aet 2846d6ce3b Preliminary MacOS X build support, untested so far.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@617 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-03 15:18:47 +00:00
jey 7c94d7d8d3 - Several patches to fix behaviour on 64-bit architectures (by
Jochen Friedrich)
- Fixed one bug in sc_copy_asn1_entry(), one in
  sc_pkcs15init_add_object() and one in pkcs15-crypt
  (patches also by Jochen)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@609 c6295689-39f2-0310-b995-f0e70906c6a9
2002-05-26 12:31:23 +00:00
okir 7f6453d715 - sc_pkcs15_decipher now takes a flags argument, so we know when to
strip off any pkcs#1 padding.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@585 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-23 08:17:06 +00:00
aet 3dccd63989 - C++ support. Compiles with gcc/g++ for Linux, otherwise
completely untested.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@574 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-19 14:23:31 +00:00
okir 9c5754e6ef - handle non-RSA keys as well
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@549 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-17 18:34:32 +00:00
okir 596220e821 - pkcs15-init does not require openssl anymore
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@523 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-15 13:42:10 +00:00
okir 9f7fbf2b8c - C_CreateObject now understands X509 certs (untested)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@520 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-13 19:00:37 +00:00
okir f5dc78bf44 - minor fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@519 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-11 15:53:05 +00:00
okir 2b8b355992 - implemented C_CreateObject for public and private key objects
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@518 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-11 15:17:33 +00:00
okir 53a112eda2 - implemented C_InitPIN (based on pkcs15init)
- C_Login now understands the SO PIN.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@502 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-08 15:51:19 +00:00