Commit Graph

242 Commits

Author SHA1 Message Date
Frank Morgner d96f25c147 pkcs15-tool: fixed resource leak 2015-05-08 09:11:54 +02:00
Frank Morgner 02f3997632 added error handling to print_ssh_key 2015-04-21 01:32:37 +02:00
Dirk-Willem van Gulik 4000e6d5b0 Add missed option debug info
Fix misspelled key in --help output (thanks Philip Wendland).
2015-04-08 18:03:46 +02:00
Dirk-Willem van Gulik 88ec461bc5 tool: RFC4716 compliant key output
Add a comment field to the ssh key output if a label is set on the key. Add RFC4716 compliant key output for the new breed of modern (mobile) SSH clients.

VTA: use short form of log call in iso7816
2015-03-31 19:09:25 +02:00
Frank Morgner a3fc62f79f fixed NULL dereference (or warning thereof) 2015-02-05 01:38:40 +01:00
Frank Morgner 2f3eaa1dbe Merge pull request #366 from frankmorgner/coverity
Fixes for Problems reported by Coverity Scan
2015-02-02 23:51:10 +01:00
Viktor Tarasov 8e9a2361c6 pkcs15-tool: print length of EC public key
when this key is read from dedicated EF
2015-02-02 16:55:07 +01:00
Frank Morgner 2e04fa99c1 fixed pointless array comparisons 2015-01-28 07:39:35 +01:00
Frank Morgner 77752f442d fixed unused value 2015-01-28 05:47:20 +01:00
Frank Morgner 7a34c204c1 fixed dereference before null check
silence warnings reported by coverity-scan
2015-01-22 20:29:33 +01:00
Frank Morgner 73715e37d9 fixed compiler warnings
fixed warnings introduced with b18c86e646

fixes memory leaks in pkcs15-init and pkcs15-tool
2014-12-12 21:45:53 +01:00
Frank Morgner 4459e146c4 use util_get_pin in tools 2014-11-04 22:07:07 +01:00
Dirk-Willem van Gulik 4e73d0e36f Merge PR#280 from dirkx/master: --no-prompt flag
Add a --no-prompt flag to pkcs15-tool (i.e. the equivalent of the --no-prompt flag of pkcs15-init). As to aid readers with keypads (as commonly used in the medical space).
2014-10-01 14:36:52 +02:00
Frank Morgner bb160bfd99 pkcs15-tool: fixed file reading 2014-09-07 22:13:04 +02:00
Frank Morgner 5d6c4b391d Merge pull request #253 from github-frankmorgner/remove-deadcode
card-asepcos: removed dead code
card-authentic: removed dead code
card-belpic: removed dead code
card-epass2003: removed dead code
card-flex: removed dead code
card-gpk: removed dead code
card-oberthur: removed dead code
card-piv: removed dead code
card-setcos: removed dead code
ctbcs: removed dead code
cwa14890: removed dead code
muscle: removed dead code
pkcs15-atrust-acos: removed dead code
pkcs15-gemsafeV1: removed dead code
pkcs15-skey: removed dead code
reader-ctapi: removed dead code
framework-pkcs15: removed dead code
pkcs11-object: removed dead code
pkcs15-asepcos: removed dead code
pkcs15-cardos: removed dead code
pkcs15-jcop: removed dead code
pkcs15-lib: removed dead code
pkcs15-oberthur: removed dead code
parse: removed dead code
sclex: removed dead code
sm-card-authentic: removed dead code
sm-card-iasecc: removed dead code
sm-cwa14890: removed dead code
sm-global-platform: removed dead code
sc-test: removed dead code
pkcs11-tool: removed dead code
pkcs15-tool: removed dead code
2014-09-07 21:22:43 +02:00
Frank Morgner a64326e768 fixed compiler warnings (partially submitted)
Signed-off-by: Frank Morgner <morgner@informatik.hu-berlin.de>

PR-222: commit 0b567dbaa8
partially submitted by Viktor Tarasov
2014-05-03 21:47:15 +02:00
Frank Morgner 46b0bed93f fixed PUK handling
Note that
`SC_PKCS15_PIN_AUTH_TYPE_PIN` is used for `sc_pkcs15_auth_info_t.auth_type`
`SC_PKCS15_TYPE_AUTH_PIN`     is used for `sc_pkcs15_object_t.type`
2014-04-21 20:43:41 +02:00
Viktor Tarasov 3d3592ab28 pkcs15-tool: remove unused 'pubkey_pem_encode()'
used instead the sc_pkcs15_encode_pubkey_as_spki()
2014-01-13 12:48:16 +01:00
Viktor Tarasov 0dc39c1125 pkcs15: use value/length pair to hold the object's GUID
GUID can be presented by non-printable string
2013-12-29 19:47:42 +01:00
Viktor Tarasov 98325ab7f2 pkcs15: export 'sc_pkcs15_serialize_guid' ...
change name of exported 'sc_pkcs15_get_guid' to 'sc_pkcs15_get_object_guid' ;
add more 'CALLED' and 'RETURN' macros ;
2013-12-29 19:46:56 +01:00
Viktor Tarasov 411cbfb403 md: use if available the GUID from the prkey info ...
the proprietary on-card data can contain the GUIDs created by proprietary MW,
these data are parsed by card driver and put into the internal pkcs15 private key data
to be accesible in the different OpenSC frameworks
2013-12-29 19:46:56 +01:00
Viktor Tarasov e855ac800e pkcs15: introduce 'cmap-record' data into the private key info
existing  'guid' obejct's data replaced by the one in private-key info
New CMAP record data used by pkcs15init emulator for the cards that have
the MD specific on-card data
2013-12-29 19:46:30 +01:00
Andreas Schwier d4be8ec747 sc_pkcs15_encode_pubkey_as_spki replaces sc_pkcs15_encode_pubkey_with_param.
The name implies what the format of the returned value, a SPKI.

The support for spki as a pkcs15 format of a pubkey, is extended to
work for any algorithm not just EC pubkeys. PKCS#15 appears to allow this.

sc_pkcs15_decode_pubkey_with_param will look for a SPKI
and attempt to use it for any algorithm, including RSA.
(RSA is the null case, as there are no algorithm parameters.)

sc_pkcs15_encode_pubkey_as_spki is exported from libopensc.

pkcs15-piv.c will use sc_pkcs15_encode_pubkey_as_spki to load public keys
as SPKI for RSA and EC.

The pubkey->data is never a SPKI, it is the DER encoding of the
pubkey without the parameters.  If an spki is needed, use the
sc_pkcs15_encode_pubkey_as_spki to get the DER encoding of the spki.

As in the previous set of patches, pkcs15-tool.c will output both
sc_pkcs15_decode_pubkey_with_param and its internal.
This was left for testing, and the pubkey_pem_encode should be deleted
2013-12-06 09:23:57 +01:00
Viktor Tarasov f641ebd248 fixed errors reported by cppcheck: part 1
partially applied the pull request #182 from Frank Morgner -- updated the common frameworks source files
2013-09-29 20:28:45 +02:00
Frank Morgner 6e728a89ee verifying the pin is a valid action 2013-09-29 18:53:04 +02:00
Frank Morgner 3d0064e983 don't expect the card to specify the file length in generic tools
if sc_file_t.size == 0 we try to read 1024 bytes by default.
2013-09-29 18:52:48 +02:00
Anthony Foiani f7c12574ee pkcs15-tool: initialize 'opt_auth_id' consistently.
All the other option values are initialized to NULL, so do the same to
opt_auth_id.

(Although, as they're all static globals, they should be set to 0 at
runtime anyway, I think...)

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
2012-12-10 00:54:26 -07:00
Viktor Tarasov bd86063835 t455: check validity of RSA/DSA public key components
Segmentation fault happened when reading SSH key with the non-initilized public key components.
2012-11-12 10:13:57 +01:00
Viktor Tarasov f7771c9b08 libopensc: check data returned by 'read-public-key'
fix error message
2012-11-11 21:47:10 +01:00
Viktor Tarasov 6819b32e18 pkcs15-tool: for public key show the presence of 'direct' value 2012-11-09 14:34:46 +01:00
Viktor Tarasov df9a4d0b2c pkcs15: for 'sc_pkcs15_cer's data use the 'der' object type
To hold the raw certificate blob in 'sc_pkcs15_cert' data use the 'sc_pkcs15_der' data type.
also:
; in 'pkcs15-cert.c' use short call of the debug messages;
; in 'destroy-object' pkcs15 framework handler take into account the multi-application cards:
-- when binding card use the application info;
-- when finalizing profile use the application ID.
2012-09-30 22:54:52 +02:00
Viktor Tarasov 760cd1cfbd pkcs15-tool: non-initialised OID 2012-09-23 16:51:25 +02:00
Viktor Tarasov 58b4304957 libopensc: 'init', 'format', 'compare', 'is-valid' OID procedures
In a reason of number of bugs(*) that concern the OID management,
the general usage OID procedures 'init', 'format', 'compare', 'is-valid' are introduced.
These procedures should be used by all actors: libopensc, pkcs15, pkcs11, tools, ....

(*)
This bug reported by Andreas Schwier :
8e75d971cb (commitcomment-1792477)

In pkcs15-algo sc_asn1_get_algorithm_info() can return the OID without ending '-1's:
https://github.com/OpenSC/OpenSC/blob/staging/src/libopensc/pkcs15-algo.c#L452
https://github.com/OpenSC/OpenSC/blob/staging/src/libopensc/pkcs15-algo.c#L459
2012-09-06 10:47:29 +02:00
Andreas Schwier 68c87fd88e pkcs15-tool: Fix display error for fieldLength of ECC private keys 2012-08-24 13:15:39 +02:00
Viktor Tarasov c6f4e09477 pkcs15-tool: coverity scan warning RESOURCE-LEAK
Coverity scan CID 402622: Resource leak (RESOURCE_LEAK)
2012-06-11 20:04:08 +02:00
Peter Marschall 56affa612f pkcs15-tool: help text clean-up
"to be binded to " -> "to bind to"
2012-06-08 20:32:33 +02:00
Viktor Tarasov 67136befe8 pkcs15-tool: print content of DATA object ...
list the 'Authentication' objects instead of 'PIN' objects.
2012-06-08 20:17:36 +02:00
Viktor Tarasov c7258a6b52 pkcs15-tool: list secret keys objects ...
and print its attributes.
Print attributes of 'authentication-key' object.
2012-06-01 16:58:47 +02:00
Peter Marschall 367ebd94d4 tools: allow arguments to be printed in usage message
Extend util_print_usage_and_die() by a string argument that describes
further arguments to the program.

1st user: opensc-explorer
2012-05-30 09:39:12 +02:00
Viktor Tarasov 6337149ef7 pkcs15: decode 'seInfo', 'profileIndication', 'lastUpdate'
Encode,decode  'lastUpdate', 'seInfo', 'profileIndication' of TokenInfo (CIAInfo).
Trailing whitespaces.
2012-05-30 09:03:27 +02:00
Viktor Tarasov cb13633634 remove trailing whitespaces
inspired by
http://www.opensc-project.org/pipermail/opensc-devel/2012-March/017883.html

Change-Id: If170e830d8d9587a31742feffb6fff54cfdf75b4
2012-04-03 00:00:56 +02:00
Martin Paljak 51804601e4 pkcs15-tool: also print the PIN reference in hex.
This eases debugging.
2011-09-16 14:08:39 +03:00
vtarasov d888b3fd55 pkcs15: use general 'AuthenticationObject' instead of 'PinObject'
now the attributes of the previous 'pin-info' data type are included
as the sub-type attributes of the general 'auth-info' data .
It will allow to include support of the 'biometricTemplate' and 'authKey' authentication types.

http://www.opensc-project.org/pipermail/opensc-devel/2011-May/016655.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5550 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-05 15:46:25 +00:00
vtarasov e81c174372 pkcs15-tool: encode GOST public key with the key parameters ...
.. so that it can be used with the OpenSSL tools


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5521 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-29 18:25:04 +00:00
martin 3655d1a1e4 pkcs15-tool: align access flags with the rest of output.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5500 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-24 19:08:05 +00:00
vtarasov 38473e1ea6 pkcs15-tool: for PIN object print 'Auth ID'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5445 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-14 18:00:08 +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 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 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 a5d1058157 pkcs15-tool: print GUID for private key
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5310 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-08 10:03:42 +00:00
vtarasov b8b4c74d07 pkcs15-tool: print key reference in a decimal and hexadecimal formats
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5309 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-08 09:57:38 +00:00
vtarasov 17fea1f65f pkcs15-tool: include GUID to the printed certificate info
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5303 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-07 16:43:54 +00:00
vtarasov 42aee0f4d5 pkcs15-tool: use dedicated function to free the object memory
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5229 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-14 18:01:40 +00:00
andre 10e5a18ec9 pkcs15-tool.c: Avoid compiler warnings:
pkcs15-tool.c:1111: warning: comparison between signed and unsigned
pkcs15-tool.c:1117: warning: comparison between signed and unsigned

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5224 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-07 18:14:31 +00:00
martin 9afbc55883 pkcs15-tool: check for remaining PIN tries before changing a PIN.
If the card supports it, changing a blocked PIN will result in an error before PIN entry, not when the card re-states that the PIN is already blocked.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5123 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-27 14:25:30 +00:00
vtarasov 04f9c46d15 pkcs15-tool: do not print empty path, print path also when it only has 'aid' member
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5109 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-18 16:06:29 +00:00
vtarasov 3efe35d246 libopensc: avoid the using of not completely initialized 'sc_path' variables
to be continued...


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5103 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-17 19:00:52 +00:00
vtarasov 0fefb0b078 pkcs15-tool: do not print non-relevant to the 'list-applications' context information
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5074 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 17:13:14 +00:00
vtarasov bbcc780460 pkcs15-tool: in help message move 'list-applications' action to the head of the actions group
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5053 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-07 08:50:41 +00:00
vtarasov 2f0b83eecd pkcs15-tool: new action 'list-applications'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5052 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-06 16:21:15 +00:00
vtarasov b9e25370ab tools: use 'aid' as the name of option to specify the on-card PKCS#15 application
; update documentation;
; debug messages;
; cleanup the authentic card profile.
 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5050 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-06 14:39:19 +00:00
vtarasov 4914b022d1 pkcs15-tool: new 'bind-to-aid' argument ...
indicate application to bind when multi-application card is used


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5042 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-05 14:29:49 +00:00
vtarasov f2924672d8 pkcs15: add 'aid' parameter to the prototype of the 'bind' functions ...
prepare for the multi-application support


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5041 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-05 14:21:04 +00:00
vtarasov 5a9e4b1ca6 pkcs15-tool: minor change of the private key info layout
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5000 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-30 12:29:29 +00:00
ludovic.rousseau 07ccc3965e pkcs15-tool.c: In function ‘verify_pin’:
pkcs15-tool.c:976: warning: declaration of ‘r’ shadows a previous local
pkcs15-tool.c:972: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4867 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-06 17:05:32 +00:00
ludovic.rousseau 8dd3b98b1d pkcs15-tool.c:150: warning: initialization discards qualifiers from pointer target type
pkcs15-tool.c:151: warning: initialization discards qualifiers from pointer target type
pkcs15-tool.c:152: warning: initialization discards qualifiers from pointer target type
pkcs15-tool.c:153: warning: initialization discards qualifiers from pointer target type
pkcs15-tool.c:154: warning: initialization discards qualifiers from pointer target type
pkcs15-tool.c:155: warning: initialization discards qualifiers from pointer target type
pkcs15-tool.c:156: warning: initialization discards qualifiers from pointer target type
pkcs15-tool.c:157: warning: initialization discards qualifiers from pointer target type
pkcs15-tool.c:158: warning: initialization discards qualifiers from pointer target type
pkcs15-tool.c:159: warning: initialization discards qualifiers from pointer target type
pkcs15-tool.c:160: warning: initialization discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4866 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-06 17:04:04 +00:00
dengert bd93b97674 Additianl changes to r4805 which made cert->pubkey a pointer to sc_pkcs15_pubkey_t
Thanks to Andre Zepezauer for pointing out most of these. 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4828 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-25 20:58:02 +00:00
martin 6a750e6cc0 tools: -v sets ctx->debug only if set more than once. -vv also makes the debug go to stderr.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4818 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-20 07:53:19 +00:00
martin 50f99a20f8 libopensc: move TokenInfo fields from sc_pkcs15_card_t to a separate structure.
Thanks to Andre Zepezauer for the patch.

See http://www.opensc-project.org/pipermail/opensc-devel/2010-September/015076.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4788 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-05 15:44:58 +00:00
martin a404370f0c pkcs15-tool: harmonize and align the output of --dump
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4738 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-20 23:10:29 +00:00
martin 09fb4468d0 pkcs15-tool: only print Auth ID if present
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4737 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-20 23:10:23 +00:00
martin 215b3fc056 pkcs15-tool: pretty-print common object flags.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4736 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-20 23:10:16 +00:00
martin 49577941d6 Fixup for #102: also in command help.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4675 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-02 18:23:49 +00:00
viktor.tarasov 0285264af5 #73: pkcs15-tool: when changing PIN, print message if no PIN value supplied
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4658 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-30 16:37:15 +00:00
ludovic.rousseau f47416d60e Do not cast the return value of malloc(3) and calloc(3)
From http://en.wikipedia.org/wiki/Malloc#Casting_and_type_safety
" Casting and type safety

malloc returns a void pointer (void *), which indicates that it is a
pointer to a region of unknown data type. One may "cast" (see type
conversion) this pointer to a specific type, as in

int *ptr = (int*)malloc(10 * sizeof (int));

When using C, this is considered bad practice; it is redundant under the
C standard. Moreover, putting in a cast may mask failure to include the
header stdlib.h, in which the prototype for malloc is found. In the
absence of a prototype for malloc, the C compiler will assume that
malloc returns an int, and will issue a warning in a context such as the
above, provided the error is not masked by a cast. On certain
architectures and data models (such as LP64 on 64 bit systems, where
long and pointers are 64 bit and int is 32 bit), this error can actually
result in undefined behavior, as the implicitly declared malloc returns
a 32 bit value whereas the actually defined function returns a 64 bit
value. Depending on calling conventions and memory layout, this may
result in stack smashing.

The returned pointer need not be explicitly cast to a more specific
pointer type, since ANSI C defines an implicit conversion between the
void pointer type and other pointers to objects. An explicit cast of
malloc's return value is sometimes performed because malloc originally
returned a char *, but this cast is unnecessary in standard C
code.[4][5] Omitting the cast, however, creates an incompatibility with
C++, which does require it.

The lack of a specific pointer type returned from malloc is type-unsafe
behaviour: malloc allocates based on byte count but not on type. This
distinguishes it from the C++ new operator that returns a pointer whose
type relies on the operand. (see C Type Safety). "

See also
http://www.opensc-project.org/pipermail/opensc-devel/2010-August/014586.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4636 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-18 15:08:51 +00:00
viktor.tarasov 3a3c41a6db pkcs15: encode/decode 'AccessControlRules' in 'CommonObjectAttributes'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4515 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-06 09:09:04 +00:00
viktor.tarasov fec213ad2e pkcs11: DER encoded value for CKA_SERIAL_NUMBER
discussed in http://www.opensc-project.org/pipermail/opensc-devel/2010-May/014264.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4375 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-25 08:06:28 +00:00
viktor.tarasov 25fa645b90 pkcd15-tool: use local 'getpass' procedure
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4267 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-26 12:29:44 +00:00
martin c73aaf990a pkcs15-tool: fix help text, reader must no be a number
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4226 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:29:17 +00:00
martin 5b40b0eb0c pkcs15-tool: Remove a redundant sc_lock/sc_unlock pair
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4222 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:28:59 +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 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
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 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 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
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
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
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
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
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 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
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 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