Commit Graph

5238 Commits

Author SHA1 Message Date
Ludovic Rousseau 6849c909b3 Fix typo 2012-08-06 09:02:42 +02:00
Ludovic Rousseau 12b545f9a9 Merge remote-tracking branch 'upstream/staging' into staging 2012-08-06 09:01:52 +02:00
Viktor Tarasov c5dd9decaa release 0.13.0: update NEWS file 2012-08-05 19:10:06 +02:00
Viktor Tarasov c7827e5e4b sm: change SM data types, thanks to Frank Morgner for revision
http://www.opensc-project.org/pipermail/opensc-devel/2012-July/018232.html
2012-07-29 21:41:44 +02:00
Viktor Tarasov 7301715624 sm: link 'local' SM module with OpenSSL's crypto library 2012-07-29 21:40:47 +02:00
Viktor Tarasov 49e7f529b2 sm: misplaced check of the 'get-sm-apdus' return code 2012-07-29 21:38:39 +02:00
Nguyễn Hồng Quân e34866f188 OpenPGP: Accept authentication key for S/MIME decrypting.
The card contains only 1 certificate, which can be used for encrypting.
But this certificate is bound with authentication key, so when decrypting,
the authentication key will be presented to check.
This commit allows to bypass the check in driver. However, it is not enough.
The users have to import the same key to "Encryption key" to help the card find
right key to work.

OpenPGP: Add log and comments.

OpenPGP: Pretend to select dummy files.
Some files are needed by pkcs15init, but not exist in OpenPGP card.
We pretend to know these dummy files to make pkcs15init successful.

Compilation error on windows:
when declaring array use explicit size, add pkcs15-openpgp.obj in Makefile.mak
2012-07-29 14:04:08 +02:00
Nguyễn Hồng Quân 241bfded4d OpenPGP-pkcs15init: Support generating key via pkcs15-init tool.
OpenPGP-pkcs15int: Add more debug log.

OpenPGP-pkcs15init: Add more checks in key generation.
Check for key ID. Set default key.
Check for result of key generation from driver.
2012-07-29 13:09:08 +02:00
Nguyễn Hồng Quân 30e61d9fbf OpenPGP: Handle access on dummy files, which is assumed to exist by pkcs15init.
OpenPGP: Update card algorithms after importing key.

OpenPGP: Add SC_ALGORITHM_ONBOARD_KEY_GEN flag to card algorithms.
2012-07-29 13:09:08 +02:00
Nguyễn Hồng Quân b67063dcd8 pkcs15init-openpgp: Support for private key import in pkcs15init.
Example command:
pkcs15-init --delete-objects privkey,pubkey --id 3 --store-private-key quan-key.pem  --auth-id 3 --verify-pin --extractable --id 3

pkcs15init-OpenPGP: Some parts in openpgp.profile are not used.
2012-07-29 13:09:08 +02:00
Nguyễn Hồng Quân 7123638454 OpenPGP: Correct access condition for some pubkey blobs.
OpenPGP: Don't really delete pubkeys blobs.
2012-07-29 13:09:08 +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 70b7b4aa54 pkcs15init-OpenPGP: Add store_data functions.
We need this function to use OpenPGP's specific action flow instead pkcs15init's default.
This will help to avoid redundant steps which may make the overall process fail.
2012-07-29 13:09:08 +02:00
Viktor Tarasov 0518ced8e0 asn1: export 'asn1-write-element' function
... used by OpenPGP driver
2012-07-29 13:09:00 +02:00
Nguyễn Hồng Quân 42ad3c1dff OpenPGP: Add support for key import at driver level.
OpenPGP: Some indentations need to be tab-size-independent.

OpenPGP: Check for null data when storing fingerprints.

OpenPGP: Allow to provide creation time to store (when gen/import key).
Old: Only store current time.
New: Can provide time to store, not only calculate current time.

OpenPGP: Correct setting content of pubkey blobs after key generation.

cardctl: Add definitions to support key import in OpenPGP.

OpenPGP: Add support for key import at driver level.
2012-07-29 12:48:59 +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
Nguyễn Hồng Quân 50e37aa849 OpenPGP: Correct the way to set output after generating key.
Correct the way to parse response data.
Updated wrong blob for pubkey info <~~ Fix.

OpenPGP: Store creation time after generating keys.

OpenPGP: Put_data: Handle the case that DO exists but its blob does not.
When checking DO before writing, relying on blobs only will miss the case that DO exists but its blob does not, when DO is non-readable.

OpenPGP: Set algorithm attributes before generating key.

OpenPGP: Add dependency of OpenSSL.

OpenPGP: Calculate and store fingerprint.
Calculate and store fingerprint after generating key.

OpenPGP: Update blob of pubkey info.
Update blob holding pubkey info after generating key.

OpenPGP: Add step to update card algorithms.
Update card algorithms after generating key. However, this step is not implemented yet, because of suspection about wrong data (see code comment).
2012-07-29 12:48:21 +02:00
Nguyễn Hồng Quân 8261490ec1 PKCS15-OpenPGP: Change the way emu_init return in error case. 2012-07-29 12:09:56 +02:00
Nguyễn Hồng Quân ed0e2be305 Add pkcs15init-binding for OpenPGP 2012-07-29 12:09:56 +02:00
Doug Engert 58a4821689 piv-tool -s not sending APDU - missing code
The code to send the APDU to the piv card when using
piv-tool -s xx:xx:xx... was inadvertently removed
on 2011-04-26 02:29:53 by: 1cdb3fa971
APDU parsing: switch to Frank Morgner's implementation

The missing code is replaced.

The -s option is infrequently used, so the problem
was not spotted earlier.
2012-07-29 11:29:14 +02:00
Kalev Lember 124d6e3a40 esteid: Do not set CKA_ALWAYS_AUTHENTICATE for the "Allkirjastamine" key
CKA_ALWAYS_AUTHENTICATE implies CKU_CONTEXT_SPECIFIC login, but all this
key really should need is a C_Login with CKU_USER.

The historical reason for having CKA_ALWAYS_AUTHENTICATE set was to keep
Firefox/NSS from using that particular key for SSL connections. However,
starting with Firefox 8, NSS ignores Non Repudiation certificates for
SSL and that makes the CKA_ALWAYS_AUTHENTICATE workaround unnecessary.

Now that Firefox is fixed, drop the workaround in OpenSC so that
applications that follow the pkcs11 spec wouldn't have to login twice to
access the key.
2012-07-22 20:02:24 +03:00
Nguyễn Hồng Quân 4e5ef8f1c9 PKCS15 - OpenPGP: Add more comments. 2012-07-07 19:00:36 +02:00
Nguyễn Hồng Quân 0b469ed31e OpenPGP: Add an explanation when building APDU. 2012-07-07 19:00:35 +02:00
Peter Marschall 4b9ca80434 tools docu: correct typo, improve style 2012-07-07 19:00:35 +02:00
Peter Marschall 8583197b6b opensc-explorer docs: various improvements
* document the UNBLOCK function
* format the examples better, and explain what they do
* extend the documentation for CD
2012-07-07 19:00:26 +02:00
Nguyễn Hồng Quân cf6b5e7903 pkcs15init: Add more debug log. 2012-07-07 18:42:36 +02:00
Frank Morgner 31bdbd6b6a use error code if no SM was applied 2012-07-05 10:12:34 +02:00
Diego Elio Pettenò 1d6fae2241 build: use autoconf's MKDIR_P not automake's (deprecated) mkdir_p. 2012-07-01 17:03:27 +02:00
Mathias Brossard e423bac474 Move case block so that fall-through works as intended 2012-06-28 16:59:40 +02:00
Mathias Brossard bfbef6fe2b Support key type inference for CKM_GOSTR3410_KEY_PAIR_GEN 2012-06-28 16:56:59 +02:00
Mathias Brossard 3fc4547e45 Add CKM_GOSTR3410_KEY_PAIR_GEN if card supports onboard generation 2012-06-26 10:48:49 +02:00
Viktor Tarasov 0914b1eca7 libopensc: SM: not all the APDUs need to be wrapped
For some cards some APDUs are always transmitted in a plain mode,
even if SM session is opened.
For these APDUs the 'get_sm_apdu' card's handler returns SUCCESS without wrapped APDU version.
In such cases 'transmit' is called for the plain APDU.
2012-06-19 18:04:37 +02:00
Viktor Tarasov 68e217ceee pkcs15: free NULL key is not error
when freeing key object, do not throw an error if supplied key pointer is NULL;

sc_pkcs15_free_prkey() procedure should not free the supplied key pointer,
the body of this procedure is replaced by body of sc_pkcs15_erase_prkey().
staitc sc_pkcs15_erase_prkey() is not more used.
2012-06-19 17:58:12 +02:00
Viktor Tarasov f9a13179d8 AuthentIC: when using SM decrease max-send-size value
update list of APDUs that always sent in plain (non SM wrapped) mode
2012-06-19 17:37:51 +02:00
Peter Marschall 34541e95c4 OpenPGP: add LOG_FUNC_CALLED() for "symmetric" logging 2012-06-17 10:49:00 +02:00
Nguyễn Hồng Quân 8db8f76bad OpenPGP: Change whitespace. 2012-06-16 15:43:51 +02:00
Nguyễn Hồng Quân ccb1067d75 OpenPGP: Correct the APDU preparation step for key generation. 2012-06-16 15:43:09 +02:00
Peter Marschall 0b0aae8bc8 openpgp-tool: remove unnecessary commas in man page 2012-06-16 15:35:04 +02:00
Peter Marschall db06b043ca PKCS15 - OpenPGP: re-factor certificate object init
restrict scope of some variables.
2012-06-15 14:56:46 +02:00
Nguyễn Hồng Quân 735883d8f6 PKCS15 - OpenPGP: Change way to check certificate object.
Old: If cert is missing, raise error.
New: If cert have data, declare object, otherwise, just ignore it.
2012-06-15 14:45:44 +02:00
Nguyễn Hồng Quân 5e295ba08d OpenPGP: Remove unused constants. 2012-06-15 14:40:14 +02:00
Viktor Tarasov c64a5f34d3 pkcs15init: application path selection in bind procedure
Application path can contain non-zero length path value and AID.
In this case select AID as DF_NAME only if length of path value is zero.

Segfault: dereferencing NULL pointer, thanks to Magosányi Árpád
2012-06-13 08:31:46 +02:00
Viktor Tarasov d3dbe444e1 pkcs15-init: coverity scan warning NEGATIVE-RETURNS
CID 402540: Argument cannot be negative (NEGATIVE_RETURNS)
2012-06-11 21:28:37 +02:00
Viktor Tarasov 61254f8651 muscle: coverity scan warning OVERRUN-STATIC
CID 402559: Out-of-bounds access (OVERRUN_STATIC)
CID 402558: Out-of-bounds access (OVERRUN_STATIC)
2012-06-11 21:18:51 +02:00
Viktor Tarasov ce23bba622 gemsafeV1: coverity scan warning OVERRUN-STATIC
CID 402560: Out-of-bounds read (OVERRUN_STATIC)
2012-06-11 21:08:21 +02:00
Viktor Tarasov aa46a210fc iasecc: coverity scan warning OVERRUN-STATIC
CID 402562: Out-of-bounds read (OVERRUN_STATIC)
2012-06-11 20:59:45 +02:00
Viktor Tarasov 12dcf13236 pkcs15-init: coverity scan warning RESOURCE-LEAK
CID 402619: Resource leak (RESOURCE_LEAK)
2012-06-11 20:10:42 +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
Viktor Tarasov 62eb0d05d7 jcop: coverity scan warning RETURN_LOCAL
CID 402623: Pointer to local outside scope (RETURN_LOCAL)
2012-06-11 19:59:36 +02:00
Viktor Tarasov 629c0e8df4 libopensc: resource leak coverity scan warning
Coverity warning CID: 203380: RESOURCE_LEAK;
use short call form of the debug messages;
code layout.
2012-06-11 19:45:26 +02:00