Commit Graph

16 Commits

Author SHA1 Message Date
Michał Trojnara 645780e6d4 NULL parameter check moved to sc_file_free()
This fixes numerous issues where the check is *not* performed,
and also simplifies the code.
2017-01-10 12:46:44 +01:00
ricky 42a9df3bd9 Avoid warning because no dnie_match_card 2017-01-08 17:13:13 +01:00
ricky 39f619fbb3 Disable dnie if not defined ENABLE_SM (issue #927) 2017-01-08 17:13:13 +01:00
ricky b97efe1374 cwa-dnie is empty if openssl not defined
closes #914
2016-12-18 12:21:58 +01:00
ricky 06292563bc dnie: force caching of pin if DNIe is version 3.0 2016-12-18 12:21:46 +01: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
Frank Morgner 0519de6c81 pkcs15-dnie: removed obsolete dll entry points 2016-02-16 07:49:19 +01:00
Frank Morgner a5685b537e fixed memory leak 2015-10-14 22:34:44 +02:00
German Blanco 76517b7d43 Fixing part of the memory allocation problems in DNIe module. 2015-05-26 21:44:13 +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 bcb5fc15e5 honour HAVE_CONFIG_H 2015-04-22 23:55:33 +02:00
Frank Morgner 3a92bf7af5 fixed resource leaks 2015-02-05 01:38:41 +01:00
Frank Morgner 6759c04b26 don't ignore errors 2015-01-28 04:45:08 +01:00
Ludovic Rousseau 09c2847b7e Fix compiler warning
pkcs15-dnie.c:242:13: warning: function declaration isn't a prototype [-Wstrict-prototypes]
 const char *sc_driver_version()
             ^
2014-10-01 22:11:38 +02:00
Ludovic Rousseau c8545baf90 pkcs15-dnie: fix compilation when OpenSSL is not used
If OpenSSL is not used then the functions from card-dnie.c are not
defined and in particular dnie_match_card() is not defined.
In that case we use a fake dnie_match_card() that just returns false.
2014-10-01 22:11:38 +02:00
German Blanco 63ce563d76 Adding support for DNIe. 2013-06-13 17:31:56 +02:00