Commit Graph

6671 Commits

Author SHA1 Message Date
Frank Morgner 3a299eb2bf 0.17.0 version bump 2017-06-13 13:23:53 +02:00
Frank Morgner 4c654606ea fixed Coverity issues
Fixes https://github.com/OpenSC/OpenSC/issues/1057
2017-06-13 13:07:52 +02:00
Frank Morgner e894bd175b Revert "pkcs11-tool: always authenticate when pinpad is in use"
This reverts commit 423375c6f8.

Fixes https://github.com/OpenSC/OpenSC/issues/1063
2017-06-13 13:06:46 +02:00
Timo Teräs 00a710b939 pkcs15-tool: add documentation for secret key options 2017-06-13 10:40:36 +02:00
Timo Teräs 137c6306d2 pkcs15init: use random id for secret key
Calculating intrinsic key would probably be not wise, because
it would leak out information about the secret key. Try to
generate globally unique IDs just by using a random one.
2017-06-13 10:40:36 +02:00
Timo Teräs 023216c755 add algorithm references for AES keys 2017-06-13 10:40:36 +02:00
Timo Teräs e23190d0b5 pkcs15-init: support secret key upload and generation 2017-06-13 10:40:36 +02:00
Timo Teräs 94973809c2 Support SKDF and secret key upload for MyEID cards 2017-06-13 10:40:36 +02:00
Timo Teräs 3d8cf274ff pkcs15init: add support for secret key upload and generation 2017-06-13 10:40:36 +02:00
Timo Teräs 576e70b70f pkcs15: allow struct sc_pkcs15_prkey to contain secret key
This allows using the existing store_key abstraction to upload
secret keys too.
2017-06-13 10:40:36 +02:00
Timo Teräs 7e99cf7411 pkcs15-init: include secret keys in generic object handling code
Type user visible type string is 'secrkey' in harmony with pkcs11-tool.
2017-06-13 10:40:36 +02:00
Timo Teräs e2e1cbd10f pkcs15init: prepare sc_pkcs15init_skeyargs for proper secret key support 2017-06-13 10:40:36 +02:00
Timo Teräs 8f53133ae3 pkcs15-tool: fix secret key dumping 2017-06-13 10:40:36 +02:00
Timo Teräs 2632b616d9 Imporve SKDF decoding and implement encoding
- fixes decoding of SecretKeyAttributes
- adds support for algorithmReferences
- adds support for algIndependentKeys (PKCS#15 Generic keys)
- implements encoding of SKDF
2017-06-13 10:40:36 +02:00
Timo Teräs becd243fd6 add AES algorithm ID 2017-06-13 10:40:36 +02:00
Timo Teräs fe88222ffe pkcs15init: handle secret key in generic helper functions 2017-06-13 10:40:36 +02:00
Timo Teräs 048e703ab7 pkcs15init: generalize key compatibility checking helpers 2017-06-13 10:40:36 +02:00
Timo Teräs 0576ccce0c Add _sc_card_add_generic for registering secret key algorithms 2017-06-13 10:40:36 +02:00
Frank Morgner 35c5eb0659 fixed ressource leak 2017-06-09 10:33:46 +02:00
Frank Morgner 32aa51a0f6 avoid logically dead code 2017-06-09 10:33:46 +02:00
Frank Morgner 888215ca7c prevent integer overflow 2017-06-09 10:33:46 +02:00
Frank Morgner 7e5afad630 fixed bad memory access 2017-06-09 10:33:46 +02:00
konstantinpersidskiy 083cec8fda pkcs11-tool: add GOSTR3410 keypair generation (#997)
* pkcs11-tool: add GOSTR3410 keypair generation
* Refactor gost3410 generation
2017-06-09 10:30:40 +02:00
Frank Morgner 3e5fc896b7 sc-hsm: fixed using GoID with unknown ATR 2017-06-06 00:59:20 +02:00
Frank Morgner 3131282760 sc-hsm: add GoID ATRs
disables forcing sc-hsm for standard JCOP ATRs, see
b7de5888a0 (commitcomment-22258928)
2017-06-06 00:59:20 +02:00
Frank Morgner fb8fccd7ba AppVeyor: cache openpace build 2017-06-05 00:09:33 +02:00
Frank Morgner ad451bd201 AppVeyor: cache zlib build 2017-06-05 00:09:33 +02:00
Frank Morgner 74d5eee573 AppVeyor: Updated OpenSSL version 2017-06-05 00:09:33 +02:00
Frank Morgner 2536365d79 removed BUILD_ON/BUILD_FOR variable
- guess the system architecture based on %PROCESSOR_ARCHITECTURE%
- guess the target system based on %PLATFORM%
2017-06-05 00:09:33 +02:00
Frank Morgner eb19691efe added compatibility with WiX 3.11 2017-06-05 00:09:33 +02:00
Jakuje 0e70c59aef If the underlying PKCS#15 structure does not provide label for a cert… (#1045) 2017-05-30 00:05:30 +02:00
Frank Morgner b7de5888a0 sc-hsm: fixed forcing a card driver via opensc.conf
- don't use private data on card matching
- instead, return 1 for every known ATR and only select the applet if the ATR is unknown.
- card initialization always selects the applet.

Advantage: decouples memeory management in matching from initializing the card.
Disadvantage: Applet is selected twice in case of an unknown ATR (once for matching and a second time for initializing the card).

Fixes https://github.com/OpenSC/OpenSC/issues/1042
2017-05-22 16:25:08 +02:00
Frank Morgner a0e868974d pkcs15-tool: added test for session PIN 2017-05-22 16:25:08 +02:00
Frank Morgner 7c3bb44cdf minidriver: added support for session pin 2017-05-22 16:25:08 +02:00
Frank Morgner 74ec7b04ff sc-hsm: Add support for SoC
- eac: allow CA without EF.CardSecurity
- sc-hsm: implemented CA based on document PKI
- sc-hsm: adds receive limit for SoC card
- introduces dedicated card type for SoC card
- md: integrate card's PIN pad capabilities
- installer: added SC-HSM SoC card to registry
- pkcs15-tool: Added support for PIN entry on card
- change/unblock PIN: add support for PIN entry on card
- added OpenPACE to macOS build
- travis-ci: install gengetopt/help2man via brew
- sc-hsm: Cache EF.C_DevAut
- sc-hsm: Prevent unnecessary applet selection and state resets
- sc-hsm: added support for session pin
- sc-hsm: avoid multiple AID selection
- sc-hsm: Use the information from match_card for all subsequent selections of the applet
- sc-hsm: cache optional files as empty files (Decoding the files will reveal that they were not existing prior caching. This avoids selecting the file though we have already tried to cache the file before.)
- use dedicated directory for CVC trust anchors
- appveyor: added OpenPACE to windows build
2017-05-22 16:25:08 +02:00
Frank Morgner 77f6e94e6f fixed import of multiple symbols
regression of 45a7ea9737075b5901fe7a5d65ed898733140315:
due to the change in the linkage, the symbols should be found in
opensc.dll instead of the static support libraries.
2017-05-22 16:25:08 +02:00
Doug Engert 0ec89941b2 gids-tool loops when using OpenSSL-1.1
Add code to support OpenSSL initialization as needed for OpenSSL-1.1
2017-05-22 13:38:34 +02:00
Doug Engert c7ed71c76f piv-tool loops when using OpenSSL-1.1
Add code to support OpenSSL initialization correctly when using OpenSSL-1.1

Tested with OpenSSL-1.1.0c and OpenSSL-1.1.0e.

 Changes to be committed:
	modified:   src/tools/piv-tool.c
2017-05-22 13:38:34 +02:00
Frank Morgner 7cff9c2810 Force T=1 for contactless cards
Communication defined by ISO/IEC 14443 is identical to T=1, so make
sure we connect in the right mode to the card so that the constructed
APDUs can be handled by the card.
2017-05-19 14:57:56 +02:00
Frank Morgner e23960f793 Fixed ssh's pkcs11 usage on macOS
copy (instead of link) our pkcs11 libraries to the default location, which is whitelisted for ssh usage

fixes https://github.com/OpenSC/OpenSC/issues/1008
2017-05-13 23:41:12 +02:00
rickyepoderi d9d247e6cd Disable the secure channel at logout (#1048)
Fixes https://github.com/OpenSC/OpenSC/issues/1036
2017-05-13 16:15:08 +02:00
Jakub Jelen 427c175c08 Do not use the hardcoded magic numbers in PIV 2017-05-02 22:27:43 +02:00
Jakub Jelen 20e3836c9e Restore the functionality of CAC usage flags deriving from X509 certificates 2017-05-02 22:27:43 +02:00
Doug Engert 35bae65f11 Make sure it is an SPKI
On branch verify-pubkey-as-spki-2
 Changes to be committed:
	modified:   framework-pkcs15.c
2017-04-26 13:08:49 +02:00
Doug Engert 4049283675 Add new attribute CKA_SPKI for CKO_PUBLIC_KEY
CKA_SPKI is a vendor defined attribute to be used internally
as input to to OpenSSL d2i_PUBKEY

 On branch verify-pubkey-as-spki-2
 Changes to be committed:
	modified:   framework-pkcs15.c
	modified:   mechanism.c
	modified:   openssl.c
	modified:   pkcs11-opensc.h
2017-04-26 13:08:49 +02:00
Doug Engert d48f438581 PKCS#11 does not define a CKA_VALUE for public keys and is missused
OpenSC opennssl.c in sc_pkcs11_verify_data assumes that it can
retieve the CKA_VALUE for a public key object, and expect it to
be usable as RSA.

But internally sc_pkcs15_pubkey can have a "raw" or "spki"
version of the public key as defined by PKCS#15.  Card drivers
or pkcs15-<card> routines may store either the "raw" or "spki"
versions. A get attribute request for CKA_VALUE for a public key
will return either the raw, spki or will derived rsa verison of the
pubkey.

This commit will test if the CKA_VALUE is a spki and use d2i_PUBKEY
which takes a spki version and returns an EVP_KEY. If it not an spki
the current method, d21_PublicKey(EVP_PKEY_RSA,...) is used which
only works for RSA.

The problem was found while testing pkcs11-tool -t -l  where
the  verify tests would fail with a CKR_GENERAL_ERROR because
the card driver stored the public key as a spki.

On branch verify-pubkey-as-spki-2
 Changes to be committed:
	modified:   src/pkcs11/openssl.c

Date:      Fri Apr 07 07:50:00 2017 -0600
2017-04-26 13:08:49 +02:00
Timo Teräs f5aa3f5cc6 build fix for libressl 2.5.3
X509_up_ref is implemented in libressl 2.5.3
2017-04-26 10:59:47 +02:00
Timo Teräs 2114dea687 pkcs15: fix commit 76d59158 auth object regressions
Few conversions of SC_PKCS15_TYPE_AUTH_PIN to SC_PKCS15_TYPE_AUTH
were missed.
2017-04-24 13:14:46 +02:00
Mouse 0cb91fd68c Fix bug in pkcs11-tool.c that prevented it from displaying CKA_DERIVE key usage for EC public keys 2017-04-22 17:12:26 +02:00
Mouse 13f61eee7b Fix CAC-introduced bug that broke access to certificates (@dengert found it) (#1032)
Regression from 777e2a3751
2017-04-22 17:05:08 +02:00