Commit Graph

5746 Commits

Author SHA1 Message Date
Frank Morgner c70ed34669 CTK: Added support for PIN pad 2017-11-17 10:04:46 +01:00
Frank Morgner ad6515ba55 CTX: detect card resets 2017-11-17 10:04:46 +01:00
Frank Morgner b4072af26e export sc_card_find_ec_alg 2017-11-17 10:04:46 +01:00
Frank Morgner 2494765cdc CTK: fixed initializing ATR and UID 2017-11-17 10:04:46 +01:00
Frank Morgner baa709ff74 print ASN.1 time and ASCII tranlation 2017-11-17 10:03:54 +01:00
Frank Morgner 8de544653c dump data with sc_debug_hex and sc_log_hex 2017-11-17 10:03:54 +01:00
Frank Morgner 9468ce7f89 beautify printed ASN.1 output
- fixed printing tags on multiple bytes
- align indenting with raw tags
- use OpenSSL's human readable OID database
- only print the canonical names for universal tags
2017-11-17 10:03:54 +01:00
Frank Morgner 4317df10e6 created opensc-asn1
fixes installation of egk-tool.exe on win32
2017-11-17 10:03:54 +01:00
Raul Metsma 2846295e1f EstEID ECDH token support (#1185) 2017-11-10 08:58:31 +01:00
Jakub Jelen 77f2640ea7 Avoid potential memory leak 2017-11-09 12:45:35 +01:00
Jakub Jelen 07267df313 Add the ACA path to the PIN structure if we have one 2017-11-09 12:45:35 +01:00
Jakub Jelen fd6882f686 Enable CAC ALT token card operations 2017-11-09 12:45:35 +01:00
Frank Morgner eacb53fc60 added boilerplate for disabling old card driver
currently disabled:
- miocos
- jcop
2017-11-09 12:43:06 +01:00
Frank Morgner 4d5b73d869 fixed accessing garbage value 2017-11-09 12:42:29 +01:00
Frank Morgner 260716f968 fixed memory leak 2017-11-09 12:42:29 +01:00
Frank Morgner 1d03000222 fixed dead assignment 2017-11-09 12:42:29 +01:00
Frank Morgner 9c025280a6 avoid integer underflow 2017-11-09 12:42:29 +01:00
Frank Morgner a332f72b38 honor return values of read and sscanf 2017-11-09 12:42:29 +01:00
Frank Morgner 17132b04c7 fixed possible bad memory access 2017-11-09 12:42:29 +01:00
Frank Morgner 3ca6c4b04a fixed possible NULL dereference 2017-11-09 12:42:29 +01:00
Frank Morgner 10101984da fixed dereferencing type-punned pointer 2017-11-09 12:42:29 +01:00
Frank Morgner 3693a96911 win32: don't link static libs into static libs 2017-11-09 12:42:29 +01:00
Frank Morgner d4befcc2e5 fixed unused dependency 2017-11-09 12:42:29 +01:00
Frank Morgner 854123c75e fixed binary comparison 2017-11-09 12:42:29 +01:00
Frank Morgner 4251a362b5 fixed potential memory leak 2017-11-09 12:42:29 +01:00
Frank Morgner 1b880b5675 fixed uninitialized buffer 2017-11-09 12:42:29 +01:00
Frank Morgner f4946df4e9 fixed dead assignments 2017-11-09 12:42:29 +01:00
Frank Morgner 251a5f9fef reader-pcsc: use sc_apdu2bytes for PIN APDU 2017-11-09 12:42:29 +01:00
Frank Morgner 04a7075290 fixed compiler warnings 2017-11-09 12:42:29 +01:00
Raul Metsma 189368e49f Fix crash when certificate read failed (#1189)
Fixes https://github.com/OpenSC/OpenSC/issues/1176
2017-11-08 13:24:18 +01:00
Frank Morgner 4dfa7aa40c cope with system's <strings.h>
fixes https://github.com/OpenSC/OpenSC/issues/1180
2017-10-30 20:57:05 +01:00
Raul Metsma be35d3d026 EstEID ECDSA token support (#1158) 2017-10-27 19:51:33 +02:00
Frank Morgner 5bd4716ea0 added missing include 2017-10-27 19:48:22 +02:00
Frank Morgner 594e125f06 Added PKCS#15 emulator for DIN 66291 profile 2017-10-27 19:48:22 +02:00
Frank Morgner bc075d6639 iso7816: don't show error for PIN status on 63C3 2017-10-27 19:48:22 +02:00
Frank Morgner b7b6680f38 starcos: 3.4 supports ISO based PIN status queries 2017-10-27 19:48:22 +02:00
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 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