Commit Graph

945 Commits

Author SHA1 Message Date
viktor.tarasov 741d8fc0b8 pkcs11-tool: #75: key for signature can be selected by object_id
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4214 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-11 17:44:39 +00:00
martin 379519e84e Revert r4191 "Fix logic in pkcs15-tool/pkcs15-init -v"
This reverts commit a61f619296.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4206 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 13:11:07 +00:00
martin d1d47d44c5 Fix #198: set correct access flags to private keys
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4193 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-01 14:16:43 +00:00
martin cd83821502 Don't use sc_debug in src/tools/*, use fprintf(stderr) instead.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4192 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-01 14:16:23 +00:00
martin a61f619296 Fix logic in pkcs15-tool/pkcs15-init -v
Only override ctx->debug if -v given.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4191 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-01 13:44:02 +00:00
ludovic.rousseau 629aef2ee8 Use an argument to cardos_format()
Thanks to Andreas Jellinghaus for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2010-March/013849.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4190 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-01 11:21:57 +00:00
martin 8323182d4a Remove leftover from r4113, allow easy side-by-side comparison
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4189 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-01 10:14:22 +00:00
ludovic.rousseau 502db6bd36 Do not cast a pointer to a type of possibly different size.
Would fail on PowerPC in 64-bits for example.

pkcs15-crypt.c: In function ‘sign_ext’:
pkcs15-crypt.c:293: warning: dereferencing type-punned pointer will break strict-aliasing rules
pkcs15-crypt.c:299: warning: dereferencing type-punned pointer will break strict-aliasing rules


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4183 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 14:10:17 +00:00
ludovic.rousseau ad648c4a18 Use the correct type (const_DES_cblock *) instead of (const_DES_cblock)
for DES_ecb_encrypt() input and output parameters.

I have no idea how it could have worked.

Fix
cardos-tool.c: In function ‘cardos_sm4h’:
cardos-tool.c:421: warning: passing argument 1 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:421: warning: passing argument 2 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:426: warning: passing argument 1 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:426: warning: passing argument 2 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:432: warning: passing argument 1 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:432: warning: passing argument 2 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:434: warning: passing argument 1 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:434: warning: passing argument 2 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:472: warning: passing argument 1 of ‘DES_ecb3_encrypt’ from incompatible pointer type
cardos-tool.c:472: warning: passing argument 2 of ‘DES_ecb3_encrypt’ from incompatible pointer type
cardos-tool.c:483: warning: passing argument 1 of ‘DES_ecb3_encrypt’ from incompatible pointer type
cardos-tool.c:483: warning: passing argument 2 of ‘DES_ecb3_encrypt’ from incompatible pointer type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4181 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 12:55:13 +00:00
ludovic.rousseau 4ce1e8c831 Rename parameter wait in do_wait
util.c:11: warning: declaration of ‘wait’ shadows a global declaration
/usr/include/sys/wait.h:255: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4180 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 08:23:07 +00:00
ludovic.rousseau cf8a7f894f use a (const char *) for the reader_id and fix 2 warnings
opensc-explorer.c:1606: warning: passing argument 3 of
‘util_connect_card’ discards qualifiers from pointer target type
rutoken-tool.c:492: warning: passing argument 3 of ‘util_connect_card’
discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4179 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 08:20:27 +00:00
ludovic.rousseau d24de6ab58 Fix
piv-tool.c: In function ‘load_object’:
piv-tool.c:130: warning: implicit declaration of function ‘sc_asn1_find_tag’
piv-tool.c:130: warning: nested extern declaration of ‘sc_asn1_find_tag’
piv-tool.c:130: warning: cast from function call of type ‘int’ to non-matching type ‘u8 *’
piv-tool.c:130: warning: cast to pointer from integer of different size


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4178 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 08:13:55 +00:00
ludovic.rousseau 6946e513da Fix piv-tool.c:216: warning: suggest parentheses around comparison in
operand of |


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4177 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 08:11:32 +00:00
ludovic.rousseau 6add573782 Do not cast to a possibly different type size.
Would fail on PowerPC in 64-bits for example.

Fix pkcs11-tool.c:2954: warning: dereferencing type-punned pointer will
break strict-aliasing rules


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4174 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 20:40:13 +00:00
ludovic.rousseau 5be62d9d67 Use a "const char *" to store a const C-string ptr.
Fix
pkcs11-tool.c:1899: warning: assignment discards qualifiers from pointer target type
pkcs11-tool.c:1902: warning: assignment discards qualifiers from pointer target type
pkcs11-tool.c:1906: warning: assignment discards qualifiers from pointer target type
pkcs11-tool.c:1910: warning: assignment discards qualifiers from pointer target type
pkcs11-tool.c:1914: warning: assignment discards qualifiers from pointer target type
pkcs11-tool.c:1918: warning: assignment discards qualifiers from pointer target type
pkcs11-tool.c:1922: warning: assignment discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4173 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 20:30:25 +00:00
ludovic.rousseau 0c60be861c Use a "const char *" to store a const C-string ptr.
Fix
westcos-tool.c:41: warning: initialization discards qualifiers from pointer target type
westcos-tool.c:43: warning: initialization discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4168 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 19:57:24 +00:00
ludovic.rousseau cd89cb31cf Use a "const char *" to store a const C-string ptr.
Fix
netkey-tool.c:43: warning: initialization discards qualifiers from pointer target type
netkey-tool.c:63: warning: initialization discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4167 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 19:55:39 +00:00
ludovic.rousseau 2b57feadf2 Use a temporary variable to not lose negative values (errors)
Fix
westcos-tool.c:591: warning: comparison of unsigned expression < 0 is always false
westcos-tool.c:615: warning: comparison of unsigned expression < 0 is always false


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4166 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 16:15:26 +00:00
ludovic.rousseau 30b7888c34 Remove unused variables. Fix warning: unused variable
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4157 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:43:17 +00:00
ludovic.rousseau 9b73e45a07 Fix westcos-tool.c:322: warning: no previous prototype for ‘usage’
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4146 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 08:33:14 +00:00
viktor.tarasov 42b90f8ada pkcs11-tool: to be compiled without OpenSSL
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4136 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 10:49:53 +00:00
viktor.tarasov e214ba206c pkcs15init: emulation API
Four method are added to the 'sc_pkcs15init_operations':
emu_update_dir		-- create or not the DIR file;
emu_update_any_df	-- update the non-pkcs15 descriptors that are equivalents to pkcs15 xDF files;
emu_update_tokeninfo	-- update analog of tokenInfo;
emu_write_info		-- to not create OPENSC-INFO file;


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4128 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 09:10:51 +00:00
viktor.tarasov a17e519708 pkcs15-tool: 'verify-pin' is not an action
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4127 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-17 18:24:26 +00:00
viktor.tarasov e0f39c529c pkcs15-init tool: make possible pin verification immidiately after card was binded
It's implemented for the card with emulated pkcs#15 and protected private object attributes.

Update to man pages is comming soon.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4126 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-17 18:16:27 +00:00
aj 84934adab9 don't complain about missing "--slot" parameter, when you don't
need it (if you only "--list-slots").


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4122 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-16 14:59:20 +00:00
aj 5972022ffc Add code to write pubkey objects to pkcs11-tool.
By: Jaroslav Benkovský <jaroslav.benkovsky@nic.cz>

Slightly modified by me.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4121 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-16 14:11:39 +00:00
viktor.tarasov c74016b8cc fix #202: pkcs15-tool: print message when there is PIN verify error
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4119 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-15 17:58:17 +00:00
aj 6545b42c02 cleanup of the debug code:
* reduce to a few, supported functions.
* change all functions to take the debug level as parameter.
* use symbolic names for the debug levels.
* fix tools to pass "verbose"/"opt_debug" as ctx->debug.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4118 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-15 12:17:13 +00:00
aj 0fdb4478bc On blank, but otherwise perfectly supported card, we get an error here
(with "Unsupported card"). This needs to be improved.

This patch changes the "initialization" to "binding", so we at least
can tell people: you need to initialized an empty card first.
Needs to be improved of course.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4117 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-15 10:34:18 +00:00
aj 02768fb5dc remove "split-key" option and emulat sign for sign,decrypt keys with padding
and decrypt() for cardos.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4113 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-13 22:52:51 +00:00
aj 5bc11ac39c Redirect output to file given by "--output" / "-o" option. Closes bug #200.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4112 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-13 22:47:58 +00:00
aj c1bb3ae9cd compile tools with PTHREAD so we can debug them in GDB.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4111 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-13 22:26:07 +00:00
viktor.tarasov f9b27b1699 pkcs15-tool: 'pkcs15_pin_info' parameter replaced by 'pkcs15_object'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4107 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-11 13:00:07 +00:00
martin 72a9d8e58f pkcs15-init: sign key usage shortcut does not expand to non-repudiation.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4106 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-11 11:23:47 +00:00
viktor.tarasov 052881c38f libopensc: in pkcs15 PIN commands 'pin_info' parameter replaced by 'pin_object'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4103 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-10 09:23:01 +00:00
viktor.tarasov 93210eae9f pkcs15-tool: add 'verify-pin' option" src/tools/pkcs15-tool.c
Implemented to have the possibility to verify PIN after binding of the pkcs15 card and before any 'substantial' operation.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4093 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-09 14:51:48 +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
flc 7a48d4a6f2 add support for westcos card with crypto component and minor renames to westcos-tool
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4072 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-25 15:16:23 +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
martin ba4b02e098 pkcs15-init: don't suggest using --erase-card with --create-pkcs15 in help message.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4053 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 09:09:33 +00:00
viktor.tarasov 0330993a61 pkcs15-init tool: simplify 'pristine' test - it's ok if MF, DIR or PKCS15-AppDF is not selectable
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4014 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-11 12:14:03 +00:00
aj 9406ce2885 Updated piv driver by Douglas E. Engert:
the PIV driver no longer need to set the card max_*_size parameters
   to get around emulating read_binary and write_binary. It can
   now handle partial reads and writes.

   The assumptions for write_binary are that the first chuck will
   have idx = 0, and the last chunk will write the last byte.
   The flags parameter will contain the total length.

   The only write_binary operations are done when initializing
   a card, and this is only done from piv-tool.c which was modified
   to pass in the length and other flags.

   Piv-tool continues to be a primative test tool for inializing test
   cards. But it has been expanded to be able to write other objects
   on test cards.

   The serial number of a PIV  card is obtained from the CHUID object
   if present which has a FASC-N which is an ID number created by the
   issuer. Normally PIV cards are issued the U.S. Federal government
   But there are ways to use the same cards with a non government CA.
   This is then be referred to as PIV Compatible. In this case,
   the FASC-N should start with an agency code = 9999 and an RFC 4122
   GUID should be present in the CHUID. If this is the case, the GUID
   is used as the serial number.

   Windows 7 comes with a PIV card card driver, but to get it use one of
   these card the CHUID is required. (piv-tool can now write one.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3998 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-05 06:16:37 +00:00
aj de05af6632 fold ui.c/h into pkcs15-init.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3994 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-04 06:33:33 +00:00
aj b113b90000 remove ui code from library.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3992 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-04 06:19:52 +00:00
martin b3428a684d [tools] If started with --wait, also wait for a reader if necessary.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3988 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-03 09:58:37 +00:00
alonbl a6f9f023a0 [WINDOWS] Remove tool specific file description support resource file
The implementation was based on the previous MSC build, each tool had its own
description in version resource.

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



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3980 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 14:50:42 +00:00
aj ac9f672189 update windows makefiles: only create one dll.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3973 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-01 15:22:28 +00:00
aj 4b2fe63ac2 build only one shared library instead of many.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3971 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-01 15:12:53 +00:00
aj 72d5ebb79c make erase incompatible with all other actions.
thus we don't need to worry about if the pin/so-pin was passed
for the old structures (before erase) or the new ones (if used
with create).


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3966 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-30 19:25:22 +00:00
viktor.tarasov 8aa2128423 pkcs15-init tool: don't ask for PUK value when creating PIN with 'unblock-disabled' in flags
- prepare pkcs15-init tool for creating a pkcs15 PinObject for PUK.




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3948 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-27 17:38:43 +00:00
viktor.tarasov 4662812e93 pkcs15-init tool: when importing bunch of certificates, break after the first error
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3938 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-25 15:53:29 +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 5a0cc50123 tools: remove slots; implement change in sc_disconnect_card(); convert util_connect_card()/--wait to support the changes in r3931
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3933 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-24 15:29:47 +00:00
martin 561507769a tools: cardos-tool uses OpenSSL, link against it.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3924 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-22 12:11:41 +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
martin 875fe4a50f pkcs11-tool: test hotplug partial commit fix + make a slot ID mandatory and parse it as an unsigned long, not int.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3911 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-15 09:36:00 +00:00
martin c5effc32c3 pkcs11-tool: test hotplugging and events (C_GetSlotList/C_WaitForSlotEvent) before others tests and only if --hotplug is given
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3910 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-15 09:33:27 +00:00
martin cc5c03197d pkcs11-tool: Check for CKA_ALWAYS_AUTHENTICATE and CKU_CONTEXT_SPECIFIC login for --test operations.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3909 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-15 09:27:17 +00:00
martin e595042474 pkcs11-tool: Call C_Finalize when a fatal error happens. (Otherwise OSX pcsc locks up)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3908 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-15 09:22:03 +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
viktor.tarasov 39ca6b156f pkcs15-init tool: delete both key parts when deleting splitted key
Splitted key is stored as the two private keys with the same ID.
(It's not conform to PKCS#15, but tolerated by OpenSC.)
Previously used 'sc_pkcs15_find_prkey_by_id()' is not appropriated to the case of splitted key.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3900 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-03 18:26:46 +00:00
viktor.tarasov 5bf000da18 pkcs15-tool: unblock PIN with pinpad
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3884 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 13:11:56 +00:00
viktor.tarasov 193ca76980 pkcs15-tool: change PIN with pinpad
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3883 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 12:51:12 +00:00
viktor.tarasov 44e94c8c94 opensc-explorer: remove debug messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3882 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 11:59:48 +00:00
aj 4730e98da1 Thomas Uhle: Just this morning I realised that there is
a minor mistake in my patch for opensc_info(). For the Sun Studio 12.1
compiler (__SUNPRO_C == 0x5100) and later versions also, it must be
(__SUNPRO_C >> 4) & 0xFF to split the micro and mask the major version
number.


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


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


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3871 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-01 21:10:06 +00:00
viktor.tarasov b9935bf410 cardos-tool: invalid parsing of the 'common system keys' info
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3870 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-01 11:47:19 +00:00
s e4780e82ec add to pkcs11-tool: GOST mechanisms and GOSTR3410 key to show objects on token
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3869 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-27 11:15:33 +00:00
martin f2d6ec2c76 Always print the slot description (reader name in case of OpenSC)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3867 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-25 18:01:30 +00:00
s 56dd3ec0ea Modification Rutoken S binary interfaces by Aktiv Co. (OpenSC+Rutoken S driver for Windows works now)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3865 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-23 16:38:02 +00:00
s 5320ca6fd1 Corrected GOSTR3410 public key structure
Working now with GOST R 34.10:
$ pkcs15-init --store-private-key key --key-usage sign,decrypt --auth-id 2 --id 1 --pin "12345678"
$ pkcs15-init --store-certificate my_cert --id 1 --pin "12345678"

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


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3859 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-19 15:41:03 +00:00
viktor.tarasov a8dc5bdeef opensc-explorer::do_apdu() number of bytes in printed message 'Sending'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3849 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-14 21:55:17 +00:00
martin 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 533a33521f * Update opensc-tool and opensc-explorer man pages
* Remove not implemented pksign/pkdecrypt commands from opensc-explorer. Use pkcs15-crypt instead.


git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3843 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 14:51:32 +00:00
martin 0eac0fb14c Fix #58: properly document "pkcs15-init -T"
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3841 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 12:25:18 +00:00
martin 2dfbf4f934 Fix compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3837 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 11:21:58 +00:00
martin e95b0662f6 Fix compiler warning
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3836 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 11:21:39 +00:00
martin bc1d4c4e06 Fix compiler warnings and a typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3835 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 11:21:09 +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 30ab50600b Merged [3783:3794/trunk]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3795 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-25 20:22:11 +00:00
martin 56fb57603b Merge [3758:3783/trunk]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3785 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-22 09:18:16 +00:00
martin 95a5ab0654 Re-implement PIN cache on PKCS#15 layer; remove it from PKCS#11. Re-name and log PKCS#15 options to better reflect the purpose.
Data objects and PKCS#15 init are left broken currently.



git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3784 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-22 08:59:59 +00:00
martin f6d4da7919 PC/SC: Improve core and pinpad code
* Make opensc-tool -l display pinpad capabilities, if available
 * Detect reader capabilities when a reader is found, not when a connection to a card is opened
 * Fix unpadded PIN block parameters to not be rejected by the latest free CCID driver
 * When locking the card and it has been reset by some other application (or re-attached), clear cache and lock again
 * Enable pinpad detection by default


git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3730 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 09:48:56 +00:00
martin 6a48771ce1 Implement CKA_ALWAYS_AUTHENTICATE
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3722 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 08:51:53 +00:00
martin d672fde449 Remove sc_error and sc_ctx_suppress_errors_* in favor of sc_debug/fprintf
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3721 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 08:46:59 +00:00
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
ludovic.rousseau 490d1b84aa print_file(): inverse "write" and "erase"
Thanks to Aleksey Samsonov for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2009-June/012212.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3695 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-16 09:17:53 +00:00
ludovic.rousseau 8b4a1f673b cardos_sm4h(): fix memory leaks. Thanks to cppckeck(1)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3694 c6295689-39f2-0310-b995-f0e70906c6a9
2009-05-12 14:35:49 +00:00
aj 3fa5747e33 Fix security issue.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3688 c6295689-39f2-0310-b995-f0e70906c6a9
2009-05-07 10:57:07 +00:00
ludovic.rousseau dd9a40ad0e avoid a compilation failure with --disable-openssl
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3687 c6295689-39f2-0310-b995-f0e70906c6a9
2009-05-06 16:25:50 +00:00
martin 16baddcc74 Engine API is not used.
Thanks to Robert Konklewski for noticing this.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3678 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-08 09:40:21 +00:00
ludovic.rousseau 9ef196c2cd store the generated public key on the token.
Thanks to Rickard Bondesson for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2009-February/011884.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3663 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-12 08:33:37 +00:00
alonbl 8828faeccf Allow delete data objects by specifying application-name and label
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3608 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-28 21:28:53 +00:00
martin 5b5a7d3c58 Upgrade to safe and sane values of late 2008
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3602 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-06 20:04:11 +00:00
martin de89aa47e7 Fixes #109
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3600 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-06 11:41:00 +00:00
martin a7967258aa DWIM: If you don't specify a reader on the command line and you have more than one reader (for example, OpenCT virtual readers and one existing PC/SC reader) the tools will skip to the first reader that has a card in it.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3597 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-05 15:48:49 +00:00
martin 1e41d4d267 * Fix issues with pkcs11-tool testing of C_GenerateRandom/C_SeedRandom and OpenSC PKCS#11 implementation of those functions.
Thanks goes to Rickard Bondesson who noticed the issues.

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



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3595 c6295689-39f2-0310-b995-f0e70906c6a9
2008-11-24 22:06:27 +00:00
martin 04b30cdac3 Add --list-token-slots / -T to pkcs11-tool to list only slots with tokens.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3592 c6295689-39f2-0310-b995-f0e70906c6a9
2008-11-21 22:34:31 +00:00
alonbl df74ebcdc0 Handle spaces correctly
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3577 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-04 19:52:56 +00:00
alonbl 2659c00f0d Make src/tools/cardos-info.bat DOS format
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3575 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-04 19:33:31 +00:00
alonbl 3508110177 Fixup cardos-info scripts
1. They are not binaries.
2. No need for resources.
3. Put in separate files.

Anyway, do we actually need these? why not just document
that cardos-tool should be used instead?



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3574 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-04 19:32:05 +00:00
aj a767600ee8 fix apdu length check: 0..3 is wrong (too short). 4 is ok.
5 is not (length byte for data, but no data?). 6 or more is ok
(length byte and data). checking for "5" is not important.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3573 c6295689-39f2-0310-b995-f0e70906c6a9
2008-09-22 14:36:46 +00:00
jps 042d9d06a5 An erased CardOS with a StartKey version 0xFF can now be directly formatted.
Verbose output contains now some useful data.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3572 c6295689-39f2-0310-b995-f0e70906c6a9
2008-09-22 14:21:01 +00:00
jps 8136c8b40f fix some bad crash on Mac
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3571 c6295689-39f2-0310-b995-f0e70906c6a9
2008-09-22 10:38:34 +00:00
jps 524672345b CardOS 4.2C is working too after changing Default StartKey to 16 * 0xFF
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3570 c6295689-39f2-0310-b995-f0e70906c6a9
2008-09-22 09:47:43 +00:00
jps e0d1bb5410 fixing typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3569 c6295689-39f2-0310-b995-f0e70906c6a9
2008-09-22 08:35:54 +00:00
aj aee10c8a13 Fix a comment and allow cardos 4.3B too.
Thanks to JP for testing.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3568 c6295689-39f2-0310-b995-f0e70906c6a9
2008-09-22 07:01:34 +00:00
aj cbf0c28d63 fix a few missing \n
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3567 c6295689-39f2-0310-b995-f0e70906c6a9
2008-09-19 10:21:14 +00:00
aj 5c29dcdb94 commit changes: cardos-info is now cardos-tool.
and it knows to format, at least some cards/tokens with cardos.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3566 c6295689-39f2-0310-b995-f0e70906c6a9
2008-09-18 17:44:54 +00:00
aj 021dfaccba rename files only.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3565 c6295689-39f2-0310-b995-f0e70906c6a9
2008-09-18 17:43:38 +00:00
aj 5ef6b5ff7d remove check for label - if you set one with "pkcs15-init -C -l your-label"
this check doesn't work correctly.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3555 c6295689-39f2-0310-b995-f0e70906c6a9
2008-08-12 14:48:54 +00:00
aj 07247596d6 Apply security fix.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3552 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-31 13:25:16 +00:00
cg2v 625d14c880 Don't free uninitialized memory if pem_encode fails.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3539 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-27 15:18:59 +00:00
aj 758adbc7ac Chaskiel Grundman:
I found the following patch to opensc-explorer handy when cleaning up 
after some failed keygens (but not all, since you can't delete private
key objects). It switches the card to the admin lifecycle at startup:


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3538 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-21 14:39:37 +00:00
alonbl 47013af374 opensc-explorer double free and cleanups
$ opensc-explorer
OpenSC Explorer version 0.11.4-svn
OpenSC [3F00]> cat
only working EFs may be read
OpenSC [3F00]> cat
only working EFs may be read
opensc-explorer: sc.c:492: sc_file_free: Assertion `sc_file_valid(file)' failed.
Aborted

$ opensc-explorer
OpenSC Explorer version 0.11.4-svn
OpenSC [3F00]> cd ff00
OpenSC [3F00/FF00]> cat
only working EFs may be read
OpenSC [3F00/FF00]> cd ..
opensc-explorer: sc.c:492: sc_file_free: Assertion `sc_file_valid(file)' failed.
Aborted

By Aktiv Co. Aleksey Samsonov
And some more Cleanups 



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3526 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-26 10:46:16 +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
ludovic.rousseau 8624796f37 use type size_t instead of int since the 3rd argument of
sc_format_asn1_entry() is void *
using int will fail on a 64-bits platform

Closes Ticket #176


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

Changes:

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

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

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

4. Allow context to be created without readers.

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

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

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

Alon

---

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

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


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3506 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-29 17:01:19 +00:00
alonbl 6c740b907e More MSVC fixups by Douglas E. Engert
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3503 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-29 06:09:00 +00:00
alonbl 514d471f0e Use O_BINARY at rutoken
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3492 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-25 12:49:11 +00:00
alonbl 597bcd7635 Cleanup some Windows issues with open
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3491 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-25 11:51:03 +00:00
alonbl 8d7bce4de2 ruToken fixups
http://www.opensc-project.org/pipermail/opensc-devel/2008-April/011057.html

By Aktiv Co. Aleksey Samsonov



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3478 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-18 14:08:23 +00:00
alonbl 606052c901 Add --get-conf-entry, --set-conf-entry to opensc-tool
Although not perfect, will enable installer/users
to perform some simple tasks against configuration file.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3472 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-12 21:54:02 +00:00
alonbl 865f6e9c70 More fixups to maintainer-clean
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3471 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-11 12:52:46 +00:00
alonbl d84077749b Distribute autoconf generated files for MSVC build
Construct resource files and winconfig.h using autoconf
substitutions.



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

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

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

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



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

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

  src/tools/eidenv.c - use PACKAGE_VERSION

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

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

  src/common/Makefile.mak - renamed modules.

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

  src/scconf/Makefile.mak - reordered objects.

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

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

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

By Douglas E. Engert

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



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

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


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3445 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-01 12:43:26 +00:00
ludovic.rousseau 77fac9721f #include <opensc/pkcs15.h> to avoid a compilation warning
rutoken.h:4: warning: 'struct sc_pkcs15_prkey' declared inside parameter
list
rutoken.h:4: warning: its scope is only this definition or declaration,
which is probably not what you want


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

Alon Bar-Lev

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

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



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3405 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-06 16:06:59 +00:00
alonbl 741330ba19 Allow specifying application name for data objects at pkcs15-init.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3403 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-06 15:00:04 +00:00
ludovic.rousseau e9135ff347 print_binary(): everything except printable characters (including space)
are displayed in hex

Thanks to Ian Young for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2008-January/010641.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3313 c6295689-39f2-0310-b995-f0e70906c6a9
2008-01-04 13:13:53 +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
pk 513a3dde0a support for TCOS3
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3309 c6295689-39f2-0310-b995-f0e70906c6a9
2007-12-28 18:18:57 +00:00
jps 27257f2278 support for Siemens CardOS V4.2C
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3306 c6295689-39f2-0310-b995-f0e70906c6a9
2007-12-19 09:58:29 +00:00
ludovic.rousseau bb7bdc208f redefine trace macro to avoid compiler warnings when _DEBUG is not
defined

rutoken-tool.c:107: warning: statement with no effect
rutoken-tool.c:165: warning: left-hand operand of comma expression has no effect


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3305 c6295689-39f2-0310-b995-f0e70906c6a9
2007-12-17 13:47:25 +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
gurer ab94915277 two new debugging commands.
asn1 2f01
Dumps asn.1 content of a file

apdu 00:20:00:00:04:31:31:32:32
Send the custom APDU inside the session


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3275 c6295689-39f2-0310-b995-f0e70906c6a9
2007-09-27 18:19:17 +00:00
aj 3264588c3e restores ability to change opensc-explorer debug level at
runtime, using "debug" command from opensc prompt. by Jakub Bogusz


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3247 c6295689-39f2-0310-b995-f0e70906c6a9
2007-08-14 06:02:51 +00:00
ludovic.rousseau 0cebca4ceb the commands line tools do not call lt_dlopen() so do not need to link
with libltdl


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3244 c6295689-39f2-0310-b995-f0e70906c6a9
2007-08-13 08:32:07 +00:00
aj a7912a2426 add information about cardos 4.2b - latest cardos update.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3237 c6295689-39f2-0310-b995-f0e70906c6a9
2007-08-08 20:06:53 +00:00
aj 7ea1d00791 pkcs11-tool crashes while printing its usage message.
fixed by Ville Skyttä.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3233 c6295689-39f2-0310-b995-f0e70906c6a9
2007-07-28 18:22:07 +00:00
aj 8e37bfd68d cryptoflex-tool.c:505: warning: array subscript is above array bounds
gcc 4.3 warning, reported and fixed by novell:
Problem found by David Binderman
Patch created by Michal Vaner
closes our trac bug #153 and novell bug 238660


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3232 c6295689-39f2-0310-b995-f0e70906c6a9
2007-07-28 18:18:39 +00:00
aj c6a54578fc use static without inline - the compiler can optimize the function as
inline or not, whatever it prefers. "static inline" is not supported by
the visual studio c compiler.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3210 c6295689-39f2-0310-b995-f0e70906c6a9
2007-07-09 14:52:03 +00:00
aj 8c222a0b44 remove unused definition.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3194 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-29 14:14:02 +00:00
aj db600912c6 fix duplicate static.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3193 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-29 13:31:04 +00:00
aj cea32a8016 make app_name, options and option_help static.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3192 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-29 13:19:19 +00:00
aj 1069b4e018 Douglas E. Engert: fix more compiler warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3190 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-24 21:03:30 +00:00
aj 4ca4eba365 silence more warnings by gcc/sparse.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3189 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 13:58:38 +00:00
ludovic.rousseau be309330e5 do not use global variables app_name, options and option_help so they
can be static


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3188 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 13:46:08 +00:00
aj b0bc6df80c fix more warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3187 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 13:38:16 +00:00
ludovic.rousseau 209ee45007 eidenv.c:55: attention : ‘option_help’ defined but not used
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3186 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 13:29:57 +00:00
ludovic.rousseau 2f66c5b87e correct a typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3184 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 13:20:45 +00:00
aj 0c604cb294 silence more warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3183 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 12:58:57 +00:00
aj 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 9946e237de Douglas E. Engert:
Major improvments in the PIV card modules: 
* OpenSC-0.11.2 only supported RSA 1K keys, the patch supports RSA 2K and 3K
  keys.
* The FASC-N in the CHUID object is used as the card serial number. 
* A PIV card may have additional objects. These can now be read by pkcs11-tool
  and pkcs15-tool. 
* The p15card-helper.c module is no longer used. The code to call the
  sc_pkcs15emu_* routines has been moved back into pkcs15-piv.c and uses
  existing OpenSC routines to parse the certificate to find the modulus_len. 
* pkcs15-piv.c will now get the modulus_len from the certificates to store into
  the emulated prvkey an pubkey objects as they are being created using the
  sc_pkcs15emu_* routines. 
* The caching code that was added to card-piv.c in 0.11.2 is disabled, as
  pkcs15-piv.c will cache the certificate using existing OpenSC routines. 
* piv-tool will now print a serial number. 
* The key-usage bits for prvkey and pubkey objects are set in pkcs15-piv.c 
* The PIV "9E" key was added. It is not a private object, and can be used
  without a PIN. It is used with the "Certificate for Card Authenticaiton". 
* When used with the OpenSSL engine to generate a certificate request, the
  public key saved by piv-tool during a "generate asymmetric key pair" card
  command can be read from a file pointed at by the environment variable
  PIV_9*_KEY. Where * is A, C, D or E. 
* In the card_atr section of opensc.conf, flags = 20; can be used to only show
  the PIV Authentication cert. This feature was in 0.11.1 but was dropped in
  0.11.2 when the p15card-helper.c was introduced.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3174 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 07:07:49 +00:00
aj 6c324049e7 If a PKCS11 get attrribute failes for some reason, pkcs11-tool may return
garbage along with the error message. The attached patch to pkcs11-tool.c
initializes the type to 0 so the attribute will be 0 in case of an error.
by Douglas E. Engert


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3172 c6295689-39f2-0310-b995-f0e70906c6a9
2007-05-25 20:09:11 +00:00
nils 4199969461 authenticate if data object is protected
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3151 c6295689-39f2-0310-b995-f0e70906c6a9
2007-04-23 19:18:46 +00:00
aj e7d88163ea fix --serial option.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3139 c6295689-39f2-0310-b995-f0e70906c6a9
2007-03-18 17:55:15 +00:00
aj 25f8509fc1 Douglas E. Engert:
piv-tool needs openssl, so compile only if it is present.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3130 c6295689-39f2-0310-b995-f0e70906c6a9
2007-03-13 20:59:15 +00:00
aj c6954a9c33 full piv update by Thomas harning Jr. and David E. Engert,
adding compression etc. Also enables opensc to be compiled
with and without zlib support.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3125 c6295689-39f2-0310-b995-f0e70906c6a9
2007-03-10 10:46:32 +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
nils 1b4472ca9f use const, add yet another ACL
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3114 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-20 12:46:40 +00:00
nils 4c72646a35 increase pointer
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3111 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-15 20:32:58 +00:00
aj 1a9d5290f1 kill warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3091 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-19 22:11:07 +00:00
aj db0a552d7b convert to utf-8.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3090 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-19 21:35:42 +00:00
nils 4e401b6c06 fix typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3052 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-09 21:26:19 +00:00
nils 01f72933af add support to parse the seInfo TokenInfo entry, improve aid support in opensc-explorer
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3045 c6295689-39f2-0310-b995-f0e70906c6a9
2006-10-30 18:51:48 +00:00
nils 45e22aa7be add the possibility to read the pin from stdin
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3036 c6295689-39f2-0310-b995-f0e70906c6a9
2006-10-02 10:34:57 +00:00
nils 636f694291 check if the ef type is in range; thanks to Thomas Irlet
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3029 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-26 18:01:03 +00:00
nils a127dd93ef add option to write data objects; patch supplied by Cornelius Kölbel <cornelius.koelbel@lsexperts.de> et. al.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3017 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-18 05:30:41 +00:00
nils aec987df38 build fixes for win; patch supplied by Douglas E. Engert <deengert@anl.gov>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3005 c6295689-39f2-0310-b995-f0e70906c6a9
2006-08-03 21:05:59 +00:00
nils b5dbdd9475 fix warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3004 c6295689-39f2-0310-b995-f0e70906c6a9
2006-08-02 19:43:13 +00:00
nils 42ad6be451 win build fixes; patch supplied by Douglas E. Engert <deengert@anl.gov>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3003 c6295689-39f2-0310-b995-f0e70906c6a9
2006-08-02 19:31:34 +00:00
nils 0037ceb09c check the value of the pin type before accessing the array; patch supplied by Henryk Plötz <henryk@ploetzli.ch>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3001 c6295689-39f2-0310-b995-f0e70906c6a9
2006-07-23 08:02:37 +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
ludovic.rousseau 2495268d98 - remove src/common/getopt.h since it collide with /usr/include/getopt.h
- replace @GETOPTSRC@ by $(top_srcdir)/src/common/my_getopt.c in
  Makefile.am files

- change the detection of getopt_long in configure.in since GETOPTSRC is
  not used anymore. my_getopt.c is now always compiled and used but
  provides getopt_long() only if HAVE_GETOPT_H is NOT defined (ie. if
  getopt_long() is not provided by the system)

- src/common/my_getopt.c: the code is within #ifndef HAVE_GETOPT_H

- move the useful lines of src/common/getopt.h in src/common/my_getopt.h


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2989 c6295689-39f2-0310-b995-f0e70906c6a9
2006-07-12 07:43:38 +00:00
aj 5d1f80d9fa fix compiling netkey-tool on win32.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2963 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-23 12:55:40 +00:00
aj d42495b01d try to fix windows compile (include netkey-tool and cryptoflex-tool).
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2960 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-23 09:09:29 +00:00
aj 5cb1c13c45 if exec() fails, exit with return code 1.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2929 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:17:11 +00:00
aj 56082ee3a0 initialize with NULL, so the later check for NULL will work.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2928 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:16:48 +00:00
aj ab0066b0d7 fix printf size_t problem with "%lu" and (unsigned long) cast.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2923 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:02:50 +00:00
aj 41ff15ec1f fix signed and size_t warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2916 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-26 11:41:57 +00:00
aj 96cb7fa722 fix off by one bug.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2893 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-26 09:58:47 +00:00
nils 40e6c491ed fix ACs; patch supplied by njustin@idealx.com
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2876 c6295689-39f2-0310-b995-f0e70906c6a9
2006-03-22 17:12:00 +00:00
nils b93d6b1562 use absolute paths when caching files
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2860 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-27 20:11:33 +00:00
nils 9c42d1dc8c use sc_ctx_get_reader() etc. instead of of accessing the structure members directly
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2848 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-15 17:29:40 +00:00
nils a092e863b8 fix some warnings + cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2847 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-15 17:05:05 +00:00
nils 5c6f8d0ea9 fix warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2846 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-15 08:10:45 +00:00
nils 7dbbade0f6 fix warning
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2845 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-15 08:07:29 +00:00
nils b051b08584 add initial PIV card support; patch supplied by Douglas E. Engert <deengert@anl.gov>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2842 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-14 22:09:10 +00:00
nils d02aaf37de fix warning
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2841 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-14 22:04:47 +00:00
nils 1c1a0a1548 don't bind the pkcs15 card twice
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2838 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-12 17:37:39 +00:00
nils 25e5c95dde use sc_context_create instead of sc_establish_context
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2833 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-07 20:14:43 +00:00
aj 525613ad5a add atr and os identification for cardos 4.3 (plain, not b, not likely
to be ever seen, but 100% compatible to 4.3b as far as I know - only slower).


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2827 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-26 19:02:02 +00:00
aj b07df40932 change more opensc.org references to opensc-project.org till dns is back.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2818 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-22 21:15:07 +00:00
nils e8c05ca648 use more opensc specific names for ASN.1 tags to avoid name conflicts
with other ASN.1 libraries


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2815 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-20 20:52:36 +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
sth e5d0ec212e Typo fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2800 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-30 10:34:29 +00:00
aj 1a5a5c9b76 "cat xxxx" is not supposed to create errors (on record structured files).
so silence it.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2798 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-28 20:20:18 +00:00
aj 86c4e23ec5 tcos update by peter koch, adds interoperability with th darmstadt cards.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2784 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-26 18:50:21 +00:00
nils 9ce3f13bac add cardos m4.2 and print the startkey version in hex
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2767 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-16 20:52:01 +00:00
aj b2400d0795 pkcs15-tool needs openssl_libs also, if it is available.
only older gcc versions found this problem, it seems.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2765 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-14 10:59:57 +00:00
aj 4863fb752d free buf if pin was entered incorrectly.
check if file is not NULL (out of memory).
free file, if something goes wrong.
free pin/puk once no longer needed.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2706 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-05 21:31:20 +00:00
aj 131842c80b make code easier by removing match variable.
check if cert was returned != NULL.
free cert if there is some error.
set variables to NULL after being freed,
to avoid potential double free bugs.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2705 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-05 21:29:54 +00:00
aj cdc3044082 proper cleanup: close files if something goes wrong.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2704 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-05 21:27:44 +00:00
aj 365196594c check publickey variable before de-referencing.
change newpin to NULL so it can't get free'd twice.
allocate buf from heap, not stack (quite large).


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2703 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-05 21:27:05 +00:00
aj 93dae31ca7 #if out the dead code.
remove some dead code in the hexdump code.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2702 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-05 21:25:08 +00:00
nils 9b717662d9 use sc_print_path
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2692 c6295689-39f2-0310-b995-f0e70906c6a9
2005-11-29 20:56:11 +00:00
aj f91e2339ce add more cardos versions.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2681 c6295689-39f2-0310-b995-f0e70906c6a9
2005-11-01 22:34:22 +00:00
sth a3e1bc8f4f Let --assert-pristine work for Setcos 4.4 cards
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2679 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-31 19:31:45 +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 fa65fbf285 summary: - add new function sc_format_oid to libopensc
- cleanup libopensc api


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2670 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-30 18:05:30 +00:00
nils 0ad2a0782d fix typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2655 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-21 19:40:37 +00:00
sth 58943d59b5 Compiler warning fix: use 'char * argv[]' in main() because getopt_long() does so too
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2648 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-13 11:19:25 +00:00
aj ba303233ff fix compiling on solaris9. Thanks to Douglas E. Engert
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2645 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-11 20:57:15 +00:00
nils cee5f2a147 print lastUpdate field as well
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2638 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-07 19:58:43 +00:00
aj 43d3408938 add a few details about the card, also by Antonio Iacono.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2636 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-07 07:06:16 +00:00
aj d1cbf05abf add --dump option, thanks to antonio
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2635 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-06 19:30:18 +00:00
sth 10fa4a6962 Fix: deleting a cert chain with 1 or more intermediate CA's crashed
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2625 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-28 14:52:32 +00:00
nils 4be1f40fd3 add option to specify the key length
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2624 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-27 17:22:48 +00:00
nils 052a4933ae remove unused variable
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2606 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-19 16:37:19 +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
aj 21e3b71029 use ltdl not scdl.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2564 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-09 14:43:59 +00:00
aj c9e80e95ea we use libtool for linking, so it can calucalte the dependencies using
LTLIBLTDL better. Thanks to Ralf Wildenhues.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2558 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-08 17:21:58 +00:00
aj ce14d27cb3 AC_SUBSTed variables are better used with $(..). Thanks to Ralf Wildenhues.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2557 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-08 17:15:07 +00:00
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
nils 13a3e699e5 adjust key usage bits
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2545 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-06 21:18:26 +00:00
aj a59faf395d fix compiling with ltdl.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2542 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-05 20:44:51 +00:00
aj 25cb1a3ca1 fix compiling with openssl installed in a non-standard location.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2530 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-01 20:51:54 +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
nils 89dacc6c82 fix compiler warning
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2520 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-24 16:18:24 +00:00
nils 3b6a90000a add missing include, removed unused variable and initialize variable
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2518 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-24 15:59:01 +00:00
sth 8e3dee0585 Added set_userpin_ref() to link a PIN value to a PIN ref for an existing user PIN
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2512 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-23 09:01:57 +00:00
sth 26108b0280 Added support for deleting pkcs15 objects (if the pkcs15init card driver for that card supports it)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2508 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-22 09:23:46 +00:00
nils 25950cb01a use inttypes.h instead of stdint.h; disable read_ssh_key when no uint32_t is available
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2478 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-10 19:04:08 +00:00
nils 39373c1ec8 initialize the oid object, patch supplied by Tarasov Viktor <vtarasov@idealx.com>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2477 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-10 18:20:04 +00:00
nils 6dc33041aa include sys/types.h if stdint.h doesn't exist + fix typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2476 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-09 21:27:50 +00:00
nils 3da0e1b8cd allow up to 64 byte long pins
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2474 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-09 18:21:50 +00:00
sth 2b6a2cb19c One of the memset()s appears to write too much zeros on some systems -> put all the data in a struct and memset() this instead of each field separately. Thx to JP Szikora for notifying.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2470 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-08 14:25:19 +00:00
sth d443d373a4 More typo fixes, from JP Zikora
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2459 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-03 11:33:14 +00:00
sth 080887c62f Typo fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2454 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-02 20:48:27 +00:00
sth 90003b36b7 Added support for the Belgian EID card (shows the contents of the ID and Address files)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2452 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-29 21:21:03 +00:00
sth 90de623629 Add eidenv.exe tool
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2451 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-29 21:15:17 +00:00
sth f5b586715a Now compiles on Win32
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2450 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-29 21:14:46 +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 a1e2ac529d Added #ifdef HAVE_OPENSSL for read_ssh_key()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2435 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-18 12:20:24 +00:00
sth 7939f0b010 If we want to test signing, first see if the key can do this
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2409 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-15 13:37:38 +00:00
sth 467b0e65f9 Oops, shouldn't have changed the serial number size in x509cert_info to 256
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2384 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-06 12:59:45 +00:00
sth 2731db845d No uint32_t type in MS VS
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2383 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-06 12:23:03 +00:00
sth 2585106e3c Print an error if sc_pkcs15init_bind() fails
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2381 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-05 17:43:50 +00:00
sth 2c856aa71f Increased sizes in rsakey_info struct
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2380 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-05 15:27:59 +00:00
aj 2c123d5bc7 oops, missed a #endif.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2370 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-28 21:16:02 +00:00
aj d3ab255406 use uint32_t, it is a c++ stdtype and should work on all plattforms.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2369 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-28 20:33:32 +00:00
sth e5ee45ace1 Use uint32_t on Mac
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2368 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-28 13:50:41 +00:00
sth 505d2a5f7c No asm/types.h on MacOSX either
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2363 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-27 11:51:00 +00:00
sth 57ca997cb9 Windows: no _uu32 in MS VS
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2359 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-22 10:32:27 +00:00
aj b0e6b11bba make it compile without openssl.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2355 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-16 19:39:34 +00:00
aj bf6808e3d8 "smart card" not "smartcard" or "SmartCard".
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2354 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-16 19:35:31 +00:00
aj f5b1018d04 add options for displaying openssh keys.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2351 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-15 08:57:47 +00:00
nils a6db0256c9 add netkey-tool from Peter Koch
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2349 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-14 21:37:19 +00:00
nils ca0416a60d microsoft's vs 6.0 doesn't like initialization during declaration. let's use memset instead
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2346 c6295689-39f2-0310-b995-f0e70906c6a9
2005-05-22 20:07:31 +00:00
nils 0d5d3eb151 enhance object writting support, patch supplied by Marc Bevand <bevand_m@epita.fr>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2345 c6295689-39f2-0310-b995-f0e70906c6a9
2005-05-21 10:21:53 +00:00
nils 8631af20fd add initialization support for token/pin; supplied by Marc Bevand <marc.bevand@smartjog.com>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2337 c6295689-39f2-0310-b995-f0e70906c6a9
2005-05-07 22:22:07 +00:00
nils f2526dfd8e fix for solaris; patch supplied by Douglas E. Engert <deengert@anl.gov>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2287 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-29 19:59:30 +00:00
aj 8d27151cf6 remove .cvsignore files.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2243 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-23 21:08:13 +00:00
bert eb4717ea17 API fixup: use defined type instead of struct for exposed structs (part 2)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2233 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-09 00:04:44 +00:00
aet cae39291de - eidenv cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2228 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-03 18:12:07 +00:00
aet 47721beae2 - Minor fixes, convert crlf -> lf
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2227 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-02 09:03:19 +00:00
pisi 8baf433e36 eidenv - small utility for Estonian ID card *nix only)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2224 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-02 08:05:52 +00:00
sth 5499fcb302 Typo fix (thx Andreas, sorry Juha
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2206 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-27 07:25:29 +00:00
sth a1d4fe394e 'pinpad-enable' pkcs15-crypt: if it's a pinpad and you press enter when being asked for a PIN, you can enter the PIN on the reader
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2205 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-26 19:47:54 +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
aet a854de4698 - Warning fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2157 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-08 09:51:56 +00:00
nils edbfa95bf4 const fixes etc.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2148 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-06 21:01:09 +00:00
aet 176323ac03 - Warning fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2143 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-06 10:06:21 +00:00
nils 026f7ae89b even more cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2139 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-05 10:02:56 +00:00
nils 7d6b3937e9 cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2138 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-05 09:54:05 +00:00
nils 235abe1ffd declare some functions static plus some type fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2137 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-04 22:52:13 +00:00
nils e0c1b6e8f1 remove unreachable code, make some functions static and fix parameter type
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2136 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-04 22:33:51 +00:00
nils 0b43659efa fix some compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2133 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-04 18:10:23 +00:00
aet c1b0626cdd - Cleanup, typo fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2123 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-02 10:21:10 +00:00
sth 8857ff5b1c Work-around for cards that don't return FCI info
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2118 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-01 07:52:40 +00:00
nils f66913ca30 just issue a warning in case of a missing attribute, patch supplied by Philipp Marek (with some changes from me)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2094 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-23 19:48:48 +00:00
nils 56487f86a1 more indent fixes from Martin Paljak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2092 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-21 18:47:41 +00:00
nils ea59c97887 fix memory leak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2090 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-21 18:25:26 +00:00
nils d644979168 print the atr in standard opensc hex format, patch supplied by Martin Paljak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2087 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-19 20:39:25 +00:00
nils 7ed9a18d51 don't print key length in case of a private key (as private key doesn't have the CKA_MODULUS_BITS attribute)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2081 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-19 16:12:14 +00:00
nils 65986182e4 fix indent, patch supplied by Martin Paljak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2080 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-19 08:00:41 +00:00
sth 08c3cc90fa Simplified the procedure to link with openssl on Windows: now you only need to slightly change Make.rules.mak instead of hacking in several Makefile.mak files
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2077 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-16 21:12:38 +00:00
nils d73ed35678 change auth_id -> id, show pin type, update pkcs15-init manpage
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2073 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-13 21:52:39 +00:00
nils 609fb32a25 fix help message (supplied by Philipp Marek)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2027 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-20 20:05:47 +00:00
nils efe5366af6 dump serial number only if we have one
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2025 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-20 08:03:40 +00:00
nils e3dc91d562 serial number support for opensc-tool
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2023 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-16 08:50:51 +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 895289c904 bugfix: don't try to get the CKA_MODULUS_BITS attribute from a private key
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1996 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-09 08:23:57 +00:00
aj b0649c1e4f build fixes by Vile Skytt�.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1973 c6295689-39f2-0310-b995-f0e70906c6a9
2004-11-04 19:14:58 +00:00
nils c613908dde check only for attributes which can be present
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1970 c6295689-39f2-0310-b995-f0e70906c6a9
2004-11-03 18:14:58 +00:00
sth 17fa73fb5d scdl.lib needed for for the link step due to the recent changes in dynamic loading
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1955 c6295689-39f2-0310-b995-f0e70906c6a9
2004-10-27 05:10:34 +00:00
nils ace9520193 fix memory leak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1951 c6295689-39f2-0310-b995-f0e70906c6a9
2004-10-24 17:20:29 +00:00
sth 34e3a42c8f If you do pkcs15-init -C with the onepin option, you can now specify --pin and --puk instead of --so-pin and --so-puk (also allowed for backward compatibility)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1910 c6295689-39f2-0310-b995-f0e70906c6a9
2004-10-06 14:07:18 +00:00
sth 61301ca546 Don't use 0 as input to test signature-verification
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1907 c6295689-39f2-0310-b995-f0e70906c6a9
2004-09-27 08:38:51 +00:00
nils 3f5dc67981 print 'tries_left' only if the value is >= 0
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1903 c6295689-39f2-0310-b995-f0e70906c6a9
2004-09-19 19:47:34 +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 3ffc201082 fix tab indentation and adds the tries left field to the --list-pins output
patch supplied by Martin Paljak <martin@paljak.pri.ee>


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1896 c6295689-39f2-0310-b995-f0e70906c6a9
2004-08-25 20:55:07 +00:00
nils fa0b71a99b add "--raw" option
patch supplied by Jari Eskelinen <jari.eskelinen@iki.fi>


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1894 c6295689-39f2-0310-b995-f0e70906c6a9
2004-08-21 14:26:16 +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 8e3041850e improve output for pkcs15 data objects
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1878 c6295689-39f2-0310-b995-f0e70906c6a9
2004-07-26 19:18: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
aj ef89694f00 Bug found by Stef Hoeben.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1857 c6295689-39f2-0310-b995-f0e70906c6a9
2004-07-21 22:11:12 +00:00
aj c2459879d9 pkcs11-tool and pkcs15-crypt use libcrypto, so they need to link
with it. Found by Dirk Gouders.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1853 c6295689-39f2-0310-b995-f0e70906c6a9
2004-07-21 22:02:37 +00:00
nils 82ec09e92b check return value
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1826 c6295689-39f2-0310-b995-f0e70906c6a9
2004-07-12 08:42:55 +00:00
nils 71e5f638c5 fix/cleanup passphrase input
Michael Bell <michael.bell@cms.hu-berlin.de> and Nils Larsch


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1825 c6295689-39f2-0310-b995-f0e70906c6a9
2004-07-12 08:26:53 +00:00
nils 9fb99e7051 use opt_passphrase, if present, before asking the user
patch supplied by Michael Bell <michael.bell@cms.hu-berlin.de>


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1804 c6295689-39f2-0310-b995-f0e70906c6a9
2004-06-25 15:44:33 +00:00
nils a7e042fdb3 Add two new commands: update_binary and update_record.
update_binary can be used to write arbitrary data data (entered as
hex values) to transparent files and update_record can be used to
do the same to record files.
Patch supplied by Victor Tarasov <vtarasov@idealx.com> and Nils Larsch


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1803 c6295689-39f2-0310-b995-f0e70906c6a9
2004-06-24 17:25:23 +00:00
aj 856cbdebfa fix short options as well.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1794 c6295689-39f2-0310-b995-f0e70906c6a9
2004-06-18 09:12:50 +00:00
aj 9b7cdbffad cleanup debug/quiet/verbose handling.
now all tools accept "-v" for verbose
operation, and you can specify -v several
times to get more verbose i.e. debugging
output.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1792 c6295689-39f2-0310-b995-f0e70906c6a9
2004-06-13 20:13:12 +00:00
aj 4aa731e415 oops, forgot the select.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1791 c6295689-39f2-0310-b995-f0e70906c6a9
2004-06-13 20:04:53 +00:00
aj 209dad0217 fixed a small bug (!= instead of ==) and made
the code hopefully more readable.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1790 c6295689-39f2-0310-b995-f0e70906c6a9
2004-06-13 19:45:24 +00:00
aj 338a7c4eff oops. O_BINARY is for windows, not linux.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1778 c6295689-39f2-0310-b995-f0e70906c6a9
2004-04-22 07:04:50 +00:00
nils 8cb6a3f94a "--assert-pristine" workaround for Starcos cards (see comment in the patch)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1776 c6295689-39f2-0310-b995-f0e70906c6a9
2004-04-21 20:11:56 +00:00
aj 9fb7334e71 Open file with O_BINARY on windows.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1772 c6295689-39f2-0310-b995-f0e70906c6a9
2004-04-21 07:33:49 +00:00
nils b057f4055d add support for "finalize" to pkcs15-init to activate the ACs for starcos
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1766 c6295689-39f2-0310-b995-f0e70906c6a9
2004-04-17 09:25:30 +00:00
aj 6460502b98 add "rm" alias for "delete" and "exit" alias for "quit".
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1756 c6295689-39f2-0310-b995-f0e70906c6a9
2004-03-14 19:53:23 +00:00
okir ec0d4db12b - Allocate the right amount of memory when base64 encoding for PEM
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1746 c6295689-39f2-0310-b995-f0e70906c6a9
2004-01-27 09:03:15 +00:00
sth 5d6af9a68c Added --cert-label option, usefull to specify the user cert label if you do a --store-private-key
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1745 c6295689-39f2-0310-b995-f0e70906c6a9
2004-01-24 20:55:34 +00:00
okir 0d78f07499 - improved C_Decrypt testing
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1711 c6295689-39f2-0310-b995-f0e70906c6a9
2004-01-07 09:32:58 +00:00
okir ec52d80408 - properly handle pubkey_label in key generation
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1706 c6295689-39f2-0310-b995-f0e70906c6a9
2004-01-05 08:56:32 +00:00
okir b552bccfd3 - signature tests would fail on cards with several keys of different size
(fix by Chaskiel)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1700 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-29 13:15:04 +00:00
okir beb86f351b - util.c:connect_card() now locks the card; removed sc_lock calls from
calling applications (based on a bug report by Chaskiel)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1699 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-29 13:06:28 +00:00
okir e03cc716e2 - When testing signatures, don't bail out of C_SignInit returns
CKR_MECHANISM_INVALID (Chaskiel Grundman)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1698 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-29 13:03:48 +00:00
aj 4e48b7778a new manpages for cardos-info and pkcs11-tool,
both written my Joe Phillips.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1695 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-29 12:01:43 +00:00
sth 6952fb4030 Made a seperate function for the login functionality, and split test_kpgen_certwrite() into 2 parts, with a logout - unload lib - load lib - login between them
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1693 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-23 16:31:09 +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 a569ef57c7 - Display better pin prompts
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1679 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-16 14:41:04 +00:00
okir ab9d7bb7ff - removed some dead debugging code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1666 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-09 15:41:16 +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 a239629d9c Added a check for NSS-like keypair generation
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1659 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-04 16:43:41 +00:00
okir 8ff09b7f77 - another fix to verify pin
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1644 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-26 15:49:09 +00:00
sth a843fd1d11 Little fix in test_signature()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1635 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-23 15:43:38 +00:00