Commit Graph

8093 Commits

Author SHA1 Message Date
Jakub Jelen ce659b2f7a test: Fix typo in comment 2020-05-07 02:34:12 +02:00
Jakub Jelen d1457e9fa3 coolkey: Drop dead code (CID 351911)
default branch of the switch calls continue, preventing
going out of the loop without obj_info set.
2020-05-07 02:32:46 +02:00
Jakub Jelen 295f399304 reader-pcsc: Avoid use after free (CID 355473) 2020-05-07 02:32:46 +02:00
Jakub Jelen 71998501f2 piv: Replace internal implementation of put_tag with asn1
The asn1 implementation is simpler and has more throughout error and
buffer overflow checking.

Fixes #1394
2020-05-07 02:32:46 +02:00
Jakub Jelen 4c4237f8a3 tests: Cover asn1_put_tag() 2020-05-07 02:32:46 +02:00
Jakub Jelen 508f8a9fce iso7816: Do not recurse if no data was returned
Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20399
2020-05-07 02:32:46 +02:00
Jakub Jelen 84ee2be122 framework-pkcs15: Copy pubkey to avoid double free 2020-05-07 02:32:46 +02:00
Jakub Jelen 75be610ea0 pkcs15: Clean memory if it was not transfered to framework-pkcs15 2020-05-07 02:32:46 +02:00
Jakub Jelen 127c8d911f pkcs15-pubkey: Avoid memory leaks when ec_params are already initialized from pkcs15-algo 2020-05-07 02:32:46 +02:00
Jakub Jelen b76e08504a piv: Fix indentation 2020-05-07 02:32:46 +02:00
Jakub Jelen ed06787b5e oberthur: Avoid memory leak when the auth_init is called multiple times
Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21678
2020-05-07 02:32:46 +02:00
Jakub Jelen be57a4bf0f configure: Do not overwrite passed CFLAGS 2020-05-07 02:32:46 +02:00
Frank Morgner 1202eceeef fixed wrong error 2020-04-29 15:16:31 +02:00
Frank Morgner 7936bdef15 resolve unused variable warning on newer gcc 2020-04-29 01:25:33 +02:00
Vladimir Panteleev bb47c1a5d0 pkcs11-tool: Fix mismatched --help text
The addition of --usage-wrap did not add a corresponding help string,
which caused all help text for the options below it to be shifted by one.
2020-04-23 14:54:46 +02:00
James Bromwell 0234e1bc14 Update ISSUE_TEMPLATE.md
Note that I took out the Markdown formatting for links, because Markdown inside of HTML comments never renders.
2020-04-23 14:54:03 +02:00
Frank Morgner 3124d9f6fb
Merge pull request #1821 from alex-nitrokey/ecc-fixes
openpgp: Fixes for importing ECC keys
2020-04-23 13:35:59 +02:00
Frank Morgner 843779fe6e opensc-notify: respect signal safety
Thanks, Marcin.
5e79a2a4ab (r38486829)
2020-04-23 08:45:24 +02:00
Frank Morgner 5e79a2a4ab fixed compiler warning 2020-04-09 16:29:44 +02:00
alex-nitrokey 27ea7cc6ac
Merge branch 'master' of https://github.com/OpenSC/OpenSC into ecc-fixes 2020-04-09 10:25:00 +02:00
Raul Metsma 78a7c11d0d Simplify build matrix
Signed-off-by: Raul Metsma <raul@metsma.ee>
2020-04-08 11:32:45 +02:00
Lars Silvén 8257e0186d The PKCS#11 specifies that the PIN parameter(s) in C_Login and C_SetPIN
always should be used, even if a PIN pad reader is used. PIN must only
be fetched from the PIN pad reader if the corresponding parameter is
null.
Before this commit PIN was always fetch from the reader if the PIN could
be fetched from the reader.
The 'pkcs11-tool has also been updated. Before parameters was never
taken from the command line if a PID pad reader was used. Now PINs from
the command line is always used but if not existing the PIN is fetched
from the reader if a reader with a PIN pad is used, otherwise the user
is prompted for PIN(s) from the CLI.
2020-04-08 09:54:07 +02:00
Lars Silvén a771450ab2 From the PKCS#11 specification chapter C_SetPIN:
C_SetPIN modifies the PIN of the user that is currently logged in, or
the CKU_USER PIN if the session is not logged in. ....

This was not true for "if the session is not logged in" before this fix.
2020-04-08 09:54:07 +02:00
Frank Morgner f9b31e50dd iso-sm: fixed too short response APDU data length
one byte off error in calculation of ASN.1 length
2020-04-08 02:13:24 +02:00
Frank Morgner 2c26b7392d opensc-notify: handle reader insertion/removal events
- If readers are attatched, the new reader is probed for a card to check
if a notification needs to be sent
- removal of readers are not notified to the user, we assume that PC/SC
sends the correct card removal event
- The list of readers to be monitored is adjusted once a reader (dis)appears
- On macOS, without PnP notification, we always check for new/removed
readers with SCardListReaders
- fixes interrupt handling in opensc-notify on Unix

fixes https://github.com/OpenSC/OpenSC/issues/1874
2020-04-06 18:08:34 +02:00
Jakub Jelen 7893d2860c idprime: Fix null-dereference
Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21586
2020-04-06 17:56:28 +02:00
Jakub Jelen 1ddef2cd15 iasecc: Avoid memory leak on error
Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21297
2020-04-06 17:56:28 +02:00
Raul Metsma 5eff42e39e Use nologo parameter to avoid warnings in appveyor log
Signed-off-by: Raul Metsma <raul@metsma.ee>
2020-04-03 09:55:34 +02:00
Marcin Cieślak 591ffad5dc Ignore test-driver and aminclude_static.am
Those files are generate by autotools
2020-04-03 09:52:51 +02:00
Marcin Cieślak 768bd1dde7 Check if we HAVE_ENDIAN_H
BSDs will have <sys/endian.h>, Linux just <endian.h>
2020-04-03 09:52:08 +02:00
alex-nitrokey 7ba89620bf
refactoring: get rid of oid_binary in ec_tables 2020-03-24 12:09:06 +01:00
alex-nitrokey 396aabcb7b
ykneo-openpgp does not support ecc keys yet 2020-03-24 12:07:29 +01:00
Frank Morgner 7840804762 fixed typo
fixes coverity's: "Argument cannot be negative (NEGATIVE_RETURNS)"
2020-03-21 16:47:43 +01:00
Frank Morgner d5ecafc334 fixed memory leak
fixes https://oss-fuzz.com/testcase-detail/5084702283399168
2020-03-20 17:12:18 +01:00
alex-nitrokey f4d28a18b9
Add pin to command 2020-03-19 15:21:55 +01:00
alex-nitrokey b2d082f4aa
Use curve that is supported by trusty OpenSSL package 2020-03-19 14:51:18 +01:00
alex-nitrokey 1e7e6e11a4
Add key import of ecc key to openpgp Travis tests 2020-03-19 13:33:12 +01:00
alex-nitrokey 0ba44cbec6
Add length checking 2020-03-19 13:31:31 +01:00
Alexander Paetzelt e45712bd29
Merge branch 'master' into ecc-fixes 2020-03-19 11:54:18 +01:00
Frank Morgner dc29b0fe18 fixed memory leak
fixes https://oss-fuzz.com/testcase-detail/6237284133502976
2020-03-12 23:07:17 +01:00
Jakub Jelen 6ed3939ae5 coolkey: Avoid memory leak
Fixup previous attempt to avoid too large allocations

Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21059
2020-03-11 12:19:43 +01:00
Frank Morgner b91cfa8cd7 reverted accidental change of default flags 2020-03-10 12:20:31 +01:00
Frank Morgner f1bcadfbe9 pkcs11: don't try to allocate 0 byte with calloc
fixes #1978
2020-03-10 12:15:04 +01:00
Peter Marschall d628022673 OpenPGP: add additional vendors
Taken from git.gnupg.org
2020-03-10 09:19:31 +01:00
Frank Morgner 501311c4e3 TravisCI: fixed OpenPACE build 2020-03-06 15:32:22 +01:00
Frank Morgner 267aea759c use platform dependant implementation of erasing memory
fixes potentially insecure use of memset in CWA SM implementation

fixes https://github.com/OpenSC/OpenSC/issues/1957
2020-03-06 12:23:16 +01:00
Frank Morgner d06f23e89b avoid debugging PIN commands
use a higher debug level to see it anyway
2020-03-05 22:17:09 +01:00
Frank Morgner 9681193ad5 fixed macro definition 2020-03-05 12:04:58 +01:00
Frank Morgner fe24707c00 win32: recognize WiX libs for VS2017/2019 2020-03-05 12:04:58 +01:00
Frank Morgner 2f5514a2d1 appveyor: build for VS 2017, too 2020-03-05 12:04:58 +01:00