Jakub Jelen
f52f6bb310
[p15dump] Error message with a reason for missing unusedSpace file
2016-06-06 21:36:09 +02:00
Nuno Goncalves
d97ee79333
fix #788 pkcs15-tool --read-ssh-key crash
...
Don't try to free again pubkey if the parent cert has already been freed.
Signed-off-by: Nuno Goncalves <nunojpg@gmail.com>
2016-06-06 18:29:03 +01:00
Javier Serrano Polo
eee4d74721
Fixed interaction with DNIe UI
2016-06-06 01:56:51 +02:00
Frank Morgner
9066d8f999
simplyfied netkey-tool
...
fixes conversion from 'long' to 'u8', possible loss of data
2016-06-05 02:28:50 +02:00
Frank Morgner
b9cefa6825
removed unused variable
2016-06-05 02:28:50 +02:00
Jakub Jelen
587a29b7f5
Truncate data for ECDSA signature to the size of the key
...
Based on the paragraph from PKCS#11 MECHANISMS V2.30: 6.3.1 EC Signatures:
If the length of the hash value is larger than the bit length of n, only
the leftmost bits of the hash up to the length of n will be used. Any
truncation is done by the token.
This is affecting NIST PIV Test cards with non-hashed mechanisms.
2016-06-04 09:53:00 +02:00
Frank Morgner
192c3f6182
Merge pull request #694 from germanblanco/dnie_memory_leaks_and_sm_wrapping
...
DNIe. Removing all memory leaks and using SM wrapping and unwrapping.
2016-06-04 01:58:22 +02:00
Frank Morgner
04825d8d7e
avoid using an uninitialized buffer
2016-06-04 01:22:28 +02:00
Viktor Tarasov
7eeba1fba8
Merge branch 'towards-opensc-0.16.0'
...
version.m4 updated for official release 0.16.0
coverity scan switched to 'master'
2016-06-03 11:19:51 +02:00
Viktor Tarasov
b8dcf91515
pkcs11-tool: print in hex the code of unknown mechanism
2016-06-03 11:12:03 +02:00
Mouse
2ba87640d2
Fixed bug in derive_key(), where correct execution depended on undefined compiler behavior
2016-05-31 01:59:40 +02:00
Frank Morgner
59152e1acf
Merge pull request #766 from frankmorgner/towards-opensc-0.16.0
...
Fixed memory problems
2016-05-31 01:50:21 +02:00
Frank Morgner
46efb02fec
fixed memory leak of reader's vendor name
2016-05-26 14:39:41 +02:00
Frank Morgner
fcf9b9e706
fixed missing initialisation and bad memory access
2016-05-26 13:46:57 +02:00
Viktor Tarasov
1da49757cb
fix NEWS, few debug messages more
2016-05-26 10:59:58 +02:00
Jakub Jelen
e309d0f06f
[p15dump] Do not attempt to access NULL pointer
2016-05-23 11:41:48 +02:00
Jakub Jelen
462bebd380
Unbreak tests without arguments (automatic selection of the reader)
2016-05-23 11:41:48 +02:00
Viktor Tarasov
0e1c8f9c04
libopensc: avoid call to memset() with zero length
...
@mouse07410 has asked for it in
https://github.com/OpenSC/OpenSC/issues/688#issuecomment-219433611
VTA: I do not see the difference (if the other arguments are properly used),
but assume that @mouse07410 has it's own valid reasons
Also included the few coding style touches.
2016-05-23 11:41:48 +02:00
Henrik Andersson
74493ca73f
Add support for RSA with keylength 2048
...
This solves sign issues with swedish eID cards which have
RSA keys with length 2048. This also solves the issue #726 .
2016-05-16 11:12:53 +02:00
Jakub Jelen
ae47e06d57
Typos
2016-05-16 10:58:22 +02:00
Frank Morgner
343c0f8d57
pkcs15-starcert.c: Use two hex digits with sc_pkcs15_format_id
2016-05-12 09:58:28 +02:00
Frank Morgner
b568bbc256
pkcs15-pteid.c: Use two hex digits with sc_pkcs15_format_id
2016-05-12 09:58:28 +02:00
Frank Morgner
03b4740b2e
pkcs15-infocamere.c: Use two hex digits with sc_pkcs15_format_id
2016-05-12 09:58:28 +02:00
Frank Morgner
3f0de6e638
pkcs15-gemsafeGPK.c: Use two hex digits with sc_pkcs15_format_id
2016-05-12 09:58:28 +02:00
Frank Morgner
a2e05e8869
pkcs15-atrust-acos.c: Use two hex digits with sc_pkcs15_format_id
2016-05-12 09:58:28 +02:00
Doug Engert
e46bfea8b9
Use two hex digits with sc_pkcs15_format_id
...
Avoid having problems with sc_hex_to_bin when called from sc_pkcs15_format_id
both for id and auth_id numbers
Changes to be committed:
modified: pkcs15-piv.c
2016-05-12 09:58:28 +02:00
Viktor Tarasov
ca2c1c56c8
libopensc: sc_hex_to_bin() accepts hex string with length 1
...
fix issue #751
2016-05-12 09:58:28 +02:00
Viktor Tarasov
e9786bfb34
oberthur: use short form of debug message calls
2016-04-28 11:16:03 +02:00
Viktor Tarasov
fc76e4ee6d
oberthur: fix max recv size when reading component
2016-04-28 11:15:27 +02:00
Viktor Tarasov
91a28c613c
libopensc: few debug messages more
2016-04-28 10:51:49 +02:00
Viktor Tarasov
6d4a4dfae0
oberthur: set to '0' memory of temp path
2016-04-27 20:09:29 +02:00
Viktor Tarasov
00b8416ba3
oberthur: allow read of info files without authentication
2016-04-27 20:08:45 +02:00
Viktor Tarasov
a4dfb7b07a
tools: fix help message
2016-04-27 20:07:54 +02:00
Viktor Tarasov
5be51ea3e2
pkcs15init: authentIC: init card/pin not supported
2016-04-27 15:48:18 +02:00
Andreas Schwier
c63ba858e3
Detect premature end hexstring
2016-04-26 18:29:51 +02:00
Viktor Tarasov
163fc42ee6
readers: coding style for log messages
2016-04-26 18:26:46 +02:00
Viktor Tarasov
e95b515163
reader: by default only short APDU supported
...
default values of reader's max send/receive sizes correspond to only short APDU supported;
these values can be overwritten by reader itself with the proper value of dwMaxAPDUDataSize from TLV properties,
or with the corresponding options in OpenSC configuration.
resolves issue #735
2016-04-26 18:26:43 +02:00
Andreas Schwier
41f34fdbcf
sc-hsm: Fix public key usage for keys extracted from CVC
2016-04-17 13:06:46 +02:00
velter
73b5d8421a
Fix for #720
...
This is a cleaner fix for #720 which take part of #721 and #730
A driver private struct is used which allow to remove all globals which might changed base on the token in use.
2016-04-17 13:05:35 +02:00
Thomas König
a3e7ebec42
Proposed fix for #723
2016-04-17 13:00:37 +02:00
Viktor Tarasov
09cbcd80f4
md: use register to enable debug log
2016-04-17 12:43:27 +02:00
Viktor Tarasov
66515989d8
win32: method to get config option from registers
2016-04-17 12:43:18 +02:00
Raul Metsma
22f9ad704a
Move PIN type label front of description
...
With very long labels it is unable identify which PIN Firefox is asking.
PKCS11 label is 32 char's and it gets truncated.
Current format "LABEL (PIN1)"
New format "PIN1: LABEL"
2016-04-13 13:57:32 +03:00
Viktor Tarasov
89a5b5893b
md: use GUID without frame
2016-04-08 11:02:53 +02:00
Viktor Tarasov
5c0a37c53d
pkcs15init: use aux-data to set MD container GUID
2016-04-08 11:02:53 +02:00
Viktor Tarasov
5bbc86eb39
md: replace card specific with pkcs15 'aux-data' facilities
2016-04-08 11:02:53 +02:00
Viktor Tarasov
9abf8ee04c
pkcs15 iasecc: parse-df handler to set MD guid
2016-04-08 10:48:58 +02:00
Viktor Tarasov
9ac4120594
pkcs15: 'aid' argument for emulator init
...
Allows to PKCS#15 emulator to bind more then one application
2016-04-08 10:48:58 +02:00
Viktor Tarasov
47eb21175c
p15: auxiliary data in prkey info data type
2016-04-08 10:48:58 +02:00
Viktor Tarasov
77898e6175
gids: fix invalid get-gids-driver
...
When compiled without zlib 'get-gids-driver' returns invalid pointer.
2016-04-08 10:48:58 +02:00
Viktor Tarasov
6de3f93e9b
gids: fix invalid get-gids-driver
...
When compiled without zlib 'get-gids-driver' returns invalid pointer.
2016-04-07 19:43:56 +02:00
Viktor Tarasov
07493c11d8
iasecc: select parent before fixing ACLs of a new file
...
With MD, after card rebinding, the context to fix ACLs for a
new certificate file can be changed.
2016-04-01 18:09:04 +02:00
Viktor Tarasov
56f2319fcc
pkcs11-tool: few named curves more
2016-04-01 18:08:00 +02:00
Hannu Honkanen
fe2312dd19
myeid: fixed a bug in setting card->name
...
Fixed a bug in setting card->name in myeid_init and myeid_get_info:
The buffer containing the card name fell out of scope.
2016-03-31 13:33:28 +02:00
Viktor Tarasov
7f732d49b6
pkcs15: log parsed TokenInfo.serial
2016-03-31 13:24:17 +02:00
Viktor Tarasov
4b51d70969
tools: print OpenSC package version
2016-03-28 20:41:19 +02:00
Viktor Tarasov
696e4119a5
pkcs15-crypt: allow decipher for key with 'unwrap' usage
2016-03-28 19:59:28 +02:00
Doug Engert
81e91c70f3
Handle C and C++ "inline" and "restrict" keywords for various compilers
...
simclist.h is changed to either accept a predefined inline and/or
predefined restrict macro or tests for known compilers and sets
simclist_inline and simclist_restrict with the approprate keyword
for the compiler being used or defines them as blank.
The logic used is based on code in OpenSSL-1.1 e_os2.h
For example, "configure" could define inline and/or restrict.
But OpenSC is built on other platforms without a config.h and thus
changes to simclist.h are still needed.
simclist.c is changed by replacing inline with simclist_inline
and restrict with simclist_restrict.
The one and only use of inline in card-dnie.c is removed as there
is no need to have the function inline. This avoids any inline issues.
If inline is needed in other OpenSC code or in card-dnie.c,
simclist_inline could be used.
(Another option is to just remove all inline and restrict keywords
from OpenSC code.)
Changes to be committed:
modified: src/common/simclist.c
modified: src/common/simclist.h
modified: src/libopensc/card-dnie.c
2016-03-22 15:51:36 +01:00
Viktor Tarasov
6f667e0510
pkcs15: fix warning Wsign-compare
2016-03-21 07:55:02 +01:00
Viktor Tarasov
8b9ce2cf4a
coverity: INTEGER_OVERFLOW
2016-03-17 11:30:40 +01:00
Viktor Tarasov
bd84e18f45
coverity-scan: supplement to #710
2016-03-15 19:10:52 +01:00
Viktor Tarasov
1329597e33
pkcs15: use file cache for path with AID
...
also try to resolve TOCTOU coverity-scan issue
Fix #709
2016-03-15 18:11:03 +01:00
Viktor Tarasov
220d80fcec
pkcs15: fix length of 'last-update' read
2016-03-15 17:42:09 +01:00
Viktor Tarasov
260b7711b9
coverity-scan: OVERRUN in ctbs.c
...
Fix #710
2016-03-15 17:40:15 +01:00
Viktor Tarasov
9a22f146f8
pkcs15: fix argument for 'read-tag' call
2016-03-10 11:39:59 +01:00
Viktor Tarasov
205acbd573
coverify-scan: muscle: use return value
2016-03-10 11:23:39 +01:00
viktorTarasov
a5550f980b
Merge pull request #706 from frankmorgner/npa-generic
...
generic changes from #611
2016-03-10 11:04:12 +01:00
Viktor Tarasov
1fb741338a
pkcs11: remove hot-plug-anb-play
...
updated version of PR #687
Discussion and motivation in PR #687 and PR #704
Fix #687
Fix #704
2016-03-10 10:43:18 +01:00
Viktor Tarasov
0838520b62
rtecp: fix delete private key
...
when deleting private key, delete also it's internal public part
Fix #671
Fix #705
2016-03-10 10:33:42 +01:00
Viktor Tarasov
f98c8cd37c
asn1: tagnum size has not exceed 3 bytes
...
3 bytes is the size of SC_ASN1_TAG_MASK used when composing
the asn1 templates with 'struct sc_asn1_entry'.
With this limitation maximal supported ASN.1 tag number is 2^^14-1 .
Fixed 'dead-code' coverity-scan issue.
Close #707
2016-03-10 10:13:27 +01:00
Viktor Tarasov
196e476330
coverity: check returned value
2016-03-07 18:30:56 +01:00
Frank Morgner
5403899444
use SCardGetAttrib to initialize reader's metadata
2016-03-07 10:39:42 +01:00
Frank Morgner
415f15e3e2
use autoconf metadata for PKCS#11 library
2016-03-07 10:39:42 +01:00
Frank Morgner
c3527f4a5b
fixed dylib extensions
2016-03-07 10:39:42 +01:00
Frank Morgner
ef40021417
use sc_debug_hex for hexdump
2016-03-07 10:39:42 +01:00
Viktor Tarasov
2173450664
log: print file-id in 'create-file'
2016-03-06 19:28:59 +01:00
Frank Morgner
9985144d45
Merge pull request #702 from viktorTarasov/fix/issue700/invalid-parameter
...
pkcs11-tool: fix invalid parameter for 'find-mechanism'
2016-03-05 21:37:31 +01:00
Frank Morgner
34a69aeac8
Merge pull request #701 from CardContact/fix698
...
sc-hsm: Remove path for newly generated key pairs
2016-03-04 17:23:00 +01:00
Hannu Honkanen
91aad373be
Added a new ATR that will be used in some new MyEID cards
...
Closes https://github.com/OpenSC/OpenSC/pull/696
2016-03-04 17:20:37 +01:00
Hannu Honkanen
cf04d01676
Removed define MYEID_ECC_SUPPORT as unnecessary.
...
ECC support is determined by checking MyEID applet version.
2016-03-04 17:20:29 +01:00
Hannu Honkanen
2de41f4a6d
Added support for 521 bit ECC keys
...
Includes ECC related bux fixes.
2016-03-04 17:20:20 +01:00
Frank Morgner
1c0ab2a2d2
Merge pull request #697 from viktorTarasov/feature/package-revision
...
tools: print package revision
2016-03-04 17:14:26 +01:00
Viktor Tarasov
36b945aa22
tools: print package revision
2016-03-04 14:16:06 +01:00
Viktor Tarasov
998a1e10c5
pkcs11-tool: fix invalid parameter for 'find-mechanism'
...
Fixes #700
2016-03-04 11:30:51 +01:00
Ludovic Rousseau
ae67f16e9b
card-iasecc.c: fix 1 compiler warning
...
card-iasecc.c:3206:3: error: variable 'rv' is used uninitialized whenever 'if'
condition is false [-Werror,-Wsometimes-uninitialized]
...LOG_TEST_RET(ctx, SC_ERROR_INVALID_ARGUMENTS, "Need RSA_HASH_SHA1 or RSA_HASH_SHA256 algorithm");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/libopensc/log.h:90:36: note: expanded from macro 'LOG_TEST_RET'
...r, text) SC_TEST_RET((ctx), SC_LOG_DEBUG_NORMAL, (r), (text))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/libopensc/log.h:84:6: note: expanded from macro 'SC_TEST_RET'
if (_ret < 0) { \
^~~~~~~~
card-iasecc.c:3207:20: note: uninitialized use occurs here
LOG_TEST_RET(ctx, rv, "Cannot get QSign data");
^~
../../src/libopensc/log.h:90:77: note: expanded from macro 'LOG_TEST_RET'
...r, text) SC_TEST_RET((ctx), SC_LOG_DEBUG_NORMAL, (r), (text))
^
../../src/libopensc/log.h:83:14: note: expanded from macro 'SC_TEST_RET'
int _ret = (r); \
^
card-iasecc.c:3206:3: note: remove the 'if' if its condition is always true
LOG_TEST_RET(ctx, SC_ERROR_INVALID_ARGUMENTS, "Need RSA_...
^
../../src/libopensc/log.h:90:36: note: expanded from macro 'LOG_TEST_RET'
^
../../src/libopensc/log.h:84:2: note: expanded from macro 'SC_TEST_RET'
if (_ret < 0) { \
^
card-iasecc.c:3185:8: note: initialize the variable 'rv' to silence this warning
int rv;
^
= 0
2016-03-02 15:01:19 +01:00
Ludovic Rousseau
d86ada1c64
card-iasecc.c: fix 1 compiler warning
...
card-iasecc.c:2322:58: error: address of 'data->pin2.data' will always evaluate
to 'true' [-Werror,-Wpointer-bool-conversion]
...if (!data->pin1.data && !data->pin1.len && &data->pin2.data && !data->pi...
~~ ~~~~~~~~~~~^~~~
2016-03-02 14:59:27 +01:00
Ludovic Rousseau
ad11c9937c
card-authentic.c: fix 1 compiler warning
...
card-authentic.c:1452:57: error: address of 'data->pin2.data' will always
evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
if (!data->pin1.data && !data->pin1.len && &data->pin2.data && !...
~~ ~~~~~~~~~~~^~~~
2016-03-02 14:57:42 +01:00
Ludovic Rousseau
d45ae3ba80
sm-card-iasecc.c: fix compiler warning
...
sm-card-iasecc.c: In function ‘sm_iasecc_get_apdu_delete_file’:
sm-card-iasecc.c:188:25: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
unsigned int file_id = (unsigned int)sm_info->cmd_data;
^
2016-03-02 14:50:57 +01:00
Andreas Schwier
69eaa66e83
sc-hsm: Fix #698
2016-03-02 14:20:51 +01:00
Ludovic Rousseau
89ec66fbe8
framework-pkcs15.c: fix compiler warning
...
framework-pkcs15.c:706:1: warning: unused function
'__pkcs15_create_secret_key_object' [-Wunused-function]
__pkcs15_create_secret_key_object(struct pkcs15_fw_data *fw_data,
^
2016-02-29 20:19:42 +01:00
Ludovic Rousseau
7a7fb19a7d
iasecc-sm.c: fix compiler warning
...
iasecc-sm.c:697:22: warning: cast to 'void *' from smaller integer type
'unsigned int' [-Wint-to-void-pointer-cast]
sm_info->cmd_data = (void *)file_id;
^
2016-02-29 20:19:42 +01:00
Ludovic Rousseau
ed30d4ebb7
pkcs15-isoApplet.c: fix compiler warning
...
pkcs15-isoApplet.c:268:38: warning: address of 'df->path' will always evaluate
to 'true' [-Wpointer-bool-conversion]
if(!pin || !pin_len || !df || !&df->path)
~ ~~~~^~~~
2016-02-29 20:19:42 +01:00
Ludovic Rousseau
a8c741002d
reader-pcsc.c: fix compiler warning
...
der-pcsc.c:1101:11: warning: comparison of integers of different signs:
'LONG' (aka 'int') and 'unsigned int' [-Wsign-compare]
if (rv == SCARD_E_NO_SERVICE) {
~~ ^ ~~~~~~~~~~~~~~~~~~
2016-02-29 20:19:42 +01:00
Ludovic Rousseau
80a313fb2a
pkcs11-spy.c: fix 1 warning
...
pkcs11-spy.c:259:49: warning: format specifies type 'long' but the argument has
type 'int' [-Wformat]
fprintf(spy_output, "%s.%03ld\n", time_string, tv.tv_usec / 1000);
~~~~~ ^~~~~~~~~~~~~~~~~
%03d
2016-02-29 20:19:42 +01:00
Ludovic Rousseau
cd42fbbc65
openpgp-tool.c: fix compiler warning
...
penpgp-tool.c:367:9: warning: comparison of integers of different signs: 'int'
and 'unsigned int' [-Wsign-compare]
if (r != count) {
~ ^ ~~~~~
Remove 3 casts
Add 1 cast
Fix a format problem
2016-02-29 20:19:42 +01:00
Ludovic Rousseau
e7cbc3ba82
opensc-explorer.c: fix compiler warning
...
opensc-explorer.c:1727:8: warning: comparison of integers of different signs:
'int' and 'size_t' (aka 'unsigned long') [-Wsign-compare]
if(r > len) {
~ ^ ~~~
2016-02-29 20:19:42 +01:00
Ludovic Rousseau
d929532b63
pkcs11-tool.c: fix 2 compiler warnings
...
pkcs11-tool.c:2650:25: warning: unused variable 'ecdh_parms' [-Wunused-variable]
CK_ECDH1_DERIVE_PARAMS ecdh_parms;
^
pkcs11-tool.c:2021:7: warning: unused variable 'is_private' [-Wunused-variable]
int is_private = opt_object_class == CKO_PRIVATE_KEY;
^
2016-02-29 20:19:42 +01:00
Ludovic Rousseau
08529c91ee
log.c: fix compiler warning
...
log.c:94:87: warning: format specifies type 'long' but the argument has type
'int' [-Wformat]
...%03ld ", (unsigned long)pthread_self(), time_string, tv.tv_usec / 1000);
~~~~~ ^~~~~~~~~~~~~~~~~
%03d
2016-02-29 20:19:42 +01:00
Viktor Tarasov
f29f2e62b3
pkcs15init: fix bug introduced in 50f03bc
2016-02-29 18:52:45 +01:00
Frank Morgner
50f03bca3f
fixed memory leak
2016-02-29 13:08:34 +01:00
Frank Morgner
1862970212
fixed typo
2016-02-29 13:08:34 +01:00
Frank Morgner
fa71448d1c
added fall through comment
2016-02-29 10:52:48 +01:00
German Blanco
1dd501a705
DNIe. Removing all memory leaks and using SM wrapping and unwrapping.
2016-02-28 08:13:45 +01:00
Frank Morgner
ceb913a7bb
Merge pull request #679 from l1k/master
...
GemSAFE ATR + format string fixes
2016-02-25 16:35:53 +01:00
Viktor Tarasov
b8c3722bf5
pkcs11/framework: no more 'for-applications' mode for slot creation
...
Simplify create tokens rules, no need to manipulate applications in
'pkcs11' configuration part,
applications can be enabled/disabled on the 'pkcs15' one.
Fix the possibility to expose only 'sign' PIN
2016-02-24 13:39:27 +01:00
Frank Morgner
ae359ba180
Merge pull request #678 from CardContact/fix-bcd-sopin
...
sc-hsm: Fix BCD encoding bug with SO-PIN
Fixes https://github.com/OpenSC/OpenSC/issues/674
2016-02-23 22:33:36 +01:00
Lukas Wunner
c8fbcdd076
card-gemsafeV1: Add ATR for European Patent Office smart card
...
The EPO hands this card out to attorneys and inventors to authenticate
with their online services. The applet on the card seems to be identical
to the one on Swedish eID cards.
Ludovic Rousseau's list identifies the card as Gemalto IDClassic 340.
Gemalto Classic Client identifies the card as GemSAFE V3.
Previously the EPO was using a GemSAFE V1 card, its ATR was added with
81bbddfc24
("card-gemsafeV1: Add a GemSafe V1 ATR").
2016-02-20 14:27:27 +01:00
Lukas Wunner
a020e1f7d4
pkcs11: Fix signedness issues in debug messages
...
Use the appropriate printf conversion for data->buffer_len which is
an unsigned int.
2016-02-20 14:27:27 +01:00
Viktor Tarasov
dbca85636f
pkcs11-tool: use keygen mech. from cmd arguments
...
There are can be more then one keygen mechanism for a given
key type.
(ex. CKM_RSA_PKCS_KEY_PAIR_GEN and CKM_RSA_X9_31_KEY_PAIR_GEN)
2016-02-19 16:05:55 +01:00
vletoux
8a2a274393
gids: no more DF selection
...
Theoritically, SELECT FILE with DF is not specified so avoid it.
2016-02-19 00:12:16 +01:00
LE TOUX Vincent
6a243449a0
First support for GIDS card
...
- minidriver included by default in Windows
- GIDS Applet is available here https://github.com/vletoux/GidsApplet
- some informative technical information is available here
http://www.mysmartlogon.com/knowledge-base/generic-identity-device-specification-gids-kb/
closes https://github.com/OpenSC/OpenSC/pull/651
2016-02-19 00:12:16 +01:00
Andreas Schwier
b9cf74361c
sc-hsm: Fix BCD encoding bug with SO-PIN
2016-02-18 18:25:34 +01:00
Frank Morgner
1ca22a22d1
Merge pull request #665 from sfff/pkcs11tool-pubkey-2016
...
pkcs11-tool: support write of GOST Public Key object
2016-02-16 23:27:56 +01:00
Viktor Tarasov
754eaf3c14
config: allow disabling of PKCS15 application
2016-02-16 16:54:14 +01:00
Frank Morgner
0519de6c81
pkcs15-dnie: removed obsolete dll entry points
2016-02-16 07:49:19 +01:00
Frank Morgner
83d5ac5fee
remove compat_strnlen.obj from windows build
...
windows already implements this function
2016-02-16 07:15:36 +01:00
Frank Morgner
500e358ea7
fixed syntax error
2016-02-16 07:11:57 +01:00
Frank Thater
b2c7803373
sc-hsm: Fix share calculation if prime number is less than secret
2016-02-12 15:36:42 +01:00
Feitian Technologies
e2c21d7c25
Add new Feitian PKI Card ATR into OpenSC
...
Add new PKI Card ATR into OpenSC support, all of these ATR using same
PKI Applet. and the ATR/JAVA CARD is provided by Feitian.
More information, please check www.javacardos.com
Fixes a memory leak in `entersafe_select_fid`
Closes https://github.com/OpenSC/OpenSC/pull/625
2016-02-04 12:23:46 +01:00
Aleksey Samsonov
3084b3aa32
pkcs11-tool: fix mask for detect PEM format
...
Make universal mask for choose input format from PEM or DER.
Input file at PEM may be contain at start:
"-----BEGIN RSA PRIVATE KEY-----"
or
"-----BEGIN PRIVATE KEY-----"
2016-01-24 02:31:19 +03:00
Aleksey Samsonov
0d6ecd750e
pkcs11-tool: support write of GOST Public Key object
2016-01-24 02:23:18 +03:00
Aleksey Samsonov
6b2fcf825f
Rutoken ECP: additional Miller-Rabin tests aren't needed
...
Make universal properties at RSF-files. Additional Miller-Rabin tests
aren't needed for 'Rutoken ECP' and for 'Rutoken ECP 2.0'
fixes https://github.com/OpenSC/OpenSC/issues/648 :
'Incorrect parameters in APDU' at 'Rutoken ECP 2.0' when 'pkcs15-init -G
rsa/1024 ...'
2016-01-24 01:34:05 +03:00
Aleksey Samsonov
e1a3bf8805
Rutoken ECP: set more universally 'Attempts' for RFS-files
2016-01-24 01:14:21 +03:00
Frank Morgner
4f4b6c962a
Merge pull request #661 from frankmorgner/strnlen
...
implemented strnlen
2016-01-22 14:36:42 +01:00
Frank Morgner
b09d2777d1
Merge pull request #663 from digitallumens/pkcs15-crypt/stdin
...
pkcs15-crypt: Allow the use of stdin if no input file is specified.
2016-01-22 14:36:02 +01:00
Chris Elledge
c56378b8ba
pkcs15-crypt: Document defaults of stdin/stdout.
2016-01-21 11:30:26 -05:00
Chris Elledge
92e02b50dc
pkcs15-crypt: Allow the use of stdin if no input file is specified.
2016-01-20 15:35:44 -05:00
Frank Morgner
89f9d9e85d
add compatibility implementation for strnlen
...
fixes https://github.com/OpenSC/OpenSC/issues/660
2016-01-20 10:47:27 +01:00
Chris Elledge
f01a8ad22e
pkcs11-tool: Switched some printfs to fprintfs to allow pipes to work.
2016-01-19 14:54:02 -05:00
Frank Morgner
a0c0087446
Merge pull request #637 from germanblanco/sm_get_response_loop_fix
...
Stop reading a file when an error happened *or* all data requested was read.
Fixes https://github.com/OpenSC/OpenSC/issues/632 , but may need adjustments when used with SM
2016-01-15 10:32:46 +01:00
Frank Morgner
75c14ce815
Fixed possible NULL dereference
...
fixes https://github.com/OpenSC/OpenSC/issues/656
2016-01-14 05:02:28 +01:00
Lukas Wunner
d7559f1546
card-gemsafeV1: Support signing SHA256
...
GemSAFE V1 cards support signing 36 bytes of free form data.
When signing a hash, the hash must be prepended by the DigestInfo
header. The PKCS#1 padding is done on the card. The 36 bytes limit
is sufficient for MD5 (16 + 18 bytes for the header), SHA1 and
RIPEMD160 (both use 20 + 15 bytes for the header) and MD5_SHA1
(16 + 20 bytes, no header). The algorithm reference ("cryptographic
mechanism reference" in ISO 7816 parlance) for signing free form data
is 0x12.
GemSAFE V3 cards changed the algorithm reference for signing free
form data to 0x02. In addition, they gained the ability to sign SHA256.
Since SHA256 exceeds the 36 bytes limit (32 + 19 bytes for the header),
it must be sent to the card *without* DigestInfo header. The header
will be prepended by the card and it is instructed to do so by sending
algorithm reference 0x42.
This scheme is also supported for SHA1, the algorithm reference is
0x12 in this case. However using this is not necessary as SHA1 fits
within the 36 bytes limit, including the header.
Supporting SHA256 is straightforward, we just add it to the flags
before adding the RSA algorithms. When sc_pkcs15_compute_signature()
calls sc_get_encoding_flags(), the input will be "iFlags 0x202, card
capabilities 0x8000021A" and the output will be "pad flags 0x0, secure
algorithm flags 0x202". I.e. the hash is neither prepended by the
DigestInfo header nor PKCS#1 padded and the hash algorithm is passed
to gemsafe_set_security_env() which can send the appropriate algorithm
reference 0x42 to the card.
However there's a catch: Once we add SHA256 to the flags, PKCS#11
applications will be unable to use the other hashes like SHA1 or
RIPEMD160. That's because register_mechanisms() checks if the card
supports no hashes, and if so, adds all of them:
if (!(rsa_flags & SC_ALGORITHM_RSA_HASHES)) {
rsa_flags |= SC_ALGORITHM_RSA_HASHES;
}
We cannot add these missing hashes to the flags like we did with SHA256
because like SHA256, they would be sent to the card *without* DigestInfo
header. What we want is to send all hashes *with* DigestInfo header,
*except* for SHA256.
We can achieve that by registering a fake RSA algorithm which includes
the missing hashes in its flags. This fake algorithm is never used
because sc_card_find_rsa_alg() searches the algorithm list in-order
and we register the fake algorithm *after* the real algorithms.
The fake algorithm persuades register_mechanisms() to register the
missing hashes because it ORs the flags of all RSA algorithms together:
num = card->algorithm_count;
while (num--) {
switch (alg_info->algorithm) {
case SC_ALGORITHM_RSA:
rsa_flags |= alg_info->flags;
break;
}
}
So when signing e.g. a RIPEMD160 hash and sc_pkcs15_compute_signature()
calls sc_get_encoding_flags(), the input will be "iFlags 0x102, card
capabilities 0x8000021A" and the output will be "pad flags 0x100, secure
algorithm flags 0x2". This will result in the hash being prepended by
the DigestInfo header, which is what we want.
2016-01-14 04:55:23 +01:00
Frank Morgner
e8d8f9f2bb
Merge pull request #650 from vletoux/pkcs11-crash-when-read-public-key-fails
...
fix a pkcs11 crash when the public key reading fails
fixes #649
2016-01-06 07:30:15 +01:00
Frank Morgner
611e5200b1
Merge pull request #647 from vletoux/visual-studio-warning
...
remove visual studio compilation error
2016-01-06 07:28:56 +01:00
LE TOUX Vincent
6e5ae841eb
fix a pkcs11 crash when the public key reading fails
2016-01-02 09:31:36 +01:00
LE TOUX Vincent
56275c6993
remove visual studio compilation error
...
quote:
avoid error C4703: potentially uninitialized local pointer variable 'obj' used line 1414
2015-12-31 18:09:45 +01:00
Frank Morgner
e96d3ccf66
Merge pull request #642 from mouse07410/master
...
Fix public key access and attributes
2015-12-28 00:48:40 +01:00
Frank Morgner
47835f719f
Merge pull request #643 from dengert/piv-pubkey-auth_id
...
PIV pubkey auth_id fix
2015-12-23 21:06:44 +01:00
Uri Blumenthal
76ed06981b
Made sure attribute CKA_TOKEN is set to TRUE.
2015-12-22 13:31:42 -05:00
Doug Engert
aa4b089a41
PIV pubkey auth_id fix
...
pkcs15-piv.c was setting the auth_id of the public keys
which would cause some appications to require a login to access
a public key. The public keys are obtained from the certificates
which do not require the PIN to read.
Very early drafts of NIST 800-73 did require the PIN to access the
certificates, and the auth_id was removed in the opensc code for
certificates many years ago, but not from the public keys.
2015-12-22 09:41:39 -06:00
Uri Blumenthal
2b6b0ee05a
According to PKCS#11 standard, public key should not have the
...
attribute CKA_SENSITIVE set to TRUE. This attribute is for
private and secret keys only.
2015-12-21 12:11:48 -05:00
Uri Blumenthal
25dae28ab5
Access to public key should not be PIN-authenticated. Especially
...
since access to certificate (from which one can get public key)
is not currently PIN-authenticated.
2015-12-21 12:10:46 -05:00
Frank Morgner
2fd32fdd73
Merge pull request #638 from ibpl/master-IB#1047758
...
Fix smartcard certificate removal and update
2015-12-16 08:21:03 +01:00
Pawel Boguslawski
de42deaae1
Fix smartcard certificate removal and update
...
This patch fixes bug found in opensc 0.14.0-2 (Debian 8) that blocks
certificate update and removal on Athena ASEPCOS smartcard with error
Failed to update certificate: Security status not satisfied
OpenSC tries to get the parent's 'DELETE' access before cert removal
and leaves path variable pointing to dir not file to be removed.
Author-Change-Id: IB#1047758
2015-12-15 20:09:03 +01:00
German Blanco
e9f94d7818
Align end of the loop with comment in previous line (exit when 90 00 or length completed).
2015-12-15 10:43:48 +01:00
Frank Morgner
200b09b89f
Merge pull request #622 from germanblanco/dnie_memory_leaks_2
...
Removing memory leaks in DNIe
Refactoring pending. Continued from #606
2015-12-14 20:50:45 +01:00
Andreas Schwier
06f296b978
sc-hsm: implement logout function
...
- re-selection of the applet resets the applet's state
- removes path in key object and fixes #631
2015-12-12 02:28:23 +01:00
vletoux
57e05d3359
minidriver: use sc_logout for CardDeauthenticate
2015-12-12 02:28:01 +01:00
Frank Morgner
5129c5a060
Fixed memory leaks
2015-12-09 08:22:45 +01:00
Frank Morgner
36ceb890ab
Avoid duplicated code of handling security environment
2015-12-06 10:44:08 +01:00
Frank Morgner
ee65ab85ce
Avoid duplicated code by unifying key usage
2015-12-06 10:43:30 +01:00
Frank Morgner
5ed3df9024
extend PIN-revalidation to key preparation
2015-12-06 10:42:45 +01:00
Frank Morgner
3384113616
reset `login_user` with `reset_login_state`
2015-12-06 10:42:45 +01:00
Frank Morgner
b43ea19320
reset login_user on CKR_USER_NOT_LOGGED_IN
2015-12-06 10:42:45 +01:00
Frank Morgner
43a844c949
cardos 4.3+: enable logout command
2015-12-06 10:42:45 +01:00
Frank Morgner
83ef753799
Implemented atomic PKCS#11 transactions
2015-12-06 10:42:45 +01:00
Wouter Verhelst
5de1ec4518
Allow ASN.1 decoding if the file seems incomplete
...
Some cards (e.g., BELPIC) have a hardcoded file length that does not
match the actual file length (e.g., 65535 bytes), and simply return the
data that is actually on the card when asked.
It is useful to still be able to do an ASN.1 decode in that case.
Signed-off-by: Wouter Verhelst <w@uter.be>
2015-12-01 16:20:17 +01:00
Frank Morgner
56d52afb17
Merge pull request #617 from mtrojnar/os_locking
...
Enable OS locking
2015-12-01 11:21:35 +01:00
Michał Trojnara
fa9da7ad01
configurable OS thread locking
2015-12-01 09:19:03 +01:00
Frank Morgner
b6856e8dbf
don't use unicode ticks
2015-11-30 01:33:11 +01:00
Flavio Medeiros
b9adbae5f0
Avoiding conditional directives that split up parts of statements.
2015-11-28 11:33:38 -03:00
German Blanco
d1a1830115
Removing all memory leaks in DNIe but one. Refactoring pending.
2015-11-27 11:32:33 +01:00
Michał Trojnara
f9e614890d
Fix a buffer overflow in thread mutex create
2015-11-26 12:32:47 +01:00
Frank Morgner
a454dd7fc9
Merge pull request #605 from germanblanco/dnie_ui_depends_on_ssl_2
...
DNIe UI moved into card-dnie.c
closes #362
2015-11-21 19:22:07 +01:00
Frank Morgner
d9fc49daa5
reader-pcsc: get tlv properties only when supported
2015-11-17 00:52:49 +01:00
Frank Morgner
641a71a2f4
Merge pull request #601 from frankmorgner/coverity
...
Some more fixes for problems reported by Coverity scan
2015-11-16 12:29:57 +01:00
German Blanco
1596ca4244
DNIe user interface moved into card-dnie.c.
2015-11-10 12:10:56 +01:00
Frank Morgner
f13da8abfa
removed unsupported opensc_pkcs11_install.js
2015-11-02 23:51:28 +01:00
Frank Morgner
622b71970f
add compat_report_rangecheckfailure.c to libcompat
2015-11-01 21:02:34 +01:00
Frank Morgner
d6cea60500
Merge pull request #600 from vletoux/patch_openSSL
...
win32: link OpenSSL statically again
2015-11-01 20:59:49 +01:00
Frank Morgner
613d698d3d
fixed potential NULL dereference
2015-11-01 17:13:24 +01:00
vletoux
8a47f238de
win32: link OpenSSL statically again
2015-11-01 13:35:05 +01:00
Frank Morgner
681e8aef98
Fixed accessing Application label
...
regression of 78018a2b49
2015-11-01 13:22:26 +01:00
Frank Morgner
218a9eb52c
make casting explicit
2015-11-01 13:18:39 +01:00
Frank Morgner
98d7578113
ctbcs.c: fixed out of bounds write
2015-11-01 11:33:40 +01:00
Frank Morgner
a649d66b02
card-westcos.c: fixed dead code
2015-11-01 10:49:19 +01:00
Frank Morgner
a34d1f7dcd
sc-hsm-tool.c: fixed potential resource leak
2015-11-01 10:44:24 +01:00
Frank Morgner
4ca7daf31c
pkcs15-tool.c: fixed potential resource leak
2015-11-01 10:44:24 +01:00
Frank Morgner
5399c264fb
cryptoflex-tool.c: fixed potential resource leak
2015-11-01 10:44:23 +01:00
Frank Morgner
c2ff4f090a
pkcs15-pubkey.c: fixed potential resource leak
2015-11-01 10:44:23 +01:00
Frank Morgner
0f9645587a
cwa14890.c: fixed potential resource leak
2015-11-01 10:44:23 +01:00
Frank Morgner
21a8e7e5f9
Merge pull request #591 from vletoux/isoApplet
...
isoApplet: fix card not recognized by minidriver
2015-10-31 02:28:21 +01:00
Frank Morgner
451386886d
Merge pull request #573 from frankmorgner/coverity
...
Fix some more memory leaks reported by Coverity
2015-10-31 02:24:51 +01:00
Frank Morgner
8e7049c2fa
removed unused variables
2015-10-30 18:21:40 +01:00
Frank Morgner
fa9ffb7b90
fixed uninitialized variable
...
regression of baab26d871
2015-10-30 18:21:40 +01:00
Frank Morgner
9f0087d968
fixed missing includes
2015-10-30 18:21:40 +01:00
Frank Morgner
ad5d16927c
fixed cflags for onepin module
2015-10-30 16:45:22 +01:00
Frank Morgner
00ea7a68be
Removes unused variables
2015-10-30 12:18:04 +01:00
Frank Morgner
7e29fcd26c
pkcs15-authentic.c: fixed potential resource leak
2015-10-30 12:18:04 +01:00
Frank Morgner
f9a73c0b20
pkcs15-sc-hsm.c: fixed potential resource leak
2015-10-30 12:18:04 +01:00
Frank Morgner
0853ecd887
pkcs15-pubkey.c: fixed potential resource leak
2015-10-30 12:18:04 +01:00
Frank Morgner
98b9b37e12
card-openpgp.c: fixed potential resource leak
2015-10-30 12:18:04 +01:00
Frank Morgner
9e1a5447d4
profile.c: fixed potential resource leak
2015-10-30 12:15:06 +01:00
Frank Morgner
fd904fbcb8
pkcs15-oberthur-awp.c: fixed potential resource leak
2015-10-30 12:15:06 +01:00
Frank Morgner
e7316b60e3
pkcs15-myeid.c: fixed potential resource leak
2015-10-30 12:15:06 +01:00
Frank Morgner
baab26d871
pkcs15-lib.c: fixed potential resource leak
2015-10-30 12:15:06 +01:00
Frank Morgner
4f4c4aa5ec
pkcs15-iasecc.c: fixed potential resource leak
2015-10-30 12:15:06 +01:00
Frank Morgner
34b6d95ec6
card-westcos.c: fixed potential resource leak
2015-10-30 12:15:06 +01:00
Frank Morgner
ecf147099a
card-epass2003.c: fixed potential resource leak
2015-10-30 12:15:06 +01:00
Frank Morgner
2963588887
card-authentic.c: fixed potential resource leak
2015-10-30 12:15:06 +01:00
Frank Morgner
b96ba14aae
added fall through comment
2015-10-30 12:15:06 +01:00
Andreas Schwier
0caf0d1dd6
sc-hsm: Add missing include introduced by #580
2015-10-29 14:09:01 +01:00
Frank Morgner
decd5ab987
Merge pull request #580 from frankmorgner/select
...
Fix issues related to selecting a file
2015-10-29 13:30:37 +01:00
Frank Morgner
c50a951337
Merge pull request #566 from vletoux/ecc_minidriver
...
First ECC support for the minidriver
2015-10-24 23:32:42 +02:00
vletoux
206eb7124a
isoApplet: fix card not recognized by minidriver
2015-10-23 23:03:25 +02:00
Petr Spacek
52b6505909
export all C_* symbols
...
Header files distributed with PKCS#11 v2.30 define all functions as
extern and some applications (like BIND 9.10) do not work without all
functions.
2015-10-22 18:07:26 +02:00
Frank Morgner
249f258ff2
Merge pull request #584 from marschap/card-openpgp-cleanup2
...
OpenPGP card cleanup
2015-10-17 17:36:40 +02:00
Frank Morgner
4ddf2cc042
Merge pull request #579 from dengert/piv-cac
...
Do not expose access to PIV emulated files from utilities
2015-10-17 17:34:39 +02:00
Frank Morgner
0ca46910f7
use tabs only for indenting
2015-10-16 09:58:01 +02:00
vletoux
35175a814c
minidriver: fix according to frank's comments
2015-10-15 22:40:36 +02:00
Peter Marschall
6109a8792d
OpenPGP: add additional manufacturers
2015-10-15 16:43:10 +02:00
Peter Marschall
a0ca6b2ef0
OpenPGP: set card's version in pgp_init()
2015-10-15 16:43:10 +02:00
Peter Marschall
7078fbd505
OpenPGP: cleanup pgp_init()
...
- use LOG_FUNC_RETURN instead of return for symmetry with LOG_FUNC_CALLED
2015-10-15 16:43:10 +02:00
Peter Marschall
e1db96b73b
OpenPGP: extend pgp_match_card()
...
- explicitly check for supported versions
- log successful matches by AID with their type
- log detection of unsupported OpenPGP-type cards
2015-10-15 16:43:09 +02:00
Peter Marschall
7c2adb1fc8
OpenPGP: 1st preparations for newer versions
...
- add references to new specs
- add new enum _version constants
2015-10-15 16:43:09 +02:00
Peter Marschall
69b482dce6
OpenPGP: cleanup pgp_get_card_features()
...
- bug fix: re-initialize index to start searching at the right place
- get rid of unnecessary variable
- add some line breaks & comemnts for easier understanding
2015-10-15 16:42:58 +02:00
Peter Marschall
2a269c5267
OpenPGP: cleanup pgp_build_tlv()
...
- get rid of intermediate variable
- clarify check in while() loop
- line breaks for easier reading
2015-10-15 16:17:22 +02:00
Peter Marschall
3d492ae376
OpenPGP: cleanup pgp_erase_card()
...
- get rid of unnecessary variable
- use easily understandable hex representation of APDUs
- auto-calculate APDU length based on hex representation
- restrict scope of some variables
- use sc_log() instead of directly writing to console
- line breaks & comments for easier reading/understanding
- fix typo in log message
2015-10-15 16:17:22 +02:00
Peter Marschall
3d4fbd776d
OpenPGP: harmonize coding style
...
- 2 line breaks between functions for easier reading
- function type on separate line
- mark each function as 'ABI' or 'Internal'
- slightly doxygen-ize comments introducing functions
- fix typos in comments
- break over-long comment lines
- break comment lines at sensible places
- consistent calling style for DRVDATA()
- no code change
2015-10-15 16:17:22 +02:00
Peter Marschall
7ba47fd5a9
OpenPGP: consistently use card->ctx in pgp_put_data_plain()
...
- get rid of unnecessary variable
- harmonize coding style: adapt to prevailing use of card->ctx
2015-10-15 16:17:22 +02:00
Peter Marschall
1a05f968bd
OpenPGP: simplify gnuk_write_certificate()
...
- get rid of unnecessary variables
- use for-loop to initialize/check/increase run variable in one place
- restrict variables to the necessary scope
- use ternary operator inside a statement instead of if...else...
2015-10-15 16:17:22 +02:00
Peter Marschall
d2b1c8228f
OpenPGP: set apdu_case on declaration
...
- use ternary operator to set apdu_case immediately on declaration
for the GNUK and non-GNUK case
2015-10-15 16:17:22 +02:00
Peter Marschall
3341c5bb8f
OpenPGP: make logical structure clearer
...
- one line per sub-term in the condition of the conditional statement
2015-10-15 16:17:11 +02:00
Frank Morgner
e316bf3140
Merge pull request #582 from marschap/openpgp-tool-fixes
...
Openpgp tool fixes
2015-10-15 13:13:18 +02:00
Peter Marschall
6498721076
piv: fix typos in usage & man page
2015-10-15 12:51:19 +02:00
Peter Marschall
7de373b3b9
OpenPGP: mark do_erase as an action in openpgp-tool
...
- avoid the unintended output of user info when only erasing was requested
2015-10-15 12:51:10 +02:00
Peter Marschall
524ad56146
OpenPGP: remove unnecessary semicolons in openpgp-tool
...
- this is C, not a shell script
2015-10-15 12:51:10 +02:00
Peter Marschall
392bc08d86
OpenPGP: fix pretty name for gender code 39 in openpgp-tool
...
- use the same term that GnuPG uses
2015-10-15 12:51:10 +02:00
Peter Marschall
e79f1f4b01
OpenPGP: accept -E as option in openpgp-tool
...
- make behaviour match the usage message by accepting '-E' as
alternative short form of '--erase'
2015-10-15 12:51:10 +02:00
Frank Morgner
e1073c09ea
handle checking of file output in sc_select_file
...
fixes https://github.com/OpenSC/OpenSC/issues/576
2015-10-14 23:25:13 +02:00
Frank Morgner
bcf9b2bc84
added error checking
2015-10-14 23:14:47 +02:00
Frank Morgner
e634169a92
added error checking
2015-10-14 23:14:47 +02:00
Frank Morgner
c371c3b5ec
removed unused variable
2015-10-14 23:08:39 +02:00
Frank Morgner
f9011b7dc0
fixed indenting
2015-10-14 22:57:10 +02:00
Frank Morgner
4f13fde7f1
use size_t for a length instead of int
2015-10-14 22:56:53 +02:00
Frank Morgner
4275dac495
fixed indenting
2015-10-14 22:51:55 +02:00
Frank Morgner
0bf1f3755c
removed unused variable
2015-10-14 22:48:45 +02:00
vletoux
fed64b0636
minidriver: fixes according to Frank's comments
2015-10-14 22:48:41 +02:00
Frank Morgner
949d8614d2
removed unused variable
2015-10-14 22:46:55 +02:00
Frank Morgner
0258c91f30
removed unused variable
2015-10-14 22:43:12 +02:00
Frank Morgner
0a96616034
remove unused variable
2015-10-14 22:38:10 +02:00
Frank Morgner
6573a93d4b
fixed memory leak
2015-10-14 22:37:56 +02:00
Frank Morgner
a5685b537e
fixed memory leak
2015-10-14 22:34:44 +02:00
Frank Morgner
15f204c5d6
fixed indenting
2015-10-14 22:32:51 +02:00
Frank Morgner
895005f4df
added error checking
2015-10-14 22:28:49 +02:00
Doug Engert
65bc754b8b
Do not expose access to PIV emulated files from utilities
...
PIV cards uses get/put data not select file and read_binary.
To allow access via pkcs15 emulation card-piv.c emulates
select_file and read_binary but only when used with the path as
created by the piv emulation.
There are no MF.DIR or ED.DIR files.
opensc-tool and opensc-explorer will not work with this emulation.
Patch removes code that caused problems with opensc-tooland opensc-explorer.
2015-10-14 15:27:58 -05:00
Frank Morgner
00daa3f535
added error checking
2015-10-14 22:27:32 +02:00
Frank Morgner
9a82ddea8a
fixed memory leak
2015-10-14 22:26:53 +02:00
vletoux
75d76f5ce4
Merge branch 'master' of https://github.com/OpenSC/OpenSC into OpenSC-master
...
Conflicts:
src/minidriver/minidriver.c
2015-10-14 22:22:19 +02:00
Frank Morgner
5558b9d368
removed unused parameters
2015-10-14 22:17:33 +02:00
Frank Morgner
2ed4c8ae6c
Adds error checking
2015-10-14 22:16:44 +02:00
Frank Morgner
94772c870a
Adds error checking
2015-10-14 22:15:17 +02:00
Frank Morgner
c9420046c5
Removed unused parameter
2015-10-14 22:08:14 +02:00
Frank Morgner
77b5138860
Removed unused parameter
2015-10-14 22:02:35 +02:00
Frank Morgner
851e0a24ff
Merge pull request #571 from frankmorgner/label
...
Fixes accessing fixed size arrays
2015-10-14 18:56:29 +02:00
Frank Morgner
ee5915700c
Merge pull request #516 from frankmorgner/lock
...
Only re-lock for Windows and Apple
2015-10-13 14:11:29 +02:00
Doug Engert
0b268f789a
Allow PIV driver to use cards where default application in not PIV
...
card-piv.c was not selecting the PIV AID correctly from piv_find_aid.
This cause a CAC card that also has the PIV application to fail a VERIFY command
of the pin would use a VERIFY APDU P2 where P2 for PIV is 80, but for CAC was 00.
A CAC card could work if the caller requested the serial number of the card
which did call piv_select_aid. All the OpenSC tools, minidriver and
PKCS#11 do this, but Tokend does not.
This is a partial fix for https://github.com/OpenSC/OpenSC/issues/570 .
Tokend in later MacOS versions still has other issues.
A more complete solution is needed for cards with multiple applications.
I do not have a CAC card or MAC to do any testing.
Thanks to https://github.com/mouse07410 who has a CAC card, and a Mac,
and has tested this fix.
2015-10-11 19:14:02 -05:00
vletoux
747678c83d
minidriver: remove unnecessary logs on console (certutil -scinfo)
2015-10-11 18:51:36 +02:00
vletoux
b968fcfb1f
minidriver: Windows x509 enrollment works
...
Removed cmap_record in sc_pkcs15_prkey_info (not used by any driver nor code)
Remove cardcf specific code (cardcf neutralized by CP_CACHE_MODE_NO_CACHE and it maintened by the Base CSP/KSP, not the minidriver)
Add conversion code for Windows GUID / OpenSC self computed GUID
2015-10-11 15:20:04 +02:00
vletoux
bee1a450c9
minidriver: modified configuration functions
2015-10-11 10:39:02 +02:00
vletoux
7551baafbd
minidriver: add crt secure functions (*_s)
2015-10-10 22:07:49 +02:00
vletoux
ebfb76d311
minidriver: fix library import for guid & one compilation warning
2015-10-10 19:01:14 +02:00
vletoux
8f4420cb78
minidriver: factorize container naming code
2015-10-10 15:39:27 +02:00
vletoux
227f48d7b0
minidriver: replace one sprintf by sprintf_s
2015-10-10 14:15:23 +02:00
Frank Morgner
da1d4cc78a
Fix locking issue on OS X
...
Works around Apple shipping PCSC-Lite headers without PCSC-Lite. Let's
say they do it for "backward compatibility"...
2015-10-08 08:24:40 +02:00
Frank Morgner
a6b36507a3
removed unused parent in md directory/file
2015-10-06 22:49:32 +02:00
Frank Morgner
d18ddcb446
fixed accessing fixed size md file/directory name
2015-10-06 22:49:16 +02:00
Frank Morgner
6c61bf6815
fixed accessing fixed size guid
2015-10-06 22:49:16 +02:00
Olaf Kirch
f42a1c2563
Replace outdated address okir@lst.de -> okir@suse.de
...
Signed-off-by: Olaf Kirch <okir@suse.de>
2015-10-05 14:07:28 +02:00
Frank Morgner
137afb10b7
Check for NUL in label to test its presence
2015-10-05 08:30:47 +02:00
Frank Morgner
5b0332528f
fixed accessing app_label in sc_pkcs15_data_info_t
2015-10-05 08:23:02 +02:00
vletoux
811a86e72a
fix: set the container name as the id if md_guid_as_label is set
2015-10-04 19:49:31 +02:00
Frank Morgner
f9cd1fc476
fixed accessing fixed size cvc members
2015-10-04 17:53:51 +02:00
Frank Morgner
161e84f066
pkcs15-tool.c: fixed accessing label in sc_pkcs15_object_t
2015-10-04 17:33:14 +02:00
Frank Morgner
35f028a57c
pkcs15-init.c: fixed accessing label in sc_pkcs15_object_t
2015-10-04 17:33:14 +02:00
Frank Morgner
d709347c2b
pkcs15-crypt.c: fixed accessing label in sc_pkcs15_object_t
2015-10-04 17:33:14 +02:00
Frank Morgner
191af692c8
print.c: fixed accessing label in sc_pkcs15_object_t
2015-10-04 17:33:14 +02:00
Frank Morgner
e171789dad
pintest.c: fixed accessing label in sc_pkcs15_object_t
2015-10-04 17:33:14 +02:00
Frank Morgner
7c1feb1b8a
pkcs15-oberthur.c: fixed accessing label in sc_pkcs15_object_t
2015-10-04 17:33:14 +02:00
Frank Morgner
fa3f4d632c
pkcs15-lib.c: fixed accessing label in sc_pkcs15_object_t
2015-10-04 17:33:14 +02:00
Frank Morgner
1046d951ba
framework-pkcs15.c: fixed accessing label in sc_pkcs15_object_t
2015-10-04 17:33:14 +02:00
Frank Morgner
c56fe19b31
minidriver.c: fixed accessing label in sc_pkcs15_object_t
2015-10-04 17:33:14 +02:00
Frank Morgner
64417c271e
fixed out of bounds access
2015-10-04 13:19:29 +02:00
Frank Morgner
78018a2b49
fixed string operation on fixed size array
2015-10-04 13:07:39 +02:00
Frank Morgner
d33517a58b
fixed missing comma
2015-10-04 12:55:25 +02:00
Frank Morgner
9e500e0b9a
fixed bad typecast
2015-10-04 12:52:49 +02:00
Frank Morgner
50e81d1de0
added missing break
2015-10-04 12:45:25 +02:00
vletoux
3edf32ca9c
fix: when exporting immediatly an ECC key when the ECC key just has been created
...
This test case is triggered when requesting a ECC certificate from ADCS:
NCryptCreatePersistedKey followed by NCryptExportKey
2015-10-03 19:41:34 +02:00
vletoux
c3f2cb142f
fix "use guid as label"
...
Allow to use as pkcs15 label the windows container name (max: 39 characters)
2015-10-03 18:59:52 +02:00
vletoux
b667645797
fix compilation warning
2015-10-03 18:56:19 +02:00
Frank Morgner
ac65af0669
Fixes unreleased locks with pcsc-lite
...
This is a bug in PCSC-Lite propably won't be fixed, see
https://alioth.debian.org/tracker/index.php?func=detail&aid=315083&group_id=30105&atid=410088
Fixes https://github.com/OpenSC/OpenSC/issues/480
Closes https://github.com/OpenSC/OpenSC/pull/487
2015-10-03 12:55:15 +02:00
Frank Morgner
5e242c5fb2
Merge pull request #560 from CardContact/fix_sc_pkcs15init_finalize_profile
...
Removed error check to support card with PKCS#15 emulation but no mat…
2015-10-02 15:18:14 +02:00
Frank Morgner
a15363198c
Merge pull request #569 from mdealencar/patch-2
...
fix: change SC_TERMINATE (undefined) to SC_CTX_FLAG_TERMINATE
2015-10-02 15:16:42 +02:00
Frank Morgner
4f4643ee3e
Merge pull request #452 from frankmorgner/memory-leaks
...
Fix some memory leaks
2015-10-02 15:13:34 +02:00
Frank Morgner
e0a4e0bfec
Merge pull request #532 from frankmorgner/sloppy
...
implemented sloppy initialization for C_GetSlotInfo
2015-10-02 15:13:07 +02:00
Frank Morgner
f851197129
Merge pull request #565 from frankmorgner/sm-openssl
...
Build a lightweight version of OpenSC
2015-10-02 15:12:41 +02:00
mdealencar
34d6c10fa0
fix: change SC_TERMINATE (undefined) to SC_CTX_FLAG_TERMINATE
...
This file was not compiling because SC_TERMINATE is not defined anywhere. It seems like the intended expression is what I propose.
2015-10-01 08:38:23 -03:00
Frank Morgner
f252277fab
Add configuration for sloppy PKCS#11 initialization
2015-10-01 12:44:41 +02:00
Frank Morgner
3307dd6f45
implemented sloppy initialization for C_GetSlotInfo
...
Makes things work for Java and closes #523
2015-10-01 12:44:41 +02:00
vletoux
a9897f9956
First implementation of CardDeleteContainer
...
Container now can be created, deleted, in short, a read write card
2015-09-30 22:52:37 +02:00
vletoux
67740fb955
quality improvement of CardDeriveKey
2015-09-30 22:49:41 +02:00
vletoux
9a590d64e4
do not reset the authentication state before each operation
2015-09-30 22:47:16 +02:00
Frank Morgner
c5cf4f69a2
Merge pull request #559 from philipWendland/ecc-sig-format
...
ECDSA helper functions: strip zeroes when converting from R,S to sequence
2015-09-30 08:14:25 +02:00
Frank Morgner
fb705b6a2d
Merge pull request #563 from CardContact/fix_reselect_applet_for_pin_verification
...
Fix reselect applet for pin verification
2015-09-29 20:09:00 +02:00
vletoux
c00f9830ba
force recompilation on integration plateforms
2015-09-25 22:56:26 +02:00
vletoux
701d45e89d
fix delay load library import
2015-09-25 22:30:11 +02:00
vletoux
6cbeea3942
First ECC support for the minidriver
2015-09-25 22:22:29 +02:00
Andreas Schwier
83a28a1bc3
pkcs15: Observe path.aid for PIN operation
2015-09-25 11:56:32 +02:00
Andreas Schwier
7fd4edf7b6
Allow cards without EF.DIR using default application
...
Removed error check to support card with PKCS#15 emulation but no matching card app
2015-09-25 11:43:01 +02:00
Frank Morgner
7120a9b549
Merge pull request #554 from frankmorgner/fixes
...
Some more fixes for problems reported by Coverity scan
2015-09-25 11:13:17 +02:00
Frank Morgner
30c90448fb
Adds missing Advapi32.lib to opensc_a.lib
2015-09-25 10:58:53 +02:00
Andreas Schwier
d8d47bb06f
sc-hsm: Bind PIN object to applet aid to ensure SELECT before PIN verification
2015-09-23 15:38:57 +02:00
Andreas Schwier
c41153aa13
pkcs15: Select application defined by path.aid for PIN verification
2015-09-23 15:36:56 +02:00
Frank Morgner
e14e028453
Properly describe OpenSSL dependencies in .mak files
2015-09-23 08:23:28 +02:00
Frank Morgner
ffd85adae7
Decouples SM from OpenSSL
2015-09-24 14:46:30 +02:00
Frank Morgner
4814863d18
Merge pull request #551 from frankmorgner/507
...
Fix OpenPGP driver to work correctly with YubiKey NEO
2015-09-21 13:23:18 +02:00
Philip Wendland
328176d28b
ECDSA helper functions: strip zeroes when converting from R,S to sequence
...
For ECDSA signatures, there are multiple ways to format the signature:
- R|S (R and S filled with zeroes at the most significant bytes)
- ASN1 sequence of R,S integers (e.g. used by OpenSSL).
It is rare that the filling with zeroes is needed.
But if it is, in the second case, the filling zeroes should not be there
or the verification of the signature by OpenSSL will fail.
2015-09-20 22:34:39 +02:00
Philip Wendland
09fb1e71a9
IsoApplet: add PIN to pincache upon creation
2015-09-18 17:02:45 +02:00
Philip Wendland
6bffeb7a36
IsoApplet: fix dead code
2015-09-18 17:02:45 +02:00
Doug Engert
24a3999386
Fix indentation for readability
2015-09-17 19:03:44 -05:00
Frank Morgner
c399bc94ec
piv-tool: fixed resource leak
2015-09-17 22:32:07 +02:00
Frank Morgner
2dca6ced06
pkcs15-oberthur: fixed resource leak
2015-09-17 22:32:07 +02:00
Frank Morgner
4e280b4741
pkcs15-lib: fixed resource leak
2015-09-17 22:32:07 +02:00
Frank Morgner
5854aff155
pkcs15-epass2003: fixed resource leak
2015-09-17 22:32:06 +02:00
Frank Morgner
4fd359406e
iasecc-sdo: fixed resource leak
2015-09-17 22:32:06 +02:00
Frank Morgner
1308fd0618
cwa14890: fixed resource leak
2015-09-17 22:32:06 +02:00
Frank Morgner
7fe4819a02
card-tcos: fixed resource leak
2015-09-17 22:32:06 +02:00
Frank Morgner
1e2a42dae5
Fixes warning about unused variables
2015-09-17 22:24:33 +02:00
Frank Morgner
fe31aceacb
Fixes signature of iasecc_read_public_key
2015-09-17 22:24:33 +02:00
Frank Morgner
be073396be
Fixes warnings about unused variables/functions
2015-09-17 22:24:33 +02:00
Frank Morgner
0fe282414f
Fixed warning about unused function
2015-09-17 22:24:33 +02:00
Frank Morgner
5902587889
Removed dead code
2015-09-17 22:24:33 +02:00
Frank Morgner
c22ffd95bf
Fixed warning about unused variable
2015-09-17 22:24:33 +02:00
Frank Morgner
6c01750ba8
Removes dead code
2015-09-17 22:24:33 +02:00
Frank Morgner
e4bce1ca61
Fixes dependency on uninitialized data
2015-09-17 22:24:33 +02:00
Frank Morgner
07038225a7
Fixes out of bounds read
2015-09-17 22:24:33 +02:00
Frank Morgner
69320f9d54
Checks for out of bounds write
2015-09-17 22:24:33 +02:00
Frank Morgner
f08985086a
Fixes potential buffer overrun
2015-09-17 22:24:33 +02:00
Frank Morgner
69de207c21
Fixes bad type cast
2015-09-17 22:24:33 +02:00
Frank Morgner
59254d9d88
Checks on errors for ftell and fseek
2015-09-17 22:24:33 +02:00
Frank Morgner
b5de72fe13
fix potention NULL deref
2015-09-17 22:24:33 +02:00
Frank Morgner
63a9ad79b6
Assumes that p15card->card are set
...
The check for NULL was bogus anyway
2015-09-17 22:24:33 +02:00
Frank Morgner
8a225eb42b
Avoids potential NULL pointer deref
2015-09-17 22:24:33 +02:00
Frank Morgner
30d4f52718
Checks untrusted input
2015-09-17 22:24:33 +02:00
Frank Morgner
ba3890f8e0
Checks result of calloc
2015-09-17 22:24:33 +02:00
Frank Morgner
de58f51012
msc: check the length of input
2015-09-17 22:24:33 +02:00
Frank Morgner
d20290d2b3
openpgp: match application, not ATR
...
fixes #391
closes #507
2015-09-16 09:48:23 +02:00
Robert Ou
b28c48afe0
Fix OpenPGP driver to work correctly with YubiKey NEO
2015-09-16 09:48:23 +02:00
Frank Morgner
8aba7b9598
added missing files to WiX installer
...
fixes https://github.com/OpenSC/OpenSC/issues/488
2015-09-16 04:18:12 +02:00
Frank Morgner
cc6d7677da
Merge pull request #550 from frankmorgner/appveyor
...
adjust Make.rules.mak to work with AppVeyor
2015-09-14 18:35:54 +02:00
Frank Morgner
bf654540c5
Merge pull request #545 from frankmorgner/duplicate
...
avoid registering pkcs11 mechanisms multiple times
2015-09-14 12:41:37 +02:00
Frank Morgner
fb9dfc5b71
fixed warnings about possible data loss
2015-09-14 10:52:31 +02:00
Nguyễn Hồng Quân
76b6b483c7
Merge branch 'master' into gnuk
2015-09-13 22:09:59 +08:00
Frank Morgner
a906c6d7b8
Merge pull request #530 from NWilson/yubikey-neo-pin
...
Yubikey NEO pin functions support
2015-09-12 18:51:10 +02:00
Frank Morgner
5944915e0e
Merge pull request #549 from frankmorgner/547
...
fixed bad string comparison
2015-09-11 12:47:04 +02:00
Frank Morgner
0f2b9a4a4e
Merge pull request #543 from frankmorgner/appveyor
...
Use AppVeyor as good as we can
2015-09-10 16:40:58 +02:00
Frank Morgner
819a6686c9
use _WIN32 instead of WIN32
2015-09-10 15:23:18 +02:00
Frank Morgner
17c0ffc17e
Merge pull request #520 from frankmorgner/vendor-product
...
added call back for getting vendor/product id
2015-09-10 09:41:07 +02:00
Frank Morgner
6e3f94b3c9
fixed bad string comparison
...
fixes #547
2015-09-10 08:31:30 +02:00
Frank Morgner
d551f9a8e0
avoid registering pkcs11 mechanisms multiple times
...
fixes #349
2015-09-07 09:53:02 +02:00
Frank Morgner
b0c1e1fc89
Merge pull request #540 from nioncode/readDataObjectRawOption
...
add '--raw' option to pkcs15-tools '--read-data-object'
2015-09-04 15:31:16 +02:00
Nicolas Schneider
f44e229865
update help message to clarify that --raw only affects stdout behavior
2015-09-04 13:04:24 +02:00
Andreas Schwier
72e25db360
sc-hsm: Add status info support for SmartCard-HSM V2.0
2015-09-03 21:49:24 +02:00
Nicolas Schneider
68796edf36
add '--raw' option to output 8 bit data instead of its hex representation
2015-09-03 15:09:23 +02:00
Frank Morgner
b2508b6c59
removed workaround for HP USB Smart Card Keyboard
...
Has been fixed by the CCID driver
https://lists.alioth.debian.org/pipermail/pcsclite-cvs-commit/2011-March/005218.html
2015-09-02 10:49:12 +02:00
Frank Morgner
cf2a9cbbb0
added call back for getting vendor/product id
...
implementation taken from
83142d4cae
2015-09-02 10:47:29 +02:00
Frank Morgner
29b85b43c0
Merge pull request #483 from adminmt/master
...
Update ATR and ATR mask for MaskTech smartcards
2015-09-02 10:41:06 +02:00
Andreas Kemnade
9456db90fc
handle record-based files correctly when doing file caching
...
implementation copied from `sc_pkcs15_read_file`
closes #372
2015-09-02 10:35:18 +02:00
Andreas Kemnade
c9efb2f643
make file cache dir configurable
...
in cases where you use pam_pkcs11, HOME might not be set
so paths based on $HOME are not usable, so that the combination
of home and caching does not work. Having the paths configurable
(together with a good setting of access rights)
resolves that problem.
2015-09-02 10:34:35 +02:00
Nguyễn Hồng Quân
a64bbc55aa
[OpenPGP] Fix building without OpenSSL.
2015-08-31 22:24:16 +08:00
Nguyễn Hồng Quân
70890a8f61
Merge branch 'master' into gnuk
...
Conflicts:
src/libopensc/card-openpgp.c
src/tools/openpgp-tool.c
2015-08-31 21:55:14 +08:00
Frank Morgner
3f43bc46ef
Merge pull request #534 from frankmorgner/card-sizes
...
reactivate handling of `0` for max_recv/send_size
2015-08-31 13:31:19 +02:00
Martin Paljak
8da31d271e
Fix for #183 : export more symbols
...
- also export C_Initialize and C_Finalize to please vmware-view
- have a single pkcs11.exports file for both pkcs11-spy and opensc-pkcs11
2015-08-30 18:58:00 +03:00
Frank Morgner
fc02cb1093
added documentation for sc_get_max_recv/send_size
2015-08-26 22:02:35 +02:00
Frank Morgner
2d9802308f
reactivate handling of `0` for max_recv/send_size
...
The special value still needs to be handled for commands that are issued
during card initialization. This especially concerns T=0 cards that need
to use iso_get_response.
fixes #533
regression of 85b79a3332
2015-08-26 02:55:35 +02:00
Nicholas Wilson
2897e6fb5c
Leniently interpret the ISO7816 return codes in card-piv.c
...
This adds support for the Yubikey NEO. I'm not sure whether it breaks
the specification, or follows some other version of the spec, but in my
testing it returns SW1=0x63, SW2=0x0N for N PIN tries remaining.
Ignoring the top nibble seems a harmless change to the behaviour to
support this device.
2015-08-25 15:53:32 +01:00
Nicholas Wilson
5a11d0e2fd
Add support for C_GetTokenInfo pin status flags for ISO7816 cards
...
This is already supported for a couple of the card drivers, but
since it's a general feature of ISO7816 it should go in iso7816.c,
rather than the current situation where identical code for this is
copy and pasted in each driver.
However, some cards apparently don't support this feature and count
it as a failed PIN attempt, so I've added a flag for now to indicate
whether the card supports this feature. It future, it could be moved
to blacklist cards rather than whitelist them, subject to more testing.
2015-08-25 15:53:27 +01:00
adminmt
56c376489f
ATR update card-masktech.c, customactions.cpp
...
changed atqb + mask of MaskTech smart card (a) and (c)
removed MaskTech smart card (d)
added atr mask to MaskTech smart card (a) and (b)
2015-08-24 12:51:54 +02:00
Nicholas Wilson
4df35b922c
pkcs11: Fix to CKA_PRIVATE handling pcks11-tool
...
There's a copy-and-paste bug in there, where the CKA_PRIVATE attribute
is being set on the wrong variables! As well as fixing that, we should
explicitly set CKA_PRIVATE to "false" for certificates and public keys,
since the PKCS#11 spec doesn't specify a default and some drivers use
"private" as the default, making it impossible to add a public key/cert
using pkcs11-tool.
2015-08-23 12:41:38 +02:00
Viktor Tarasov
ff2d88a724
libopensc: uncomplete changes in c48afdbf
breaks windows builds
2015-08-16 20:18:29 +02:00
Martin Paljak
9cae888dd8
Merge pull request #522 from HenryJacques/login_pin_fix
...
really set the --login option when using --pin
2015-08-12 16:49:17 +03:00
Frank Morgner
2e21163273
cardos: probe for transceive length
2015-08-11 23:08:41 +02:00
Frank Morgner
85b79a3332
don't always overwrite max_send_size/max_recv_size
...
If the reader announces extended length support, but the card driver
leaves max_send_size/max_recv_size at `0`, max_send_size/max_recv_size
previously would have been overwritten with the reader's size though the
card might not have set SC_CARD_CAP_APDU_EXT. This commit fixes this
behavior.
Additionally card->max_send_size/max_recv_size is always initialized to
a value different from 0 after the card initialization. This removes the
need to check for this special value in all subsequent calls.
2015-08-11 23:08:41 +02:00
HenryJacques
c14be48ed9
really set the --login option when using --pin
...
Until now, if -p was used without -l, we didn't authenticate to the token (see man pkcs11-tool)
2015-08-11 18:03:31 +02:00
Nguyễn Hồng Quân
6409202c2f
[OpenPGP] Fix warnings about type conversion.
2015-08-08 14:17:12 +08:00
Andreas Schwier
d6774aae40
Fixed wrong APDU case declaration detected after PR #500
2015-08-04 17:51:46 +02:00
Frank Morgner
5e352ea477
Merge pull request #504 from frankmorgner/find_tags
...
Find tags with GET DATA
2015-08-04 10:32:23 +02:00
Frank Morgner
d7d64ee8d4
Merge pull request #494 from frankmorgner/fork
...
After a fork do not release resources shared with parent
2015-08-04 10:32:01 +02:00
Frank Morgner
e95707362f
Merge pull request #357 from fancycode/startcos34_dtrust
...
Added initial support for STARCOS 3.4 (German D-Trust cards).
2015-07-31 15:40:30 +02:00
Frank Morgner
c48afdbfcb
Merge pull request #500 from frankmorgner/reader_max_data_size
...
honour PC/SC pt 10 dwMaxAPDUDataSize
2015-07-31 15:35:32 +02:00
Frank Morgner
6bedd70ea3
Merge pull request #499 from frankmorgner/asn1
...
asn1: fixed parsing "end of content"
2015-07-31 15:35:19 +02:00
Frank Morgner
d7496cc3b4
Merge pull request #498 from frankmorgner/pkcs11
...
fixed segfault for uninitialized IsoApplet
2015-07-31 15:35:08 +02:00
Frank Morgner
24d91acf69
opensc-explorer: added command find_tags
2015-07-30 11:29:14 +02:00
Martin Paljak
c6c8c6cdb0
Fix dead code:
...
../../src/libopensc/errors.h:73:37: warning: statement with no effect [-Wunused-value]
#define SC_ERROR_INVALID_ARGUMENTS -1300
^
card-masktech.c:181:48: note: in expansion of macro 'SC_ERROR_INVALID_ARGUMENTS'
if (crgram_len > SC_MAX_EXT_APDU_BUFFER_SIZE) SC_ERROR_INVALID_ARGUMENTS;
2015-07-30 10:12:04 +03:00
Frank Morgner
f71ef838e9
implemented get_data for iso7816
...
mostly copied over from CardOS implementation
2015-07-30 08:18:07 +02:00
Frank Morgner
c92e3b4f98
honour PC/SC pt 10 dwMaxAPDUDataSize
...
closes #306
2015-07-28 09:49:44 +02:00
Frank Morgner
b44c98e4d8
asn1: fixed parsing "end of content"
...
fixes #190
2015-07-28 09:10:54 +02:00
Frank Morgner
b3dc5ea32a
fixed segfault for uninitialized IsoApplet
...
fixes #400
2015-07-27 18:43:51 +02:00
Frank Morgner
6cfd71c387
avoid double detecting card on uninitialized reader
...
initialize_reader already calls detect_card
2015-07-27 16:15:33 +02:00
Andreas Jellinghaus
9fed9591ca
Fix regression test crypt0007: it deals with 1024 bit keys (not 1048).
...
Signed-off-by: Andreas Jellinghaus <andreas@ionisiert.de>
2015-07-26 21:35:29 +02:00
Andreas Jellinghaus
4dfbf24a3e
Fix regression test suite: rename parameters to new names.
...
Signed-off-by: Andreas Jellinghaus <andreas@ionisiert.de>
2015-07-26 21:34:51 +02:00
Frank Morgner
28de49b34c
Merge pull request #448 from sschutte/patch-1
...
Create minidriver-italian-cns.reg
2015-07-23 13:11:39 +02:00
Frank Morgner
ee68165b1d
Merge pull request #474 from germanblanco/memory_allocation_5
...
Fixing part of the memory allocation problems in DNIe module. Issue #472
2015-07-23 13:10:14 +02:00
Frank Morgner
142323af10
Merge pull request #476 from germanblanco/dnie_ui_depends_on_ssl
...
Empty user-interface.c if there is no SSL support. Related with issue #362
2015-07-23 13:08:46 +02:00
Frank Morgner
7cec500e54
added flags to sc_context_t
...
- is initialized in sc_context_create with parm->flags
- removes members paranoid_memory and enable_default_driver
2015-07-22 17:30:21 +02:00
Frank Morgner
edc839e072
restrict access to card handles after fork
...
fixes #333
closes #493
2015-07-22 16:46:04 +02:00
German Blanco
317cc302db
making the size of e_tx in cwa-dnie.c dynamic
2015-07-10 12:38:22 +02:00
Nguyễn Hồng Quân
d0e3d1be3d
Fix tab & spaces
2015-07-04 00:21:38 +08:00
Hubitronic
5898eab373
Update card-muscle.c
...
re-enable opensc.conf flexibility again
2015-06-18 16:28:11 +02:00
German Blanco
030f4d1559
Empty user-interface.c if there is no SSL support.
2015-06-01 08:21:25 +02:00
German Blanco
0d14f3ffee
Correct initializing of a variable in card-dnie and revert buffer size change in cwa-dnie.
2015-06-01 07:46:59 +02:00
German Blanco
76517b7d43
Fixing part of the memory allocation problems in DNIe module.
2015-05-26 21:44:13 +02:00
Doug Engert
b48fa70308
sc_pkcs11_card improvements
...
This is name change only fix.
The variable name "card" was being used to refer to a struct sc_card or a struct sc_pkcs11_card
in some files including sc_pkcs11.h. In other files the variable name "p11card" is used for struct sc_pkcs11_card.
This creates hard to read code, such as: slot->card->card.
All definitations of sc_pkcs11_card *card now use p11card as the variable name.
Fix #471
2015-05-24 11:41:29 +02:00
David Woodhouse
8c94662e96
Add --test-fork option to pkcs11-tool
...
The PKCS#11 Usage Guide, at least up to v2.40, says that calling
C_Initialize() in the child after fork is "considered to be good
Cryptoki programming practice, since it can prevent the existence of
dangling duplicate resources that were created at the time of the fork()
call."
(It neglects to mention that doing so in the child of a multi-threaded
process is a clear violation of POSIX, mind you. Not to mention being
utterly pointless if all you're going to do in the child is exec something
else anyway.)
Regardless of the sagacity of this recommendation, we need to cope when
it happens. Historically, we've been quite bad at that. Let's add a test
to pkcs11-tool in the hope it'll help...
Fixes #464
2015-05-16 12:18:54 +02:00
vletoux
01b395e636
card-masktech.c: add 2 more ATR
...
Fixes #465
2015-05-16 12:09:08 +02:00
drew thomas
5be35fb3f4
muscle: change TyfoneAT historical bytes to 'Tyfone 242R2'
...
Fixes #467
2015-05-16 11:59:58 +02:00
Andreas Kemnade
a09ca246a7
libopensc: initialize value returned by sc_select_file
...
several places in the code expect sc_select_file to set *file_out to NULL
in case of failure. Adjust the function to behave like this.
Fixes #460
2015-05-13 10:19:38 +02:00
Andreas Kemnade
6a6ef61d1a
some more error checks in minidriver in regards to card ejects
2015-05-13 10:11:05 +02:00
vletoux
492ffe0fd7
iso7816.c: allow file length stored in more than 2 bytes
...
as indicated in iso7816-4 chapter 7.4.3 table 10
Fixes #459
2015-05-13 10:01:29 +02:00
drew thomas
8b62221abc
muscle: add ATR of Tyfone mSD card
...
Add Tyfone Connected Smart Card ATR to list for MUSCLE support.
SC_CARD_TYPE_MUSCLE_JCOP242_NO_APDU_EXT
Fixes #463
2015-05-13 09:50:21 +02:00
Doug Engert
c7af08c68a
PIV - read just length of object to get size
...
card-piv.c tries to read the first 8 bytes of an object to get object size
so it can allocate a buffer. It then reads the whole object. apdu.c has changed
over the years, and apdu.c will keep reading as long as the card returns
status of 61 XX thus apdu.c will read the whole object while discarding
the extra data and returning to the caller only the first part of the data.
This in effect causes a double read of objects.
This patch sets SC_APDU_FLAGS_NO_GET_RESP to tell apdu to stop doing the
extra get-response commands thus avoiding most of the extra overhead.
This in not an optimal patch as it only works with T=1 cards/readers
but the patch is confined to just card-piv.c.
A better patch is in the works.
Fixes #462
2015-05-13 09:24:46 +02:00
Viktor Tarasov
72b5d8fe9a
md: use 'store-or-update' store certificate mode
2015-05-10 15:04:44 +02:00
vletoux
8ec000e80d
minidriver: change the icon of the pinpad dialog
2015-05-10 15:04:44 +02:00
vletoux
ac82a96ccc
minidriver: add my name in the author list
...
setup: change the url to match the new one
2015-05-10 15:04:44 +02:00
vletoux
aede9b164b
minidriver: fix compilation warnings on x64 (size_t <> DWORD)
2015-05-10 15:04:44 +02:00
vletoux
33cf161941
minidriver: pinpad authentication is now working for smart card logon !!! (still needs 5 pinpad entries)
...
minidriver: minor fixes
2015-05-10 15:04:41 +02:00
vletoux
6127fe6b77
minidriver: change the UI (remplace a messagebox by a nice dialog) ; add a translation function for errors
2015-05-10 15:04:41 +02:00
vletoux
7d225e28f7
minidriver: add support for the special msroot file which contains the root certificates stored on the card.
2015-05-10 15:04:41 +02:00
vletoux
6b58b1db01
minidriver: merge CardUnblockPin and CardChangeAuthenticator into CardChangeAuthenticatorEx
2015-05-10 15:04:41 +02:00
vletoux
a671cf8fe2
CardAuthenticateEx: test for remaining attempts before ...
2015-05-10 15:04:41 +02:00
vletoux
659da4f538
minidriver: CardSignData - better parameter checking
2015-05-10 15:04:41 +02:00
vletoux
f3c9525137
fix attempt remaining regression if the card is blocked
2015-05-10 15:04:40 +02:00
vletoux
d96e53b102
minidriver: better error code if CARD_PIN_SILENT_CONTEXT is set
2015-05-10 15:04:40 +02:00
vletoux
ad47d4d043
minidriver:
...
* factorize the code from CardAuthenticatePIN into CardAuthenticateEx
* allows authentication with the PINPAD without a UI
minidriver: fix some code analysis warnings
2015-05-10 15:04:36 +02:00
vletoux
8062eac145
minidriver: fix CardQueryCapabilities and CardGetProperty fKeyGen flag. A read only card cannot generate keys
2015-05-10 15:04:36 +02:00
vletoux
f331b35c4e
minidriver: make the parameter check be aware of pinpad capabilities
2015-05-10 15:04:36 +02:00
vletoux
a5593afc78
minidriver: better parameter checking with CardQueryKeySizes and CardGetContainerProperty
2015-05-10 15:04:36 +02:00
vletoux
1e78e16e65
fix memory leak in minidriver: the virtual filesystem is never freed and in some case when an error occurs
2015-05-10 15:04:35 +02:00
vletoux
8036388f29
minidriver PINPAD: fix a regression issue (the parameter - message - can be set to null)
...
Improve the error code when the user cancel the operation ("The operation was canceled by the user" instead of "invalid parameter")
Signed-off-by: vletoux <vincent.letoux@gmail.com>
2015-05-10 15:04:35 +02:00
vletoux
cb38657d47
CardSignData: add support for missing hash algorithm
2015-05-10 15:04:35 +02:00
vletoux
c5efcae029
CardRSADecrypt: better parameter checking
...
CardRSADecrypt & CardSignData: better OpenSC -> minidriver error code translation
2015-05-10 15:04:28 +02:00
vletoux
9544844d83
CardSignData: better error message if the card do not support the signing operation with the algorithm
...
(replace the return code from internal error to unsupported)
2015-05-10 14:35:42 +02:00
vletoux
54f462368b
Fix CardSignData "invalid signature" bug when called from CryptSignHash(CRYPT_NOHASHOID)
2015-05-10 14:35:42 +02:00
vletoux
6aaf9d462c
fix a problem: CardDeauthenticate(ex) do nothing, but the base CSP think that the user is deauthenticate from the card.
...
The user is still authenticated !
2015-05-10 14:35:41 +02:00
vletoux
b7f000d6b8
add parameter checking for CardSignData
2015-05-10 14:35:41 +02:00
vletoux
2667394f22
better parameter checks for CardGetProperty and CardSetProperty
...
Added value for secure key injection (to reject it properly because it is not implemented)
2015-05-10 14:35:41 +02:00
vletoux
6a2e9aa3b6
Merge branch 'upstream/master'
...
Conflicts:
src/libopensc/card-openpgp.c
src/libopensc/pkcs15-gemsafeV1.c
src/pkcs11/mechanism.c
2015-05-10 14:35:41 +02:00
Viktor Tarasov
e0aec3764a
pkcs15init: 'store-or-update' certificate option
2015-05-10 14:35:41 +02:00
Viktor Tarasov
3cf56d8fb7
pkcs15init: fix non-unique-ID control
2015-05-10 14:35:41 +02:00
vletoux
f154cdcaa4
pkcs15-pin: sc_pkcs15_unblock_pin: avoid to ask the PUK twice
2015-05-08 22:37:04 +02:00
Viktor Tarasov
3e0356b170
register CKM_ECDSA and CKM_ECDSA_SHA1 depending on card capabilities
...
fix #429
2015-05-08 20:45:56 +02:00
Philip Wendland
254320e34c
myeid: seperate ECC from RSA flags
...
Should keep the existing behavior, but improve readability.
2015-05-08 20:45:37 +02:00
Philip Wendland
4142456c74
PIV, sc-hsm, myeid: register ECDH card capabilites
...
Prior to 066132327c71300188aa66180fde2fb3d90c5140, CKM_ECDH1_DERIVE and
CKM_ECDH1_COFACTOR_DERIVE were always registered for cards that support
SC_ALGORITHM_ECDSA_RAW.
The mentioned commit changed this behavior, so that the ECDH mechanisms
are only registered for cards that set the SC_ALGORITHM_ECDH_CDH_RAW
capability flag.
To keep the existing behavior for the cards, they need to set this flag
in the card driver.
2015-05-08 20:45:37 +02:00
Philip Wendland
78e434da93
register EC mechanisms with flags independent of RSA flags
...
Prior to this commit, all hashes registered for RSA or other key types were
registered for ECDSA as well.
register ECDH mechanism only when supported by card
ECDH should only be registered if the card driver sets the
SC_ALGORITHM_ECDH_CDH_RAW flag.
register software PKCS#1 (1.5) padding only when RAW RSA is supported by card
If OpenSC supports PSS/OAEP padding or other padding mechanisms in
future, and there would be a card that enforces hardware PSS/OAEP
padding, the PKCS#1 v1.5 padding mechanism should not be registered.
2015-05-08 20:45:27 +02:00
Philip Wendland
37b6f0bbdf
IsoApplet: fix EC mechanism ext_flag
2015-05-08 20:19:36 +02:00
Hector Sanjuan
fd3d07a884
Issue #451 : Newer DNIe not working with OpenSC.
...
This patch fixes 3 issues which consecutively have shown up when debugging the original problem:
1 - Newer DNIe report a byte count for public certificates which is the compressed size,
while older DNIe report the uncompressed size. This resulted in short-reading the x509 certificates,
and in an error parsing. Therefore, during initialization we proceed to set path->count for
public certificates to -1. This ensures that the lenght of the certificates for reading
will be set to file-> length, which has the correct size.
2 - pkcs11-tool -t was broken for DNIe (old and new)as it tried to strip pcks11 padding
from the data to sign and OpenSC tried signatures with non-padded data
(as the card had SC_ALGORITHM_RSA_RAW).
The new algoflags (SC_ALGORITHM_RSA_HASH_NONE | SC_ALGORITHM_RSA_PAD_PKCS1) and the
removal of the strip-padding call fix the issue.
3 - The new cards won't allow setting the LE bytes when calculating the TLV, when LE equals
256. This caused an wrong SM object error response (0x69 0x88). Therefore,
we don't send the LE bytes anymore in this case.
The patch has been tested to work on the new problematic card and on another old one.
close #451
2015-05-08 09:17:01 +02:00
Frank Morgner
ef4edb74ba
fixed invalid free
...
We duplicate mechanisms based on OpenSSL so that they can be freed along
all the card's algorithms created via sc_pkcs11_new_fw_mechanism. Fixes
regression from eaf548aa3dab80a9bbf51da8291e7db978e3a2ad
2015-05-08 09:11:55 +02:00
Frank Morgner
e338b7c1ab
framework-pkcs15: fixed memory leak when encoding pubkey
2015-05-08 09:11:55 +02:00
Frank Morgner
e84951a5bf
fix resource leaks in while registering PKCS#11 mechanisms
...
introduces a free_mech_data for sc_pkcs11_mechanism_type_t to clear the
mechanisms private memory
2015-05-08 09:11:55 +02:00
Frank Morgner
2c32575e89
pkcs11-tool: fixed resource leak
2015-05-08 09:11:55 +02:00
Frank Morgner
ecc9b9dac9
openssl: fixed resource leak
2015-05-08 09:11:55 +02:00
Frank Morgner
8838388ceb
pkcs15-infocamere: fixed resource leak
2015-05-08 09:11:55 +02:00
Frank Morgner
bbb803ff2e
sc-hsm-tool: fixed resource leak
2015-05-08 09:11:54 +02:00
Frank Morgner
d96f25c147
pkcs15-tool: fixed resource leak
2015-05-08 09:11:54 +02:00
Frank Morgner
1f16f24052
pkcs15-init: fixed resource leak
2015-05-08 09:11:54 +02:00
Frank Morgner
a83da8a947
pkcs15-crypt: fixed resource leak
2015-05-08 09:11:54 +02:00
Frank Morgner
c65caed7f4
openpgp-tool: fixed resource leak
...
VTA: slightly touched, original commit f0ddbf4
2015-05-08 09:11:54 +02:00
Frank Morgner
b0a708b0bb
pintest: fixed resource leak
2015-05-08 09:11:54 +02:00
Frank Morgner
efbd4068af
sm-cwa14890: fixed resource leak
2015-05-08 09:11:54 +02:00
Frank Morgner
01e573b987
profile: fixed resource leak
2015-05-08 09:11:54 +02:00
Frank Morgner
6cb99be821
pkcs15-setcos: fixed resource leak
2015-05-08 09:11:54 +02:00
Frank Morgner
44253c63d0
pkcs15-rtecp: fixed resource leak
2015-05-08 09:11:54 +02:00
Viktor Tarasov
d636338eaf
pkcs15-oberthur: fix memory leakage
2015-05-08 09:11:54 +02:00
Viktor Tarasov
ac84d282b1
myeid: fixed resource leak
...
pkcs15-myeid: fix memory leakage
myeid: fix memory leakage
2015-05-08 09:11:40 +02:00
Viktor Tarasov
475ce71453
iasecc: fixed resource leak
...
pkcs15-iasecc: fix memory leakage
iasecc: fix memory leakage
2015-05-08 09:11:20 +02:00
Frank Morgner
68becc8fc4
pkcs15-gpk: fixed resource leak
2015-05-08 09:11:19 +02:00
Frank Morgner
d4fd135e20
pkcs15-cflex: fixed resource leak
2015-05-08 09:11:19 +02:00
Frank Morgner
4af4308d19
authentic: fixed resource leak
...
pkcs15-authentic: fixed resource leak
card-authentic: fixed resource leak
2015-05-08 09:10:48 +02:00
Frank Morgner
e215b7b4fb
sm-common: fixed resource leak
2015-05-08 09:10:48 +02:00
Frank Morgner
3cfb44d704
pkcs15-syn: fixed resource leak
2015-05-08 09:10:48 +02:00
Frank Morgner
841d89dda6
pkcs15-pubkey: fixed resource leak
2015-05-08 09:10:47 +02:00
Viktor Tarasov
18e962942b
pkcs15-data: fix memory leakage
2015-05-08 09:10:47 +02:00
Frank Morgner
3a6c4a0e1d
pkcs15-cache: fixed resource leak
2015-05-08 09:10:47 +02:00
Frank Morgner
9263da49aa
pkcs15: fixed resource leak
2015-05-08 09:10:47 +02:00
Frank Morgner
c7afbb4ca2
pkcs15-algo: fixed resource leak
2015-05-08 09:10:47 +02:00
Frank Morgner
1f69a0d687
fixed indenting
2015-05-08 09:08:24 +02:00
Frank Morgner
6523f3fcb9
added LOG_TEST_GOTO_ERR and SC_TEST_GOTO_ERR
...
Don't forget to set the error label!
2015-05-08 09:08:24 +02:00
vletoux
689ece205a
card-masktech.c: code improvements
...
fixes #457
2015-05-08 09:07:40 +02:00
vletoux
976db5cb04
card-masktech: initial commit
...
card-masktech.c: fix building issues on the integration platform
card-masktech.c: fix linux compilation errors
honour HAVE_CONFIG_H
card-masktech.c: take in account Frank's remark about extended APDU in masktech_decipher
remove trailing spaces
2015-05-05 10:13:26 +02:00
vletoux
1586f240f4
iso7816.c: fix SC_PIN_CMD_IMPLICIT_CHANGE with pinpad
...
When a pinpad is used, the old pin is asked whatever, even if a previous authentication happenened or if the card doesn't support it.
2015-05-05 09:56:39 +02:00
Andreas Schwier
ed588d2443
pkcs11: fixed broken C_Decrypt
...
Fixed broken C_Decrypt from 643080baf9
fix #449
2015-04-30 15:57:44 +02:00
Viktor Tarasov
f0189e8378
pkcs11-tool: option to 'decrypt some data'
2015-04-30 15:57:44 +02:00
Andreas Schwier
0dba2d453f
sc-hsm: fix signed char for ARM platforms
...
char is unsigned by default on ARM
fix #450
2015-04-30 12:03:01 +02:00
viktorTarasov
c754e3f197
Merge pull request #444 from frankmorgner/pkcs11-error-handling
...
Improved error handling for PKCS#11 module
2015-04-25 13:04:07 +02:00
Thomas Calderon
0a754b694e
pkcs11-tool: pass key usage flags to created objs
...
* Command-line parameters were introduced to specify key usage
(--usage-{sign,decrypt,derive}). However, those are not used when importing
external objects using C_CreateObject function.
fix #445
2015-04-25 12:28:48 +02:00
Doug Engert
ee23d28654
EC field_length changes for non-multiple of 8 bits curves
...
In OpenSC the EC field_length is the number of bits in the field.
Most curves have a field_length which is a multiple of 8 bits
but there are many that are not.
The X and Y points and privateD are stored in octetstrings
so there may need to be an extra byte in the octetstring.
An OpenSSL BIGNUM will drop leading zero bytes, so its size can not be used
to determine the field_length.
fix #440
fix #433
2015-04-25 12:21:39 +02:00
Shaun Schutte
665807d6de
Rename minidriver-italian-cns to minidriver-italian-cns.reg
2015-04-24 09:45:20 +02:00
Shaun Schutte
e456074fd9
Create minidriver-italian-cns
...
These are the required registry values to get the Italian CNS card working under Windows 7 32 bit and 64 bit.
2015-04-23 16:54:11 +02:00
Frank Morgner
bcb5fc15e5
honour HAVE_CONFIG_H
2015-04-22 23:55:33 +02:00
Frank Morgner
9f318b829f
remove slots of removed readers
2015-04-21 02:00:06 +02:00