Commit Graph

385 Commits

Author SHA1 Message Date
Viktor Tarasov 628ead7e41 pkcs11-tool: suppress warnings about the missing attributes
when showing an object  do not print warnings about missing 'uncommon' attributes
2012-09-24 11:51:04 +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 0fa6e7f977 pkcs11-tool: Added CKM_SHA256_RSA_PKCS to tests in test_signatures 2012-08-20 11:22:02 +02:00
Andreas Schwier efb4673ec8 Revert change to pkcs11-tool because of upstream changes in RSA signature tests
Fixed a typo that went undetected
2012-08-20 11:22:02 +02:00
Viktor Tarasov 8e8acf1ff6 pkcs11-tool: implement 'find mechanism from the given list'
and use it when testing signature
2012-08-20 11:22:02 +02:00
Andreas Schwier f678b68650 Activated ECDSA for SmartCard-HSM
Fixed issues in pkcs11-tool/test_signature is card has RSA and ECDSA keys
Fixed bug in sc_pkcs11_signature_size that returns the wrong ECDSA signature size
2012-08-20 11:22:02 +02:00
Viktor Tarasov cb54ebf747 pkcs11: #371: Public key create template should not include CKA_MODULUS_BITS
Thanks to 'z22' and Martin.
2012-08-16 16:00:35 +02:00
Viktor Tarasov 7e42c6d97d pkcs11-tool: #407: on Windows use O_BINARY open file mode
https://www.opensc-project.org/opensc/ticket/407
http://msdn.microsoft.com/en-us/library/ee2849wt%28v=VS.71%29.aspx
2012-08-15 23:15:06 +02:00
Viktor Tarasov dfbc3996bf pkcs11: #439: 'SEQUENCE' of 'SET' issue when comparing cert attributes
Thanks to 'crank'.
https://www.opensc-project.org/opensc/ticket/439

Some pkcs11 callers (i.e. netscape) will pass in the ASN.1 encoded SEQUENCE OF SET,
while OpenSC just keeps the SET in the issuer/subject field.
2012-08-15 19:59:09 +02:00
Viktor Tarasov 25f7bc5ac5 pkcs11-tool: implement 'find mechanism from the given list'
and use it when testing signature
2012-08-13 11:34:01 +02:00
Viktor Tarasov 2cff47d9b3 pkcs11-tool: support for secret-key objects
support of 'secret-key' objects
key conversion procedures are now in libopensc library
change name for OPENSC NON-REPUDIATION CKA attribute
2012-06-02 18:25:23 +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 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
andre 8a5961e970 pkcs11-tool.c: At least CKS_RO_PUBLIC_SESSION is needed.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5563 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-08 08:50:42 +00:00
vtarasov a479c368a6 pkcs11-tool: allow non-interactive change of User/SO PIN
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5543 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-02 19:20:11 +00:00
vtarasov 3095f5479f pkcs11-tool: resolve compiler warning '"OPENSSL_VERSION_NUMBER" is not defined', thanks to Ludovic
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5536 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-02 17:12:12 +00:00
andre 31a56bb374 pkcs11-tool.c: Remove useless parameter 'slot' from a lot of function prototypes.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5533 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-01 18:51:26 +00:00
vtarasov 185e3f8259 pkcs11-tool: replace 'slot-label' argument with the two new ones -- 'slot-description' and 'token-label'...
the main difference between 'slot-description' and 'token-label' is that 
the first one is unique in any case, 
the second one can be the same for more then one slots.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5528 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-30 14:47:50 +00:00
vtarasov 8931231396 pkcs11-tool: show CKA_VALUE of the GOST public key object
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5527 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-30 13:28:16 +00:00
vtarasov 4d2428378d pkcs11-tool: CKA_VALUE of imported GOST key has to be presented in the little endian order
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5518 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-29 17:55:26 +00:00
andre 4a2dfa6822 pkcs11-tool.c: In function ‘sign_data’:
pkcs11-tool.c:1253: warning: comparison between signed and unsigned
pkcs11-tool.c: In function ‘write_object’:
pkcs11-tool.c:1777: warning: unused variable ‘type’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5505 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-27 09:24:09 +00:00
vtarasov dd30eb1905 pkcs11-tool: import GOST key; key to import in DER or PEM format
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5465 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-22 10:52:44 +00:00
vtarasov cb39b2dcc9 pkcs11-tool: when doing signature try at first the procedure for the short input data ...
Not all PKCS#11 driver support the C_SignUpdate. 
So, for the short data begin with procedure "C_SignInit & C_Sign".
If no success, try to applicate the procedure "C_SignInit & C_SignUpdate & ... & C_SignFinal".


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5458 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-22 07:13:09 +00:00
martin 6277099a27 pkcs11-tool: correct typos about --login-type option, change id -> ID in help texts.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5448 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-17 13:27:13 +00:00
martin 18baf42780 pkcs11-tool: move --module to the first position in help text and make it mandatory.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5447 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-17 13:27:09 +00:00
andre 85b40a553c pkcs11-tool.c:54: warning: missing initializer
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5425 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-04 16:45:51 +00:00
vtarasov e430fe9d87 pkcs11-tool: add test procedure for EC keys ...
... for a while it includes key generation and data signing.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5383 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-21 16:18:23 +00:00
vtarasov c2a87ae2b1 pkcs11-tool: prepare 'gen_keypair' procedure to generate also the EC keys ...
... 'prime256v1' and 'secp384r1'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5381 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-21 14:29:51 +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 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
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
andre 02c4f1ec77 pkcs11-tool.c: Avoid compiler warning 'may be used uninitialized in this function'.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4968 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-18 00:44:12 +00:00
andre b7fad04e10 pkcs11-tool.c: Simplifies interface to show_key() and avoids more compiler warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4967 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-17 23:02:03 +00:00
andre 548630971e pkcs11-tool: replaced OPENSSL_NO_EDSA with OPENSSL_NO_ECDSA
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4922 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 16:28:26 +00:00
martin b5f329ba7c tools: EC(DSA) requires OpenSSL >= 0.9.8.
This fixes building for OS X 10.5.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4918 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 14:41:15 +00:00
dengert b7f4537031 Test for OPENSSL_NO_EC as some systems build OPENSSL without EC.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4906 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-03 15:15:29 +00:00
dengert c2fe4609a9 Modifications to support EC and ECDSA for
emulated cards. True PKCS#15 cards with EC 
will need additional changes. 

Main changes are in framework-pkcs15.c, mechanism.c,
padding.c, pkcs15-algo.c and pkcs15-sec.c 
where switch statements for key type, and testing
of flags was modified to make it easier to add 
additional key types in the future. 

The code was tested using RSA and ECDSA using a PIV card 
from pkcs11-tool, OpenSSL and Thunderbird with 
modifications to NSS-3.12.7 to get ECDSA to sign e-mail. 

Only named curves are supported for ECDSA, ECDH is still 
needed. pkcs11-tool has only minimal changes need to work 
with the -O option to list EC keys. 

One additional line was added to pkcs15-sec.c which 
should get GOSTR sign to work. 

libp11 and engine do not yet have EC support. 

 --This line, and those below, will be ignored--

M    src/tools/piv-tool.c
M    src/tools/pkcs11-tool.c
M    src/pkcs11/framework-pkcs15.c
M    src/pkcs11/mechanism.c
M    src/pkcs11/pkcs11-object.c
M    src/libopensc/pkcs15-prkey.c
M    src/libopensc/card-piv.c
M    src/libopensc/padding.c
M    src/libopensc/cardctl.h
M    src/libopensc/pkcs15-algo.c
M    src/libopensc/libopensc.exports
M    src/libopensc/pkcs15-piv.c
M    src/libopensc/pkcs15-sec.c


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4904 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-01 20:08:42 +00:00
andre fd11c909bd pkcs11-tool: Completing the output of "Mechanism Information Flags".
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4885 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-28 23:46:12 +00:00
andre 146041fcee pkcs11-tool: Correcting the behaviour in the case where C_SignUpdate fails. Quotation from PKCS#11:
"A call to C_SignUpdate which results in an error terminates the current signature operation."

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4884 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-28 22:16:50 +00:00
andre b63a601666 pkcs11-tool: Use attributes MODULUS and PUBLIC_EXPONENT instead of VALUE to retrieve RSA-Public-Key. The first two attributes are valid whereas the latter is not.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4883 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-28 18:09:30 +00:00
andre bcef13cfd2 In login() the flag CKF_LOGIN_REQUIRED is now ignored. This makes the behaviour of login() more predictable. If parameter --login is specified on the command line, then C_Login() is always called.fixes #220
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4875 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-18 14:56:26 +00:00
martin 364ba4882d pkcs11-tool: handle non-recognized tokens gracefully.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4803 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-08 08:36:56 +00:00
martin fad0116fef pkcs11-tool: if no slot is specified on the command line, try to locate a slot with a token.
A modified patch from Andre Zepezauer.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4802 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-08 08:36:48 +00:00
martin f339f9ba77 pkcs11-tool: only do hotplug testing before other activities.
Thanks to Andre Zepezauer for noticing.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4765 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-24 07:24:43 +00:00
martin 3202355fa3 pkcs11-tool: print the token before asking for a PIN code; shorten CKU_CONTEXT_SPECIFIC prompt
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4751 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-21 16:11:49 +00:00
martin 01931d6794 pkcs11-tool: do --test even without a slot, at least hotplug. print a proper error name for C_GetSlotInfo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4750 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-21 16:11:44 +00:00
martin 294a8bca3d pkcs11-tool: pkcs11-tool --verbose does not affect OpenSC debugging. Document a workaround
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4748 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-21 16:11:36 +00:00
martin 50952cdcba pkcs11-tool: cleanup whitespace and remove unused OpenSSL ERR_* calls.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4747 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-21 16:11:31 +00:00
martin 2dff969e05 pkcs11-tool: better separation between opaqe slot IDs and slot list indexes.
--slot will take the actual CK_SLOT_ID
--slot-label will use the token label to find the correct slot
--slot-index will use the N-th slot from the list returned by C_GetSlotList

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4746 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-21 16:11:26 +00:00
martin 7a66f4e339 pkcs11-tool: recognize user PIN related token flags
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4691 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-05 16:53:02 +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 13a42de128 pkcs11 tool: fix messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4593 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-21 09:50:10 +00:00
viktor.tarasov 1090d19d30 #60: pkcs11-tool: print key sizes from CK_MECHANISM_INFO
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4513 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-05 14:43:31 +00:00
viktor.tarasov 3c813ce57b pkcs15-init tool: use Ctrl-C sensible 'getpass'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4252 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-18 09:45:44 +00:00
viktor.tarasov a10bf0e356 pkcs11-tool: #120: use 'getpass' sensible to Ctrl-C, thanks to Andreas
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4251 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-18 08:32:35 +00:00
viktor.tarasov f7575879cc pkcs11-tool: useless assignment
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4248 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-18 07:30:21 +00:00
viktor.tarasov ce485e4895 pkcs11-tool: fix #124; thanks to Thomas Harnings: for the signature tests cannot be used private key without corresponding public key or certificate
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4247 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-17 19:59:32 +00:00
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
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 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
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
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
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 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
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
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 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
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
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
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 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 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 80a16f686d ruToken cleanups
Move constants out of standard files.
Create ruToken specific interface.
Update symbols.

Thread at:
http://www.opensc-project.org/pipermail/opensc-devel/2008-March/010917.html

Cleanup of:
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010617.html



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

Alon Bar-Lev

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

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



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3405 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-06 16:06:59 +00:00
ludovic.rousseau 0ecc294ed8 add support of ruToken
Thanks to Andrew V. Stepanov for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010617.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3304 c6295689-39f2-0310-b995-f0e70906c6a9
2007-12-17 13:39:20 +00:00
aj 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 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
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 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 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 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 a2f622a215 implement support for SHA2 (still experimental)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3115 c6295689-39f2-0310-b995-f0e70906c6a9
2007-02-02 22:15:14 +00:00
aj 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
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
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
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
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 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 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
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 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
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
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 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 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 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 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 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
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
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 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 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 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 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
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
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 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 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
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
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
okir c9de474d80 - Do not overflow signature test for 2K bit keys (fix by Chaskiel Grundman)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1542 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-18 17:07:34 +00:00
okir 6ff1ecbc73 - honor --pin argument for pin pad readers, too
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1537 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-18 12:35:42 +00:00
aet fac4bd6008 Tweak out some compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1486 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-02 08:29:32 +00:00
sth ebca5c681c Added C_DecryptInit() and C_Decrypt() for RSA keys
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1485 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-01 06:51:49 +00:00
sth 1055045267 Fixed a bug in the mechanism listing and made it more general
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1474 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-29 13:45:07 +00:00
aet 0077a0876d Fix various C compiler warnings and C++ errors / name conflicts
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1463 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-25 09:33:16 +00:00
aet ba1a685c8e Don't bother exposing sc_pkcs11_module_t and scdl_context_t
to public headers, use void instead.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1424 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-06 16:18:15 +00:00
sth 55d05ae222 Removed some unnecessary output
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1336 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-06 11:18:21 +00:00
aet 3e1dd82f4f Remove some compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1332 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-05 17:28:29 +00:00
sth 4cbd578bc0 Added test code for Mozilla-like keypair generation and the writing of a certificate
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1300 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-24 11:29:08 +00:00
sth 6ff35eed3d Little fix in test_verify()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1297 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-24 08:35:34 +00:00
sth 23ee080756 Added test code for the new Verify functions
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1287 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-22 09:54:20 +00:00
aet c4d2611d12 - Various build fixes for various operating systems and compilers
- Add missing .cvsignore files
- Remove tools/ and make configure to work again


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1251 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-11 16:31:06 +00:00
sth 033e032820 Added test code for C_SetAttributeValue()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1231 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-27 12:02:39 +00:00
sth 4fb623d537 Some fixes/improvements, e.g. an ID now has to be entered in the same way as in pkcs15-init
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1217 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-24 09:14:57 +00:00
sth 3c50c4d4e0 Some improvements to gen_keypair() and write_object()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1214 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-18 20:49:20 +00:00
sth 20053af948 A first implementation of write_object(), mostly for testing purposes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1182 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-04 12:30:02 +00:00
sth c8c2cf725b First implementation of C_GenerateKeyPair()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1179 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-03 13:57:52 +00:00
okir 0d3948ed42 - in test_signature: check CKA_SIGN before doing any signature tests
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1141 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-16 16:33:42 +00:00
okir 2e673aead6 - Do not try to C_Login if the token doesn't require a login
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1127 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-15 15:28:35 +00:00
okir cf5c0fb3a8 - added --slot-label option to find slot by label
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1118 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-15 11:32:21 +00:00
sth e437a38c98 Dont give errors with -t option if the private key doesnt support key unwrap
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1082 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-30 12:24:40 +00:00
aj 07668a30ff Nils Larsch:
here is a patch to remove a bug in card-starcos.c and two warnings:

card-starcos.c: fix apdu.le value
pkcs15-pin.c: remove unused labels => avoid compiler warnings
pkcs11-tool.c : remove memory leak (a RSA_free() was missing)
	and simplify code (+ remove warning).


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


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1063 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-22 17:00:38 +00:00
sth 0523e1d1fb Fixed an OpenSSL issue with MacOSX
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1061 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-22 12:26:47 +00:00
okir 0f4c706e3b - added tests for key unwrap
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1046 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-17 14:39:44 +00:00
okir 095db2b907 - getting CKA_LABEL would not 0-terminate the string
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1025 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-16 15:53:44 +00:00
okir 1e1eec0d8a - getopt cleanup from aj
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@988 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-11 11:28:09 +00:00
sth 66f7de9378 removed unnecessary debugging
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@923 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-20 23:20:08 +00:00
sth 5265456cab some cleared messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@911 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-17 11:09:24 +00:00
okir 23d686576e - fixed minor compile warning
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@904 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-10 14:08:54 +00:00
sth 0e691fb13e added support for pin pad readers + change pin
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@898 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-05 13:55:22 +00:00
okir f71e2b0c5e - Added test for WaitForSlotEvent
- fixed a bunch of compiler warnings


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@896 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-03 12:23:05 +00:00
sth e8e738aac4 added signature test for all keys
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@891 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-31 15:32:27 +00:00
sth d8871d9a46 some fixes + added cert viewing for -O option
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@884 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-27 13:33:28 +00:00
okir b9c3ec2ec4 - fixed two minor issues in p11 test code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@879 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-21 15:29:17 +00:00
okir 1a994ef760 - a few minor changes from Stef
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@874 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-20 10:02:07 +00:00
okir 5b1eb43b93 - add some support for card removal in pkcs11
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@867 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-19 17:47:07 +00:00
okir a7551e1822 - Patches from Stef implementing PKCS11 RNG related functions
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@866 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-16 20:10:28 +00:00
aet b1eff66867 C++ warning fixes (assuan excluded)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@863 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-14 19:55:45 +00:00
aet 037dbdfa13 Fix compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@845 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-06 23:46:24 +00:00
okir 67608feffb - Win32 fixes in case openssl is not present (Stef)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@842 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-06 19:52:11 +00:00
okir e01554814b - Patch from Stef: add support for --pin and --test
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@823 c6295689-39f2-0310-b995-f0e70906c6a9
2003-01-03 14:33:17 +00:00
okir 079821b8c4 - Added --hash/-h to hash data (Stef Hoeben)
- Added function to translate CKR_* error codes to strings.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@808 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-22 23:16:47 +00:00
aet 1ddde4e899 - Add access, mkdir and getpass wrappers into winconfig.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@806 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-22 14:43:13 +00:00
okir 6d324715da - add missing help message for --module
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@797 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-19 10:49:28 +00:00
okir 9a472d4e65 - fixed rsa-ripemd160 signatures
- Added new option --module


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@794 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-19 09:24:58 +00:00
okir 0c16b3d887 - Added shorthand rsa-ripemd160
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@782 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-17 20:15:56 +00:00
okir 29dd06ba9f - more win32 fixes from Stef
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@779 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-17 16:00:40 +00:00
okir ffd4773e20 - New application: pkcs11-tool
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@776 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-17 11:50:11 +00:00