Commit Graph

3911 Commits

Author SHA1 Message Date
andre 094eb8697c opensc-tool.c: Fixes literal names in 'const id2str_t alg_type_names[]'.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5375 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-19 13:45:30 +00:00
andre 9026ea6f3f pkcs11-tool.c: Avoid warning:
pkcs11-tool.c:1978: warning: ‘getPUBLIC_EXPONENT’ defined but not used

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5374 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-19 13:03:49 +00:00
andre ff7bb8fbf4 profile.c: Avoid warning:
profile.c:1212: warning: comparison between signed and unsigned

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5373 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-19 12:59:23 +00:00
andre fa8fd1602d types.h: Avoid warning:
opensc-tool.c:356: warning: comparison between signed and unsigned

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5372 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-19 12:34:16 +00:00
martin 8f0ba374f3 Add reminders to bytes2apdu style code blocks.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5370 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-19 10:51:27 +00:00
martin 1932ce861f opensc-{explorer,tool}: allow sending extended APDUs
In do_apdu() resp send_apdu/(, flexibilize parsing the APDU string passed
so that extended APDUs are accepted a valid APDUs too.

While at it, fix a bug where more data than available would have been copied,
potentially leading to a SIGSEGV.

Signed-off-by: Peter Marschall <peter@adpm.de>

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5369 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-19 10:51:22 +00:00
martin 9dc233163a opensc-tool: convert print_file() to using tables
Use ID<->name tables in print_file() innstead of arrays of strings where
the index was treated like some "magic" constant. With the new mapping tables,
the meaning is obvious.

While on it, fix a bug with ac_ops_df[]: before the conversion, it was a list
of pointers to strings but was in one case treated like it was a mapping table.
With the conversion to a mapping table, and the adaption of other code parts
this bug got fixed "automagically" ;-)

Signed-off-by: Peter Marschall <peter@adpm.de>

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5368 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-19 10:51:16 +00:00
martin be5456d3ca opensc-tool: make list_algorithms() table driven
Use easily extensible tables instead of explicit coding to display
algorithm names and options in list_algorithms.

Leverage the new tables to add more RSA hashes.

Signed-off-by: Peter Marschall <peter@adpm.de>

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5367 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-19 10:51:11 +00:00
martin e5a133d00c Fix a crash on Windows, where pkcs15-tool -E would always crash in sc_pkcs15_free_card()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5366 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-19 10:51:06 +00:00
andre 6409755bea pkcs11-tool.c: Avoid warning:
pkcs11-tool.c:2000: warning: comparison between signed and unsigned


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5363 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-19 09:18:12 +00:00
andre 261d5269e5 pkcs15-init.h: Avoid warning:
pkcs15-init.c:1473: warning: assignment discards qualifiers from pointer target type

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5362 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-19 09:12:17 +00:00
andre 90ffef6dc9 asn1.c: Check boundaries __before__ accessing memory.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5361 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-18 12:29:47 +00:00
martin 007d27feeb Introduce sc_ctx_log_to_file to set the debug file of libopensc.
On Windows every DLL has their own file descriptor table, thus specifying
-v from any of the OpenSC tools resulted in a crash when the tool tried to override
ctx->debug_file with stderr.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5359 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-18 10:01:27 +00:00
vtarasov 8de6b57882 pkcs15init: different possible kinds of EC generate key parameters ...
named curve, oid and der


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5357 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-17 18:48:12 +00:00
vtarasov ef1726e782 pkcs11: process the EC key generation type
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5356 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-17 18:45:27 +00:00
vtarasov caf3789439 asn1: in encode-object-id procedure do not stop on zero -- it's a valid value
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5355 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-17 18:39:01 +00:00
vtarasov 2202614fdc pkcs15init setcos: no need of card specific 'delete-object' callback ...
there is nothing specific inside and it's never called by pkcs15init


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5349 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-16 17:57:49 +00:00
vtarasov 28ccae7918 card-piv: store serial number into the 'serialnr' member of sc_card structure ...
... when serial number was asked for the first time.
Then return the stored value for the every next request of serial number.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5348 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-16 17:35:56 +00:00
vtarasov d673e5f109 pkcs15init myEID: in profile increase size of xDF files, also ...
during initialization add the all xxDF to the ODF


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5344 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-15 17:11:38 +00:00
vtarasov 614e9fa566 pkcs15init: sipmlify the 'delete-object' callaback prototype ...
now it takes 'sc_pkcs15_object' argument instead of two arguments - object's type and object's data.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5343 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-15 16:50:04 +00:00
vtarasov 3aae1d39c2 framework-pkcs15: minor coding style issues
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5342 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-15 16:35:29 +00:00
vtarasov fb97d8b4b4 pkcs15-tool: print title and size of the EC public keys
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5341 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-15 16:34:22 +00:00
vtarasov 99fac2685a piv-tool: increase receive buffer for the 'send-apdu' command
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5340 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-15 16:33:18 +00:00
dengert 461721cf6d PIV piv_get_uid to derive a better guid from the
FASCN or the GUID so that most of the uniquness
is maintained. 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5339 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-14 16:51:25 +00:00
alonbl 9ca350f409 Use check target for tests
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5338 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 21:58:04 +00:00
vtarasov 49da421ac0 pkcs15init: prepare pkcs15-lib for the EC key type ...
use keygen consistency procedure to return the EC key size;


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5337 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 18:08:18 +00:00
vtarasov 7b6cf4219e pkcs15init: when deleting object, do not try to select object file without valid path
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5336 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 17:59:59 +00:00
vtarasov 622570a28e pkcs15-init tool: in keygen parameters use 'curve' name without leading separators
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5335 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 17:55:20 +00:00
vtarasov d611dcc9ed piv-tool: add containers discovery
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5334 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 17:51:08 +00:00
vtarasov 6705e2506b pkcs15init: remove useless function, use OpenSC standard convention for return value
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5333 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 13:23:05 +00:00
vtarasov 2fecaa73bd pkcs15init: introduce EC key generation parameters
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5332 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 11:36:40 +00:00
martin cdf88a895b WindowsInstaller: amend r5329, object name is not the target name.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5331 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 07:49:07 +00:00
martin 44cf3d06ae MiniDriver: rename cardmod to minidriver in source.
Also change some grammar, whitespace (reported by git) and wording (Opensc->OpenSC) issues.
Add some comments here and there.

See http://www.opensc-project.org/pipermail/opensc-devel/2011-April/016261.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5329 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 07:40:12 +00:00
martin 577ccdbf26 Fix #337 rutoken-tool is obsolete and can be removed, thus no manpage is needed.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5328 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-11 14:42:55 +00:00
vtarasov 771aeb32af pkcs15-tool: print EC key label
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5326 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-11 13:07:34 +00:00
vtarasov e8f6a3e407 pkcs11-tool: now it's possible to show only the objects of a given type ...
when 'type' option is used with the 'list-objects' actions


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5325 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-11 13:00:57 +00:00
vtarasov b85e1a798f piv-tool: new action to print the key slots properties
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5324 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-11 12:02:47 +00:00
vtarasov eb7bc552b1 piv: no 'usepin' authentication mode in PIV tools
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5323 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-11 11:55:00 +00:00
vtarasov 54fb422831 pkcs15: include EC private/public key types into the pkcs#15 object search procedures
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5322 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-11 11:30:45 +00:00
andre 383d6e8362 ctx.c: Replaces magic integer -1 with defined constant value.
See [http://www.opensc-project.org/opensc/browser/trunk/src/libopensc/cards.h?rev=5320#L32 cards.h]

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5321 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-11 10:34:55 +00:00
vtarasov f1dec64630 piv-tool: in 'send-apdu' command increase size of response buffer ...
'GET DATA' apdu can return the code 'data still available'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5320 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-10 20:08:09 +00:00
vtarasov 848180ab50 libopensc: use short debug macros in card.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5319 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-10 09:20:15 +00:00
vtarasov b614444aae libopensc: use short debug macros in pkcs15.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5318 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-10 09:18:25 +00:00
vtarasov 5102e4d882 card-piv: 'emulate' MF selection by selection of the PIV applet ...
so that, PIV card can be used with the 'opensc-explorer' interactive tool


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5317 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-10 08:47:35 +00:00
andre 3169f14b32 libopensc: Removes useless attribute 'file' in 'struct sc_pkcs15_df'
There is no need to carry around that attribute, because it's easy to look up the 'file' as needed. This is done by issuing a single sc_select_file command in sc_pkcs15init_update_any_df (pkcs15-lib.c).

The parameter 'file' of sc_pkcs15_add_df (pkcs15.c) became useless too and was removed in turn.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5316 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-10 04:09:33 +00:00
vtarasov 86af8eed3d card-pin: make working 'external authenticate' ...
'key-ref' and 'algo' arguments of the piv_general_external_authenticate() function 
were not used


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5315 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-09 19:26:34 +00:00
vtarasov 004c08b6a0 card-piv: invalid arguments for SC_TEST_RET macro
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5314 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-08 15:16:47 +00:00
andre be2c17c7e9 pkcs11: Fixes leftover from r4646.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5313 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-08 13:50:02 +00:00
andre 69c846f904 libopensc: Re-defines SC_CARD_FLAG_ONBOARD_KEY_GEN to be local to the file card-flex.c, because that flag is used nowhere else. In principle, this patch only reverts some changes made by r2192.
Relates to #296.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5312 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-08 13:30:32 +00:00
vtarasov cfffb7f5dd piv-tool: 'admin' and 'genkey' options need an argument ...
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5311 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-08 12:28:59 +00:00