Commit Graph

945 Commits

Author SHA1 Message Date
Viktor Tarasov c66278098b tools: missing names for ACL methods
thanks to fdeybach@gmail.com
https://sourceforge.net/mailarchive/message.php?msg_id=30684430
2013-04-06 22:06:52 +02:00
Viktor Tarasov c1b6575204 pkcs15init tool: throw error when invalid appliaction-id supplied
fix action labels
2013-03-11 18:25:05 +01:00
Viktor Tarasov a24ecd0733 pkcs11-tool: ignore CRYPTOKI_ALREADY_INITIALIZED error
https://github.com/OpenSC/OpenSC/pull/118
Print warning and ignore 'Cryptoki library has already been initialized'  error
returned by C_Initialize().
2013-03-10 13:45:32 +01:00
Viktor Tarasov 7a57fa8689 win32: build and include to MSI package 'openpgp-tool.exe' 2013-02-25 19:12:06 +01:00
Martin Paljak 16ee818440 Update domain name. paljak.pri.ee is gone since 2011. 2013-02-25 11:58:25 +02:00
Frank Thater 0577f7d4f5 sc-hsm-tool: Added support for DKEK password sharing scheme 2013-02-07 15:07:42 +01:00
Andreas Schwier 6d51b320f3 sc-hsm-tool: Added better error handling for non-SmartCard-HSM cards 2013-01-27 18:42:33 +01:00
mescheryakov1 f55bb019d9 Update src/tools/pkcs11-tool.c
fixed filling key type attr on writing object

pointer refers to local variable from destroyed stack frame
2013-01-27 18:37:45 +01:00
Viktor Tarasov 4c1c39f3e4 opensc-tool: add 'call-SM-handler' command
'open' and 'close' handlers of the card's SM driver can be called
2013-01-06 13:13:08 +01: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
sjoblomt 457426543d MyEID ECDSA support 2012-12-03 14:37:13 +01:00
Viktor Tarasov 9e9b3d0bd8 tool: in 'do_apdu' increase size of send/receive buffers 2012-11-28 11:09:36 +01:00
Anthony Foiani f63135afab tools: check return value after each call.
It seems that this suffered some copy and paste damage at some point.
Change so that we check each return value immediately after the API
call.

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
2012-11-20 08:46:27 +01:00
Andreas Schwier fb8e0cc3b2 sc-hsm: Improved checking in sc-hsm-tool 2012-11-20 08:46:27 +01: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 a4ac33f32a build sc-hsm-tool: link with OpenSSL libs 2012-11-11 20:36:57 +01:00
Andreas Schwier ffb20e5916 sc-hsm: Added sc-hsm-tool with DKEK support and key wrap / unwrap 2012-11-11 12:53:03 +01:00
Viktor Tarasov 1d1abe4c21 pkcs15-crypt tool: set HASH_NONE crypto flags when the hash do not asked
without this for the cards that have only RAW mechanism
it's not possible to compute signature with PKCS1 padding and without hash.
2012-11-11 00:42:52 +01:00
Viktor Tarasov 6819b32e18 pkcs15-tool: for public key show the presence of 'direct' value 2012-11-09 14:34:46 +01:00
Andreas Schwier fba298c6f4 pksc11: Added ability to indicate hardware and firmware version information at PKCS#11 interface 2012-10-21 15:51:55 +02:00
Andreas Schwier 1619a42375 ecc: Adding more curves 2012-10-01 13:04:02 +02:00
Andreas Schwier 02fe6d474b pkcs11-tool: Fixed issue with ID increment failing on constant data 2012-10-01 13:04:01 +02: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
Ludovic Rousseau ea40e7fe24 Use AM_CPPFLAGS instead of INCLUDES
Fix autoreconf warnings:

$ autoreconf -vis -Wall
[...]
src/common/Makefile.am:12: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/libopensc/Makefile.am:19: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/minidriver/Makefile.am:15: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/pkcs11/Makefile.am:10: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/pkcs15init/Makefile.am:36: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/scconf/Makefile.am:12: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/sm/Makefile.am:8: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/tests/Makefile.am:9: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/tools/Makefile.am:15: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
2012-09-25 23:03:38 +02:00
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 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
Viktor Tarasov 8c342ec772 tools: t404: redesign treatment of 'reader' option
in previous version
first of all the 'reader' option's value was converted to hexadecimal form,
used as ATR value
and all present readers where scanned to find the inserted card with such ATR.
Only after this the 'reader' option was used as reader's number or reader's name.

Currently in use the 'hex-to-bin' procedure accepts for conversion one digit,
and so even if the 'reader' option value is one digit,
the useless search over all present readers take place.

In the current version the order of checks if kept (ATR, reader's number, reader's name),
but enforced the validity check of ATR, presented by 'reader' option.
Also the option is accepted as reader's number only if the 'entire' option's string can be converted to integer.

Thanks to 'jbwisemo' for cooperation.
https://www.opensc-project.org/opensc/ticket/404
2012-08-30 18:51:54 +02:00
Viktor Tarasov 41861e42b0 no 'pace' in common part
'PACE' is extremely card specific protocol and has not to be ostensibly
present in the common part of OpenSC:
 * currently in OpenSC there is no card driver that supports or uses this protocol;
 * amazing content of the common 'sc_perform_pace' -- beside the verbose logs
   the only substantial action is to call the card/reader specific handler.
   According to the current sources and the pull request 83
   this 'common' procedure is called by the card driver or
   card specific tool/operation.
 * currently the 'PACE' can be thouroghly tested only by one person (Frank Morgner),
   and only using the OpenSSL patched with the PACE specific patch.
   So, at least a dedicated configuration option could be introduced when comiting PACE to the common part.
 * common 'sc_perfom_pace' has the same role as the 'initialize-SM' handler of the existing SM framework
   and can be implemented as card specific SM, as the others cards do.
   This confirmed by Frank Morgner, the author of PACE commits and nPA card driver, himself.
   (https://github.com/OpenSC/OpenSC/pull/83)
2012-08-30 18:51:42 +02:00
Andreas Schwier 68c87fd88e pkcs15-tool: Fix display error for fieldLength of ECC private keys 2012-08-24 13:15:39 +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
Peter Marschall feb2b96127 opensc-explorer: allow filename-pattern as argument to 'ls'
Make ls more flexible and more similar to the UNIX ls.
2012-08-19 21:31:32 +02:00
Viktor Tarasov ca08e97ab7 pkcs11: #162,#370,#115,#413: reselect application DF issue
Limit the number of cases when applicated re-selection of application DF to strict minimum.
I.e. only when pkcs11 login session is not locked and private key PKCS#15 object do not
contain the 'path' attribute.
2012-08-19 18:18:59 +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
Peter Marschall 4035245649 opensc-explorer: allow longer PINs in CHANGE & UNBLOCK
Harmonize the allowed PIN length in CHANGE & UNBLOCK with the one in VERIFY,
making sure they are large enough for OpenPGP, which allows up ro 32 characters,
and giving additional security margin for other cards.
2012-08-11 21:33:36 +02:00
Viktor Tarasov 71ec763604 opensc-explorer: warnings when compiling with Windows VC
opensc-explorer.c(447) : warning C4101: 'count' : unreferenced local variable
opensc-explorer.c(940) : warning C4013: 'strlcpy' undefined; assuming extern returning int
opensc-explorer.c(1683) : warning C4013: '_isatty' undefined; assuming extern returning int
opensc-explorer.c(1726) : warning C4090: 'function' : different 'const' qualifiers
2012-08-11 20:48:58 +02:00
Peter Marschall 7f22ede919 opensc-explorer: show text message for APDU result 2012-08-11 20:48:58 +02:00
Peter Marschall 95cbfbb799 opensc-explorer: increase allowed bytes in RANDOM
Allow to fetch up to 256 random bytes from the card -
236 being the maximal value for Le in short APDUs.
2012-08-11 20:48:58 +02:00
Peter Marschall ea8a64d95a opensc-explorer: allow entering the PIN interactively
In VERIFY, allow the user to enter the PIN unteractively if it was not given
on the command line, and if the card reader does not support PIN input.

If it was not given on the command line and the card reader supports PIN input,
then the bahaviour is unchanged: enter PIN via card reader.
2012-08-11 20:48:58 +02:00
Peter Marschall 322e3cf403 opensc-explorer: convert CHANGE & UNBLOCK to sc_pin_cmd 2012-08-11 20:48:58 +02:00
Peter Marschall 81695df211 opensc-explorer: use standard usage() everywhere
With the improvements of the man page, there is no need any more to have
local help texts for functions.
2012-08-11 20:48:58 +02:00
Nguyễn Hồng Quân affb38304e pkcs15-init tool: Change the order of action.
DELETE_OBJECT will be done before STORE_XXX.
2012-07-29 13:09:08 +02:00
Nguyễn Hồng Quân 69e30ead89 openpgp-tool: Key generation support.
openpgp-tool: PIN verfication support.
openpgp-tool: Add notification in case of error.
openpgp-tool: Add manual for key generation and PIN verification.
2012-07-29 12:48:45 +02:00