Commit Graph

6819 Commits

Author SHA1 Message Date
Frank Morgner e54684b9db fixed documentation of GLP encoded PIN 2017-10-27 19:48:22 +02:00
Frank Morgner 4f189a5174 check for digits in case of BCD encoded PIN 2017-10-27 19:48:22 +02:00
Frank Morgner 60e8db4c22 Added tool for German eGK
Fixes missing opensc-notify.1
2017-10-27 19:48:22 +02:00
Frank Morgner 0502a839c6 unified reading of EF.GDO 2017-10-27 19:48:22 +02:00
Frank Morgner 293d02ea4b removed unused test
test is performed by sc_asn1_read_tag
2017-10-27 19:48:22 +02:00
Frank Morgner 5918e005d7 starcos: added serial number for 3.4 2017-10-27 19:48:22 +02:00
Mouse e4c589639d Add support in pkcs11-tool and pkcs11-spy for RSA-OAEP (#1169)
* Add RSA-OAEP documentation
* Add definitions and structures needed for RSA-OAEP
* Add ability to display RSA-OAEP parameters to SPY

Closes https://github.com/OpenSC/OpenSC/issues/1170
2017-10-19 22:12:47 +02:00
Frank Morgner 391b32c378 Merge pull request #1126 from frankmorgner/winui
UI improvements: Customizable Notifications and PIN-Pad Dialog
2017-10-17 10:42:55 +02:00
Frank Morgner 6a4e120b44 md: added default text for role: user+sign 2017-10-17 09:38:19 +02:00
Frank Morgner 498aedd165 Merge remote-tracking branch 'upstream/master' into winui 2017-10-16 15:16:34 +02:00
Feitian Technologies 8d7346406d Add ECC support and solve wrong Length status codes with SM card
Fix #1073
Fix #1115
2017-10-16 14:57:52 +02:00
Maciej S. Szmigiero 0cb654ca78 sc-hsm: fix unused variable warnings in sc_hsm_init()
When building without OpenPACE there are two unused variables in
sc_hsm_init() that cause compiler to emit warnings about them.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2017-10-16 14:56:01 +02:00
Maciej S. Szmigiero 294c232ca9 Minidriver card reinitialization cleanup
In minidriver before performing a card operation we currently check whether
the supplied card handles have changed.
If they did the card in reader might have been changed so we reinitialize
it.

However, in few places in reinitialization call path an error returned by
some operation would leave the context in an inconsistent state.

So let's walk through this path to make sure that functions there will exit
cleanly if an error happens.

Also, make sure that all card operations that actually do something have
the necessary check call in the first place and also that they all
consistently check whether VENDOR_SPECIFIC pointer is not NULL before
dereferencing it.

This is a cleanup part of "Keep track of card resets by other contexts in
minidriver" (that is, it does not include the actual reset handling code
introduced by that commit), simplified.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2017-10-16 14:56:01 +02:00
Maciej S. Szmigiero bd9cdd243d Add multiple PINs support to minidriver
Many cards need multiple PINs to work correctly since different on-card
keys are secured by different PINs (this is true for for example OpenPGP
card).

Smart Card Minidriver API has supported such cards since version 6.02
(Vista+).

Use the same method as PKCS#11 driver does to discover user and sign PINs,
for consistency.
However, if there is a default container on card we'll make sure that its
PIN is an user PIN and if there is no default container we'll mark the one
with the user PIN as default.

All other PINs securing containers on card are added as next PINs, up to
MD_MAX_PINS.

Use this opportunity to also fix two cases where a pointer-to-DWORD
variable was passed as pointer-to-size_t parameter to
md_dialog_perform_pin_operation() - they are of different size on Win64.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2017-10-16 14:56:01 +02:00
Doug Engert a8126ad696 Make OpenSC PKCS#11 Vendor Defined attributes, mechanisms etc unique
This will help when p11-kit is usead and wil allow for additional
CK*_* things to be defined that have a much better chance of being
unique.

OR in "OSC" to any CK*_VENDOR_DEFINED thing.
with #define SC_VENDOR_DEFINED 0x4F534300  /* OSC */

This follows Netscapes convention of doing the same but
using: #define NSSCK_VENDOR_NSS 0x4E534350 /* NSCP */

The current 2 defines  CKA_* are for internal attributes.

 On branch OSC_VENDOR_DEFINED
 Changes to be committed:
	modified:   pkcs11-opensc.h
2017-10-16 09:26:16 +02:00
Frank Morgner 4923947b0a md: added CNS ATR (#1166)
fixes https://github.com/OpenSC/OpenSC/issues/1153
2017-10-16 09:25:34 +02:00
Frank Morgner dfd1838934 fixed building without SM
fixes https://github.com/OpenSC/OpenSC/issues/1155
2017-09-24 22:14:19 +02:00
Jakub Jelen bdb1961dee Enable RSA-PSS signatures in pkcs11-tool (#1146)
* Add missing SHA224 RSA algorithms

* Fix wrong replacement in pkcs11-tool manual page

* Add MGF and PSS_PARAMS definitions in PKCS#11 header file

* Inspect PSS signature parameters in pkcs11-spy

* Enable RSA-PSS signatures in pkcs11-tool

* Added short names to RSA-PSS methods

* Reintroduce portable NORETURN indication for functions and use it to avoid compilers complaining
2017-09-21 11:19:22 +02:00
vletoux 8965ee38dd Gids verified mutual auth 2017-09-17 23:10:28 +02:00
Jakub Jelen 41b55b93d4 Print well formated report from decryption stage and do not fail with OAEP mechanisms 2017-09-17 23:08:20 +02:00
Jakub Jelen 0a8213f3d4 Do not overwrite digestinfo + hash for RSA-PKCS Signature 2017-09-17 23:08:20 +02:00
Pavel Cherezov ecb1656b91 sensitive flag added to generate key with CKA_SENSITIVE flag.
pull request issues fix: replace spaces with tabs and fix description of the argument.
2017-09-15 00:11:49 +02:00
Pavel Cherezov 2cf0a119f4 sensitive flag added to generate key with CKA_SENSITIVE flag 2017-09-15 00:11:49 +02:00
Nathaniel Wesley Filardo 00535f0174 sc_pkcs15_get_bitstring_extension: int, not long long
Use the ASN.1 decoder's SC_ASN1_BIT_FIELD decoder to properly decode
into a machine word.  As _bitstring_extension is used only for the OID
2.5.29.15 by all callers, which is at most 9 bits wide, this is a
reasonable thing to do.
2017-09-12 23:05:27 +02:00
vletoux ab8a51a1ab Fix wrong padding for GIDS admin authentication 2017-09-11 00:25:08 +02:00
Nathaniel Wesley Filardo 5882df745a Use |, not ||, when decoding CAC key_reference
This quiets two compiler warnings and is almost surely what was actually
meant.  However, I do not have a CAC card to test.
2017-09-04 10:58:31 +02:00
Jakub Jelen 789dd16320 List human-readable version in the cardos-tool 2017-09-02 00:19:35 +02:00
Jakub Jelen eeeefecf12 Add newly reported ATR for CardOS 5.3 2017-09-02 00:19:35 +02:00
Jakub Jelen 60dbebf511 Parse the ECC parameters from TokenInfo (CHOICE in AlgorithmInfo)
Fixes #1134
2017-09-02 00:19:35 +02:00
Jakub Jelen eee4964d7f The cardos driver supports also CardOS 5
CardOS M4 is confusing since it refers to the old card versions
2017-09-02 00:19:35 +02:00
Jakub Jelen 804f47b298 Do not add non-informative PIN to the token label 2017-09-02 00:17:15 +02:00
Jakub Jelen d018855b9f Get cardholder name from the first certificate 2017-09-02 00:17:15 +02:00
Jakub Jelen 56c8f59b25 Use shorter PIN name for default PIN to accomodate Card Holder name in future 2017-09-02 00:17:15 +02:00
Mouse f0e703be49 Fix bug in pkcs11-tool (did not ASN.1-encode ECDSA-SHA-2 signature) 2017-08-29 12:05:16 +02:00
Mouse 1efc73fa2f Fix typo in ECDSA-SHA384 for pkcs11-tool 2017-08-28 21:17:03 +02:00
Frank Morgner 555671b54d sc_read_binary may return less bytes than requested
Note, that there are a number of card drivers that still use
`sc_read_binary` in the wrong way. Unfortunately, I don't have the time
to go through all of them.

Fixes https://github.com/OpenSC/OpenSC/issues/1112
2017-08-27 21:21:00 +02:00
Frank Morgner 172f320c9a win32: Dedicated md/pkcs11 installation folders
Don't install non-permanent files (md/pkcs11) to system folder anymore.
2017-08-22 23:41:29 +02:00
Arnaud Fontaine 2765b7b1a0 Support for new MinInt agent card (#1092)
* Support for new MinInt agent card

This card uses the same ATR as the existing card, but the applet installed
does not have the same AID. This card actually works exactly as the
IASECC_SAGEM.

Unify iasecc_init for AMOS/SAGEM and MI cards
2017-08-22 01:13:18 +02:00
Jakub Jelen 41796ff0ed [pkcs11-tool] Add SHA2 HMAC mechanisms 2017-08-17 12:02:28 +03:00
Jakub Jelen d5647fe53d [pkcs11-tool] Properly define RSA-PSS mechanisms 2017-08-17 12:02:28 +03:00
Frank Morgner a1466f7395 sc-hsm: better error messages for optional files 2017-08-11 23:07:25 +02:00
Frank Morgner a007ab7820 sc-hsm: New PIN commands for GoID 1.0 2017-08-11 23:07:25 +02:00
Jakub Jelen e0eb5bf888 Do not call list_init() twice (amend 6bfb39454) 2017-08-11 23:06:21 +02:00
Jakub Jelen 0dcf673296 CAC issues (#1120)
* cac: Make the retransmitted APDU valid by restoring the resplen

* cac: Check SWs for all the APDUs and report the errors to underlying layers

* cac: Fallback from CACv1 to CACv2 when CACv1 instruction is not recognized

for the lack of other pointers how to recongnize them

* avoid goto
2017-08-04 08:48:24 +02:00
Frank Morgner 9b772ebdc4 win32: switch back to OpenSSL 1.0.2 as default
AppVeyor changed the default version back to 1.0.2, see
https://github.com/appveyor/ci/issues/1671
2017-08-04 08:44:41 +02:00
Frank Morgner 7bc070ac67 win32: Load notification icons from Windows DLLs
fixes showing wrong icons when loaded as PKCS#11 module
2017-08-03 00:19:26 +02:00
Frank Morgner 956ad33e31 travis: fixed disabling of notifications for mingw 2017-08-03 00:16:58 +02:00
Frank Morgner dcf9d23009 opensc-notify: fixed heavy load on OS X if no reader
Also, if too many errors are supported, opensc-notify will abort
2017-08-02 19:07:23 +02:00
Frank Morgner 496e2afc9e reader-pcsc: allow no attached reader for notification
Return an error only on OS X, where PnP notification is not supported.
2017-08-02 19:07:16 +02:00
Frank Morgner b0a85a1497 opensc-conf: Added notification text for GoID 2017-08-02 19:07:01 +02:00