Commit Graph

411 Commits

Author SHA1 Message Date
viktor.tarasov de3e6aeba9 pkcs15init: prepare instantiation of the pin-domain templates
When binding profile and p15card (in sc_pkcs15init_set_p15card()), add to the profile EF list the named DF for the path of the all existing AUTH.

; variables name and coding style issues;
; debug messages;


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4084 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 13:05:03 +00:00
aj d22a2483c0 Header file cleanup.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4081 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 08:14:36 +00:00
viktor.tarasov 02c35be138 asepcos: 'trasport PIN' (global PIN with reference '0') is presented as 'AUT' key
; no more need of athena dedicated PIN flag 'TRANSPORT KEY';



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4078 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-02 16:22:33 +00:00
viktor.tarasov de6649fed5 pkcs15init asepcos: fixup initialisation with protected profile
; new, athena dedicated, PIN pkcs15 flag 'TRANSPORT_KEY': 
in the Athena initialization procedure the 'trasport' SOPIN object is used. This object references to the pre-existing global SOPIN and is different from the final SOPIN of the card. This object should be ignored when fixing up the ACLs of the newly created file;

; the pkcs15 refereces of the new private keys are derived from the file-id;

; remove duplicated code;

; some log messages in  pkcs15-lib.c;




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4077 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-02 09:50:07 +00:00
viktor.tarasov 70ee7c1438 pkcs15init: in sc_pkcs15init_add_object() if DF update fails, remove object from the list before return
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4076 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-01 15:29:39 +00:00
viktor.tarasov dbd315c7e9 profile: 'cbs' member of 'struct sc_profile' is not used
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4075 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-01 14:01:25 +00:00
viktor.tarasov 9485f168ee pkcs15init: 'defined bu not used'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4062 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 20:33:51 +00:00
viktor.tarasov 535131adda pkcs15init: instead of static keycache use the pincache as a content of the pkcs15 AUTH object
Tested with cards:
CardOS v4.3B;
SetCOS 4.4.1B;
Oberthur;
Cryptoflex 16k, 32k e-gate, 32k e-gate token;
GPK 8K;
Athena;
Aventra;
Fetian;
Rainbow 3000 (STARCOS SPK 2.3)




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4058 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 18:24:41 +00:00
viktor.tarasov 4dd6abf41b pkcs15init: in the prototypes of the internal procedures the 'struct sc_card' argument replaced with the 'struct sc_pkcs15_card' one
This patch is not largely tested and it will be followed (hope in a few hours) with another one 
that will replace the using of the static pincache 
with the pincache as the content of the AUTH pkcs15 object.

In the intervention into the card specific part I tried to respect its creator's coding style.
Sorry, if it's not always the case.




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4057 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 16:21:57 +00:00
viktor.tarasov ef919e94d4 pkcs15init: 'protect-certificates' profile option not used
Profile option 'protect-certifcates' was activated by default for all the cards, 
was mentioned and commented out only in 'flex' profile,
and finaly is not working 'by design' of pkcs15-lib.c

So, no need to keep this option, untill the valid arguments to restore it back.
Anyway, the access to certificates is controlled by the file's ACLs defined in profile.


;in profile use the 'define' macros to define the pin encoding type;



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4050 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 23:14:45 +00:00
viktor.tarasov ac5307d457 pkcs15init: when updating 'OpenSC Info' file, cleanup its non-used tail part -- thanks to Xiaoshuo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4047 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 20:09:22 +00:00
viktor.tarasov 909953d55a libopensc: separate 'remove' and 'free' pkcs15 object
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4007 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-09 14:05:54 +00:00
viktor.tarasov 4c34f5b28c pkcs15init: useless if/else construction
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3986 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 18:15:53 +00:00
viktor.tarasov 6afab17c73 pkcs15init: remove commented-out code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3985 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 17:29:17 +00:00
viktor.tarasov b94d9896e1 pkcs15init: little fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3984 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 17:20:09 +00:00
viktor.tarasov 97ab1858e8 pkcs15init: remove the old commented-out code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3983 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 17:18:06 +00:00
viktor.tarasov 8026eabacd pkcs15init: remove profile option 'keep-public-key' that was used only by oberthur
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3982 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 16:45:47 +00:00
viktor.tarasov b065c70695 pkcs15init: abandon Old API
tested with Oberthur, CardOS and SetCOS.




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3981 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 14:50:56 +00:00
viktor.tarasov 976c214a05 pkcs15init: unused variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3974 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 09:33:29 +00:00
viktor.tarasov 9c7624c81b pkcs15init: sc_verify() has been deprecated (thanks to Martin)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3970 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-01 10:14:04 +00:00
viktor.tarasov 19e9aaf635 pkcs15init: fix putting xPINs in cache
;when putting SOPIN into the global cache, use the path from the object info;
;sc_pkcs15init_create_pin() can be called to create PUK object;




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3964 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-29 17:40:03 +00:00
viktor.tarasov 742b0ea341 pkcs15init: one more fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3963 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-29 17:12:53 +00:00
viktor.tarasov 2bcd535284 pkcs15init: fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3962 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-29 17:08:26 +00:00
viktor.tarasov 38e1144c1e pkcs15init: pkcs15 PinObject for PUK
When creating PIN, if 'puk_id' is defined in 'struct sc_pkcs15init_pinargs', 
the pkcs15 PinObject for PUK will be created. 

For a moment, PinObject is not created for SO PUK.







git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3949 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-27 17:53:51 +00:00
viktor.tarasov 42ad65e8d2 sorry, fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3947 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-27 17:08:04 +00:00
viktor.tarasov 7f0abe80bb libopensc pkcs15: path is optional for PinAttributes of PinObject
- for 'global' PINs path in not encoded into the AODF;
- when selecting pin_reference, start from value defined in profile.




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3946 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-27 17:03:04 +00:00
viktor.tarasov 5cd5728c0e libopensc: search pkcs15 objects: accept NULL value for the output argument
So that, the dummy object for the 'search pkcs15 object' calls is not neccessary. 



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3942 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-26 12:59:08 +00:00
viktor.tarasov bc140126e9 pkcs15init: in select_object_path() look for the template also outside the 'key-domain'.
To use New API with the cards that do not have 'key-domain' in their profile,
when setting object data path,
the object template has to be also looked for outside the 'key-domain'.

;migrate Oberthur to the New API;
;use macros SC_CALLED, SC_TEST_.., SC_RETURN in pkcs15-lib.c




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3940 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-25 16:42:22 +00:00
viktor.tarasov 97d5b3e6e7 sorry, commit by error; reverting back to r3935
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3937 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-25 15:30:33 +00:00
viktor.tarasov 6e9c7e5619 pkcs15-init tool: when importing bunch of certificate, break after the first errorsrc/tools/pkcs15-init.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3936 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-25 15:11:35 +00:00
martin e191142d04 pkcs15init: remove slots, according to r3931
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3932 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-24 15:26:14 +00:00
s f2bc83b138 fix:
CK_MECHANISM rsa_mech = { CKM_RSA_PKCS_KEY_PAIR_GEN, NULL, 0 };
C_GenerateKeyPair(..., &rsa_mech, ..., ..., ..., ..., ..., ...); -> ... -> sc_pkcs15init_store_public_key -> sc_pkcs15init_store_data -> select_object_path -> sc_pkcs15_get_objects: return 0 -> CKR_OK
($ pkcs15-tool --list-public-keys:
Public RSA Key [Public Key]
        ...
        Path        : 3f0050000200
)

CK_MECHANISM gost_mech = { CKM_GOSTR3410_KEY_PAIR_GEN, NULL, 0 };
C_GenerateKeyPair(..., &gost_mech, ..., ..., ..., ..., ..., ...); -> ... -> sc_pkcs15init_store_public_key -> sc_pkcs15init_store_data -> select_object_path -> sc_pkcs15_get_objects: return 0 -> CKR_OK
($ pkcs15-tool --list-public-keys:
Public RSA Key [Public Key]
        ...
        Path        : 3f0050000200

Public GOSTR3410 Key [Public Key]
        ...
        Path        : 3f0050000200
)



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3923 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-22 12:01:17 +00:00
viktor.tarasov 6fc954cbc6 pkcs15init: new profile type BSO
at the profile level the difference between EF and BSO is:
- BSO path is always the path of the host DF and do not indexated when template is instanciated;
- EF path is always ending with file-id that is always indexated  when template is instanciated.

New non-static 'sc_profile_get_file_instance' procedure to instanciate non-template entries.
In profile.c get_uint() accepts hexadecimals.
In CardOS profile (I venture to) increase the xDF sizes 
	and change ACL to permit the key re-importing.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3919 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-21 09:41:40 +00:00
viktor.tarasov 54ee99d486 pkcs15init: use pinpad
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3917 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-17 21:08:13 +00:00
viktor.tarasov f205d48258 pkcs15init: dissociate object file-id and object ID;
;use macros SC_CALLED, SC_RETURN and SC_TEST_RET;
;change debug level in debug macros;

For a new pkcs15 object of a given type the file index is chosen as a first value in the range from 'file-id' to 'max-id', 
excluding the values that are already assigned to the file indexes of the existing pkcs15 objects of the same type.

'file-id' is defined in the template ('key-domain') of the card profile ;
'max-id' is 'file-id' + hard coded value 0xFE .



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3916 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-16 21:52:47 +00:00
viktor.tarasov 1a7793c77c pkcs15init: possible error of 'find_object_by_id' should not be ignored
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3914 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-15 15:29:16 +00:00
viktor.tarasov 0518ed57c5 no more 'reuse pkcs15 object'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3904 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-10 20:33:32 +00:00
aj f0484968a9 merge changes 0.11.11 -> 0.11.12
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3899 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-18 13:33:03 +00:00
s 9dff2deae1 fix: return CKR_USER_NOT_LOGGED_IN (now CKR_GENERAL_ERROR) from C_GenerateKeyPair for the case where there was no call C_Login
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3889 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-09 13:59:03 +00:00
s 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 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 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 9da39d8462 Merged r3719:3749 from trunk
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3750 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-03 07:48:28 +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
martin d3201511c7 r3717:3719 from trunk
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3720 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-12 11:46:00 +00:00
aj 7931ded481 Add new rutoken_ecp driver by Aktiv Co. / Aleksey Samsonov
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3696 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-24 15:26:37 +00:00
aj 50f9ef865b check if len or p is 0/NULL and return.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3661 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-06 09:30:54 +00:00
aj 54a35a2f4f fix typo.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3660 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-06 09:26:41 +00:00
aj 3347ededf6 Improve this function even more.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3659 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-05 18:37:55 +00:00
aj aadf09d1de resolve an "undefined code" situation.
the old code was undefined, but ok (variables where never used
again in the "goto error" case). but the new code should
be clearer on this.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3658 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-05 15:28:17 +00:00
aj 8a6bc59e66 Create new type "privdata" in all profiles with different
ACL settings, and check C_CreateObject parameter CKA_PRIVATE aka
pkcs15_create_data args.auth_id variable, aka sc_pkcs15init_new_object
object->flags & SC_PKCS15_CO_FLAG_PRIVATE to decide if "data" or "privdata"
profile needs to be used.

Tested with cryptoflex 32k and opensc-explorer, now I no longer can
"get" the data object file stored with "--private".


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3605 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-28 16:07:51 +00:00
aj 27d00f9265 Add new entersafe driver for ePass 3000 tokens.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3556 c6295689-39f2-0310-b995-f0e70906c6a9
2008-08-20 05:41:20 +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
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
nils 8770859315 add support for asepcos
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3200 c6295689-39f2-0310-b995-f0e70906c6a9
2007-07-03 20:44:34 +00:00
aj 047ee1d73e fix more warnings found by gcc/sparse.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3178 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 11:07:00 +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
ludovic.rousseau 45f5fcea0e comment out static and unused functions (sc_pkcs15init_read_unusedspace,
sc_pkcs15init_update_unusedspace, merge_paths,
sc_pkcs15init_add_unusedspace and sc_pkcs15init_remove_unusedspace)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3118 c6295689-39f2-0310-b995-f0e70906c6a9
2007-02-06 14:29:45 +00:00
nils 139ff4c39c check key size, set so-pin ref
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3112 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-19 21:08:20 +00:00
aj a157eebec5 apcos driver is not yet commited.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3079 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-18 21:34:49 +00:00
nils 5977ce4f21 pad only if necessary
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3078 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-18 11:23:42 +00:00
ludovic.rousseau 126593aa01 - use strlcpy() instead of strncpy() to always have a terminating
NUL-byte

- use sizeof(field) instead of SC_PKCS15_MAX_LABEL_SIZE-1 or equivalent as
  the 3rd argument of strlcpy()


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2993 c6295689-39f2-0310-b995-f0e70906c6a9
2006-07-12 08:12:38 +00:00
sth 50490acca0 Added support for MuscleCard applet. Thanks to Thomas Harning, David Corcoran of Identity Alliance
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2968 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-07 08:33:37 +00:00
aj 65a2cabffc make sure result is null-terminated.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2933 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:23:15 +00:00
aj 6cfbd9d4f9 at least partialy close memory leak.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2932 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:22:25 +00:00
aj 45742fc5d0 check df before dereferencing it.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2931 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:21:16 +00:00
sth 9409c278df Set the user pin reference when writing a cert. If not, there's a problem with the onepin profile option: the CDF (and certs) will be created with NONE ACs instead of ACs that refer to the user PIN
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2883 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-06 18:38:20 +00:00
ludovic.rousseau 2b8a2f4d90 sc_pkcs15_parse_tokeninfo() and sc_pkcs15_encode_tokeninfo() now use a
(sc_pkcs15_tokeninfo_t *) instead of struct (sc_pkcs15_card *)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2872 c6295689-39f2-0310-b995-f0e70906c6a9
2006-03-07 07:22:58 +00:00
nils a2194b9803 fix memory leak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2837 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-12 17:07:31 +00:00
aj f0c9f049a7 big rename etoken -> cardos, part II.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2825 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-23 21:48:08 +00:00
nils de4b5c280f - implement thread-safe path printing function sc_path_print() and use
it src/libopensc/ and src/pkcs15init/
- use size_t for the certlen parameter of sc_pkcs15init_update_certificate()


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2811 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-11 23:41:17 +00:00
sth f674204d63 Add possibility to change pkcs15 attributes (currently only the label)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2803 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-03 16:24:54 +00:00
nils 5861f986e9 remove unused variable
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2794 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-28 19:41:11 +00:00
nils 103979ec37 fix key usage flags and ensure that we are in the correct lifecycle
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2770 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-17 20:54:29 +00:00
sth 9df2cde416 Add support for reading and writing from/to an EF(UnusedSpace) file; this functionality can be used for deleting and creating pkcs15 objects (that reside in a file)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2769 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-17 19:53:12 +00:00
aj e5ffc57e92 free profilke and pin_obj in the error path.
check res_obj and keybits/keyargs before dereferencing.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2726 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-05 21:57:07 +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
nils 90d1b0cc9c add support for the Italian Incrypto34 smartcard;
patch supplied by Giuseppe AMATO <giuseppe.amato@st.com>


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2661 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-24 21:58:35 +00:00
sth d9bd913306 No SC_AC_OP_DELETE for EFs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2616 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-22 12:45:31 +00:00
nils 55418c5ac3 log dlerror message when dlopen failed
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2596 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-16 20:31:06 +00:00
sth 00be34c4a2 Added certificate update functionality
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2593 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-15 19:40:20 +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 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 d8639b16ce The lastUpdate field is in the EF(TokenInfo), not in the ODF (thx Nils)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2525 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-29 20:48:00 +00:00
sth bd76165319 Have the option not to update the ODF (the lastUpdate field), this is usefull for cards that don't have an ODF that is un-writable or too small
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2515 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-24 09:50:48 +00:00
nils 1d05f32bc4 mark card/profile as dirty when an object has been deleted
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2510 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-22 09:37:54 +00:00
sth b5e2a2afff Added support for deleting pkcs15 objects, each card driver should implement its delete_object() operation in order to support it
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2506 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-22 09:20:13 +00:00
sth edb11bd2ea Fix: object type contains not only the class
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2496 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-18 21:14:19 +00:00
nils 148b7900f7 Add support for the lastUpdate field to pkcs15init. Add flag to
indicate whether some data has been changed to the profile structure
and set the flag in the functions which change the card contents.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2468 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-05 19:07:24 +00:00
nils c2751a60da fix use of x509v3 key usage extension value
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2445 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-20 17:58:55 +00:00
sth be65c3804e Cast correctly
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2408 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-15 13:32:14 +00:00
sth df232cfe67 Don't ignore the profile_option -- remark from Victor Tarasov
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2382 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-05 17:45:10 +00:00
sth ad86ded031 If an object is added to a pkcs15_card, don't call sc_pkcs15_free_object() on it
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2339 c6295689-39f2-0310-b995-f0e70906c6a9
2005-05-09 11:46:23 +00:00
sth 3439f9cdd7 Added initial support for SetCOS 4.4 cards
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2291 c6295689-39f2-0310-b995-f0e70906c6a9
2005-04-04 09:30:54 +00:00
sth abf3bf9549 If the SC_CARD_CAP_USE_FCI_AC flag is set, sc_pkcs15init_authenticate() will check the file's ACs on the card instead of relying on the ones in the profile file
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2290 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-30 18:25:50 +00:00
sth de62a5306d Moved init-card() till after the pin-initialisation, this allows init-card() to do operation with a pin without doing the pin stuff again. Shouldn't break anything -- if it does, we'll undo this.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2284 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-26 20:10: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
nils e679eb17e6 remove unused define
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2158 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-08 19:33:30 +00:00
nils d67a4ea523 fix last commit
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2104 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-27 22:52:44 +00:00
nils d605ba7f0a fix more memory leaks
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2091 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-21 18:31:05 +00:00
nils 517da66876 fix memory leaks
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2089 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-21 11:06:01 +00:00
nils 8f4f732c3b in case of SC_AC_UNKNOWN it doesn't make much sense to verify something + add missing suppress_errors--
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2074 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-14 23:14:34 +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 5847b646f9 cleanup: -index shadows a variable in /usr/include/string.h
-some signed vs. unsigned issues
         -and some const cleanup


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2039 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-22 09:48:27 +00:00
aet 55e170e0ac - Build / warning fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2014 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-15 13:53:36 +00:00
nils ba23f8246a support for dynamic pkcs15init drivers
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1953 c6295689-39f2-0310-b995-f0e70906c6a9
2004-10-25 10:43:50 +00:00
nils 1249c9c2ab fix starcos spk 2.3 "onepin" profile support
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1908 c6295689-39f2-0310-b995-f0e70906c6a9
2004-09-28 20:06:04 +00:00
nils 5ebccf1842 rename "StarCOS" -> "STARCOS SPK 2.3"
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1900 c6295689-39f2-0310-b995-f0e70906c6a9
2004-09-17 19:13:30 +00:00
nils 652759a364 two small fixes to let pkcs15-init work with starcos spk 2.3
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1892 c6295689-39f2-0310-b995-f0e70906c6a9
2004-08-21 10:54:28 +00:00
nils bfe73f3b71 improve pkcs15-init + pkcs15-tool support for data objects
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1887 c6295689-39f2-0310-b995-f0e70906c6a9
2004-08-14 13:43: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
nils aeb9c47c7e try to get the card serialnr via sc_card_ctl (unless it has
been explicitly specified by the user)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1842 c6295689-39f2-0310-b995-f0e70906c6a9
2004-07-19 16:58:27 +00:00
aj 52c1b2d700 Very basic and untested oberthur driver. Could possibly work,
as only non-essential parts stripped (or at least that was the plan).

Written by Viktor Tarasov of idealx.

All bugs by Andreas Jellinghaus, please don't blame anyone else.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1793 c6295689-39f2-0310-b995-f0e70906c6a9
2004-06-16 20:59:59 +00:00
nils 564d07ebe6 bind the new starcos spk 2.3 support to the pkcs15init code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1765 c6295689-39f2-0310-b995-f0e70906c6a9
2004-04-17 09:23:26 +00:00
aj 73d0922741 len is the number of character, we need to alloc len+1 for
the \0 terminator. Bug found by Victor Tarasov.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1757 c6295689-39f2-0310-b995-f0e70906c6a9
2004-03-28 20:26:43 +00:00
okir f37cb0fce3 - When zapping the contents of a DF, write the whole file (data + padding)
in one go. Otherwise the GPK driver may barf if the file offset in
  sc_update_binary isn't word aligned.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1714 c6295689-39f2-0310-b995-f0e70906c6a9
2004-01-07 10:10:34 +00:00
okir 30e04cef59 - Implemented keep-public-key and sc_pkcs15init_remove_object as
suggested by Victor Tarasov.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1710 c6295689-39f2-0310-b995-f0e70906c6a9
2004-01-06 14:30:24 +00:00
okir 8a4a5f0331 - Added support for JCOP/BlueZ cards, contributed by Chaskiel M Grundman
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1696 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-29 12:28:37 +00:00
okir 5db7585bb0 - Minor bug fix in new_pin(), patch by Victor Tarasov
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1694 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-29 11:52:33 +00:00
okir ae5dcea891 - created new function profile->ops->init_card for card-specific
initialization at the pkcs15 creation stage
- Added cryptoflex init_card from Stef. This function reads the card's
  serial number from 3F000002 and puts it into the pkcs15 serial number


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1688 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-19 09:29:56 +00:00
aet 7d3fc55736 - Minor build and C++ warning fixes
- pkcs15init: Use u8 for pin variable
  declarations like libopensc does


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1686 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-18 21:37:34 +00:00
okir af37c4e026 - do not access file afterdeleting it (S Bakkal)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1682 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-18 08:00:27 +00:00
okir bca2a9f233 - added GPK on-board keygen (based on code by Chaskiel)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1678 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-16 14:32:16 +00:00
okir cec660fda1 - More cyberflex fixes from Martin Buechler
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1665 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-09 13:57:20 +00:00
okir 0d41e05310 - turned key-domain printf into sc_debug call
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1664 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-09 12:01:51 +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
okir b15bd6c453 - Added support for Cyberflex Access 16K, based on a patch by
Martin Buechler


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1662 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-08 11:43:21 +00:00
okir babc626e94 - use full OPENSC_INFO_FILEPATH when reading info file
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1660 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-08 10:52:15 +00:00
sth c46b58fa34 Moved the cardinfo file to the pkcs15 DF, changed it's FID to 4946, and protected it against unauthorized changes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1647 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-02 15:51:52 +00:00
okir b6796d0404 - fixed suppress_error handling in sc_pkcs15init_write_info
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1638 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-25 10:37:23 +00:00
okir 22312dbe17 - set ACLs on the profile info file
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1637 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-24 10:21:36 +00:00
okir 961e116006 - Support direct encoding of certificates
- Allow more than one profile option (e.g. pkcs15+small+direct-cert)
- While creating the basic pcks15 structure, store profile options
  in a special file on the card (3F002F01). All susequent operations
  (adding PINs etc) will use this information instead of what's
  given on the command line.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1615 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-19 20:37:02 +00:00
okir 728a6a4ade - Another broken commit message :-/
What the previous commit was all about:
  If we store a pkcs12 files on the card, it stores a key @45,
  and a CA certs @46. When storing another p12 file, we must make
  sure we don't grab the next free key ID (46), because the
  corresponding CERT ID is already taken. We must skip all IDs for
  which a key or cert exists.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1574 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-30 11:47:37 +00:00
okir 60892cd0a3 - added recommendation about 2 cert/key pairs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1570 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-30 11:13:11 +00:00
okir 8a5f130af8 - do an sc_select_file inside do_get_pin_and_verify in case we called
a pkcs15 function that enumerated the AODF


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1558 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-22 05:43:57 +00:00
okir ae2cfe8a46 - sc_pkcs15_find_pin_by_reference now searches by reference _and_path_
- profile->p15_card renamed to p15_spec, as it reflects what _should_
  be on the card
- added profile->p15_data, which is what _is_ on the card
- make do_get_pin_and_verify use the sc_pkcs15_find_pin_by_reference
  properly.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1549 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-21 11:05:35 +00:00
okir 8740ced3ee - dont pin protect pubkey
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1541 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-18 17:02:44 +00:00
okir 2a12ed3108 - Prepare for userConsent support: changed ops->create_pin to take
a sc_pkcs15_object_t instead of sc_pkcs15_pin_info_t argument.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1534 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-17 11:21:48 +00:00
okir afcf39c6dd - some more cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1532 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-16 14:32:42 +00:00
okir 574d6f38ee - added debian packaging files from Joe Phillips
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1530 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-16 11:41:24 +00:00
okir 09cd60504d - one suppress_errors-- too many
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1528 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-15 09:36:53 +00:00
aet eaf1f7afda - Remove old callback error/debug functions
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1523 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-14 10:42:03 +00:00
okir f552395705 - Error logging changes: replace ctx->log_errors with ctx->suppress_errors
- remove error/debug callbacks; always use sc_error/sc_debug


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1519 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-14 09:57:29 +00:00
okir aad883149e - removed some dead code inside #if 0/#endif
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1514 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-14 08:17:59 +00:00
aet 936ad78b02 - Some build/portability fixes for the pkcs15init rewrite
- Add sc_pkcs15_get_<drv>_ops(), yet untested


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1512 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-13 20:41:00 +00:00
sth b66e24bf55 Small changes to make it work on non-C99 compilers
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1510 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-13 20:16:40 +00:00
okir 23c1e81512 - pkcs15 rewrite
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1508 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-13 16:13:12 +00:00
sth 2457faa1e7 Fix: when doing a sc_pkcs15init_generate_key(), the auth_id for the public key wasn't put into the PuKDF
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1489 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-02 12:21:12 +00:00
sth 509119ac3b Correctly add the label to a pkcs15 data object
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1487 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-02 09:18:12 +00:00
aet 0c37fe2f79 Warning fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1428 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-06 19:18:38 +00:00
aet 597877eb49 Move #include <windows.h> to winconfig.h in
order to minimize win32 specific code sections.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1411 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-03 18:18:57 +00:00
sth 093adc8c89 Fix: don't DER-en/decode the data in a pkcs15 object
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1385 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-20 14:15:02 +00:00
aj 1091548eda seperator is written to an u8, so it should be a char or u8 anyway.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1324 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-01 07:03:16 +00:00
okir 3a68ba695b - warn if EF is too small for the amount of data we want to write
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1323 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-31 21:16:15 +00:00
sth 82c00d806c Placing #include <windows.h> in wincofig.h causes compiler problems, better put it in each file that uses _MAX_PATH
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1234 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-27 12:59:22 +00:00
sth 5ed3d17ad8 Added sc_pkcs15init_change_attrib() that can change the label and ID of a pkcs15 key or cert
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1229 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-27 11:59:37 +00:00
aj 59da343eea PATH_MAX is defined via limits.h (I hope that exists on all
systems). MAX_PATH is a typo. int r was never used.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1223 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-25 10:19:08 +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 694a649ab8 Add the AuthID when writing pkcs15 data objects
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1196 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-12 21:23:01 +00:00
sth 5716f100cc Fixed a type in previous patch
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1183 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-04 18:37:52 +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 3e30e87cbd - do_get_any_verify_pin: try to look up p15 pin info from card
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1151 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-18 10:05:14 +00:00
okir a496e8e42b - added sc_pkcs15init_set_secret
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1146 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-17 09:10:32 +00:00
okir 8c7e571c89 - erase card fixes: forget cached secrets, and use sc_free_apps
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1123 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-15 13:33:04 +00:00
okir 7b34c2ecf7 - get_pin callback now takes additional label argument
- call get_pin for ALL pins, not just those listed in the profile
- add split key support to sc_pkcs15init_generate_key


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1116 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-15 11:30:46 +00:00
aj 131719b8c6 - add robert to Authors as contributor of bug fixes
- configure code finally working.
   engine is detected and path to libcrypto.a is also set.
 - roberts fix for reader-usbtoken.c
 - card-gpk.c migraton to DES_ routines with #define for 0.9.6 openssl.
 - man pages: do not ship pkcs15-profile.5 (.in is in the tarfile)
 - assuan: replace "strcpy(stpcpy(.., ..), ..)" with
   "strcat(strcpy(.., ..), ..)" which looks good, but nobody uses
   assuan I guess ?
 - declaration of sc_pkcs15init_set_lifecycle kills a warning
 - #include <openssl/bn.h> kills a warning (or compile problem?)
 - removed unused txt[256]; from p15_eid (kills a warning)
 - now "ln -s" the signer plugin to the plugin directory.
 - moved key_out direction to the beginning of a function (kills
   a warning or compile error)
 - changed pkcs11-tool option "quiet" to "verbose" to conform to
   other tools.
 - made algo argument to wrap_unwrap a "const" (kills several warnings)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1063 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-22 17:00:38 +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 f81929eb16 - moved the lifecycle stuff to libpkcs15init
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1024 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-16 14:38:35 +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
okir b86d2e994b - First shot at pkcs15 data objects from Danny De Cock
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@788 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-18 10:17:01 +00:00
okir e9c8806c75 - properly set the TokenInfo label from user input
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@752 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-04 14:56:17 +00:00
okir 27c2369cee - make sure we don't assign the same ID more than once
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@749 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-04 13:25:31 +00:00
okir eaebdec8b0 - Change the way we handle default transport keys, attempt to reduce the
risk of users entering the wrong keys and locking their cards. Here's how
  we do it:
   - ask the card driver (via cardctl GET_DEFAULT_KEY) for default key
   - invoke the front-end's get_key callback. If the card driver gave us
     a default key, pass it as default value
   - front end is free to use default key as-is, or prompt user


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@743 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-04 11:56:34 +00:00
okir 8ee38b9567 - handle SC_ALGORITHM_NEED_USAGE flag
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@706 c6295689-39f2-0310-b995-f0e70906c6a9
2002-11-08 14:14:28 +00:00
aet 1d2c9e4c48 Cleanups for initial win32 port, untested.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@696 c6295689-39f2-0310-b995-f0e70906c6a9
2002-10-19 14:04:52 +00:00
okir 638a5b307c - implemented generic erase_card functionality
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@667 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-18 18:18:21 +00:00
okir 5b40de43ed - various changes for on-board key generation
- key download and key generation for eToken works now


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@659 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-17 10:58:04 +00:00
okir 954cfb9f8e - first steps toward eToken key download
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@640 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-07 20:29:07 +00:00
jey 7977f48aa3 - Protected OpenSSL includes with #ifdef HAVE_OPENSSL
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@637 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-06 13:38:03 +00:00
okir 1b79b017e3 - started to implement on-token key gen support
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@636 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-06 09:18:53 +00:00
okir 3eeaa8f0b8 - fixed bad return value in do_init_app
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@625 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-04 19:42:50 +00:00
okir 0c07f24de0 - added some eToken code (not functional yet)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@622 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-04 08:51:03 +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
aet 25cf9756ed Minor GCC warning fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@606 c6295689-39f2-0310-b995-f0e70906c6a9
2002-05-20 09:19:41 +00:00
okir 74b7e39263 - allow setting the cert_info authority flag
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@583 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-22 18:37:57 +00:00
okir c66dcb5f33 - changed do_select_parent per request from Juha. Hope this doesn't break
anything... :)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@581 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-22 08:00:52 +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 6b08ebf2eb - fixed DF handling
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@573 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-19 10:01:01 +00:00
jey 546f920fc1 - PKCS #15 objects and DFs are now stored with linked lists
in struct sc_pkcs15_card; this way we can have 'floating'
  objects that don't belong in any DF, for e.g. generating
  public key objects from certificates
- Removed some unused function prototypes


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@572 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-19 09:22:44 +00:00
okir b08c5ef702 - bug in check_key_compatibility()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@561 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-18 09:12:26 +00:00
okir 2a3e6e273d - starting to support extractable keys
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@557 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-17 20:47:18 +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 55a14b0ebf - all sc_pkcs15init_store_foobar functions now take an additional struct sc_pkcs15_object ** argument
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@516 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-11 15:14:12 +00:00
okir 01d4f00dea - SO PIN is now optionally: if you want to use it, pass a PIN to
sc_pkcs15init_add_app. If you don't, don't.
- sc_pkcs15init_erase_card checks whether the erase_card funcion ptr is NULL
- check SO pin len in sc_pkcs15init_add_app
- In sc_pkcs15init_store_pin, if the caller didn't specify the auth_id,
  select one automatically
- added sc_pkcs15init_unbind


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@499 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-08 15:49:39 +00:00
okir 13ab0f5993 - store SO PIN entry in AODF
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@493 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-08 09:29:37 +00:00
jey 60fc3811eb - Added support for user-defined serial numbers in
pkcs15-init and PIN flags in profiles


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@485 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-07 13:15:31 +00:00
jey 74d0b3d729 - Added user PIN finding to sc_pkcs15init_store_certificate()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@482 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-06 14:52:50 +00:00
okir c1a8dc8c23 - implemented sc_pkcs15init_get_{serial,amnufacturer}, fixed bug
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@466 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-05 14:56:21 +00:00
jey 41b184855b - Fixed a bug in sc_pkcs15init_bind()
- Added PIN code padding in do_verify_pin()


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@461 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-05 14:00:27 +00:00
aet 076a26bbac Rework the header structure
Currently fails to compile, unless you symlink
all the necessary headers to src/include/opensc
by yourself.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@459 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-05 13:48:00 +00:00
aet d81d10ba90 Upgrade sources to use new headers, part #1
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@458 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-05 10:44:51 +00:00
okir 1b113614b3 - miniscule API changes so that applications don't need to include profile.h anymore
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@454 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-05 10:05:50 +00:00
jey dc444cde54 - Cryptoflex now works with the new pkcs15init stuff
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@452 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-04 22:10:36 +00:00
jey e5496e9be9 - Partial support for PKCS #15 generation on MioCOS cards
- Some other small fixes to the pkcs15init code


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@450 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-04 20:42:29 +00:00
okir 059813818b - the previous fix broke do_verify_pin
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@446 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-04 19:58:23 +00:00
aet 984b5b2a2b Minor warning fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@445 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-04 15:06:13 +00:00
okir 5cba842fde - shouldn't set key_reference
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@434 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-03 14:15:03 +00:00
okir 3b16e35af1 - rewrote parser to use Antti's scconf
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@427 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-03 11:52:30 +00:00
okir f4ff4f4617 pkcs15-gpk.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@422 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-02 14:45:55 +00:00
okir efa136e3cd - added sc_pkcs15init_present_pin for juha
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@421 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-02 14:27:00 +00:00
okir b6bf368fd2 - rewrite of the pkcs15-init stuff
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@415 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-02 13:26:42 +00:00