Commit Graph

8626 Commits

Author SHA1 Message Date
giomba 932bd27549 libgcns: ArchLinux package 2022-01-08 20:37:35 +01:00
giomba b965e20bfd libgcns: C++ version 2022-01-06 21:12:55 +01:00
giomba 060d8ddb19 libgcns: first commit 2022-01-06 20:27:23 +01:00
giomba 5167b30043 gcns.c: refactoring 2022-01-06 18:04:42 +01:00
giomba 606edadb13 gcns.c: read Italian healthcare smart card 2022-01-06 17:29:06 +01:00
Jakub Jelen c902e19921 prepare 0.22.0 release 2021-08-10 11:09:03 +02:00
Vesa Jääskeläinen e97fec4d91 pkcs11-spy: Fix attribute displaying crash in case pTemplate=NULL
In real world pTemplate=NULL case is only used by PKCS#11 test suites but
no need to crash them.

Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
2021-08-10 08:54:08 +02:00
Vesa Jääskeläinen cababca4d5 pkcs11-spy: Fix C_OpenSession() crash with phSession=NULL argument
In real world phSession=NULL case is only used by PKCS#11 test suites but
no need to crash them.

Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
2021-08-10 08:54:08 +02:00
Vesa Jääskeläinen 63a5a493a6 pkcs11-spy: Match formatting for C_OpenSession()
Match spacing and add [in] to argument dumps.

Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
2021-08-10 08:54:08 +02:00
Vesa Jääskeläinen 1b344a4847 pkcs11-spy: Fix C_GetFunctionList() crash with NULL argument
In real world ppFunctionList=NULL case is only used by PKCS#11 test suites but
no need to crash them.

Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
2021-08-10 08:54:08 +02:00
Vesa Jääskeläinen 7007eda0ba pkcs11-spy: fix random crash in print_generic()
Depending on stack state print_generic() could cause crash or spurious garbage
in logs.

Example crash:

*** buffer overflow detected ***: pkcs11test terminated

Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
2021-08-10 08:53:13 +02:00
Vesa Jääskeläinen 1991fa24ae [merge] new output for pMechas
Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
2021-08-10 08:52:42 +02:00
Vesa Jääskeläinen 6431f69dcc pkcs11-spy: Fix crash for pMechanism=NULL
Some test suites are excercising pMechanism==NULL case and this causes
crash when using pkcs11-spy for logging in between.

Centralize logging for pMechanism and handle NULL case.

Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
2021-08-10 08:52:42 +02:00
Frank Morgner 7d315b5546
Merge pull request #2379 from dengert/Fix-new-line
log.c - fix newline - Fixes:#2378
2021-08-09 14:52:41 +02:00
Doug Engert 4c923c637c log.c - fix newline - Fixes:#2378
On branch Fix-new-line
 Changes to be committed:
	modified:   log.c
2021-08-06 13:53:49 -05:00
Jakub Jelen b67261ab27 Upload also tarball as a build artifact 2021-08-04 22:08:19 +02:00
Jakub Jelen 68b7efb591 github actions: Unbreak migw builds 2021-08-04 22:08:19 +02:00
Jakub Jelen 3048156db0 Execute push-artifacts on macos 2021-08-04 22:08:19 +02:00
Jakub Jelen 1e43a6a1af Make sure the dist creates tarball for pushing artifacts 2021-08-04 22:08:19 +02:00
Doug Engert c6a9b5699a PIV-improved parsing - fix two whilhspace nits
On branch PIV-improved-parsing
 Changes to be committed:
	modified:   card-piv.c
2021-08-04 08:58:06 +02:00
Doug Engert 445a6324de Remove unused code
two lines that are never executed are removed for the code.
The LOG_TEST_GOTO_ERR before these lines will goto err.

 On branch PIV-improved-parsing
 Changes to be committed:
	modified:   src/libopensc/card-piv.c
2021-08-04 08:58:06 +02:00
Doug Engert 456ac56693 PIV Improved parsing of data from the card
Based on Fuzz testing, many of the calls to sc_asn1_find_tag were replaced
with sc_asn1_read_tag. The input is also tested that the
expected tag is  the first byte. Additional tests are also add.

sc_asn1_find_tag will skip 0X00 or 0Xff if found. NIST sp800-73-x specs
do not allow these extra bytes.

 On branch PIV-improved-parsing
 Changes to be committed:
	modified:   card-piv.c
2021-08-04 08:58:06 +02:00
Jakub Jelen 8453c0d99a Skip openpgp test for now 2021-08-04 08:57:34 +02:00
Jakub Jelen d47f42b12a README: Update badges and links from travis 2021-08-04 08:57:34 +02:00
Jakub Jelen 01cf556ba2 github-actions: Unbreak artifacts pushing 2021-08-04 08:57:34 +02:00
Jakub Jelen f43d3f8042 Add Javacard tests and mingw build to Github Actions
* PIV applet
* Isoapplet
* Gids Applet
* openpgp applet
* Split clang-tidy to separate task as it is too slow
2021-08-03 12:00:49 +02:00
Jakub Jelen 5d338739ac CI: Avoid warnings from tput
As reported by Peter Popovec
2021-08-03 12:00:49 +02:00
Jakub Jelen e683c531f6 Migrate some tests to Github Actions
This ads also retention json files with results from p11test to
make sure we are not introducing regressions for existing cards.
2021-08-03 12:00:49 +02:00
Jakub Jelen 1b329093f7 Move the cifuzz to separate file 2021-08-03 12:00:49 +02:00
Jakub Jelen bc9b9df869 Do not use EVP_PKEY_get0() for EC_KEY handling
The function is intentionally broken in OpenSSL 3.0 for provided keys
and returning NULL. But it should still work for the legacy gost engine
implementation (but I do not have a good way to check).

Discussed in openssl upstream issue:

https://github.com/openssl/openssl/issues/16081
2021-08-02 10:05:59 +02:00
Frank Morgner 99656deaf4 avoid limited size when logging data 2021-07-15 10:04:23 +02:00
Jakub Jelen 9a5a008093 pkcs15-tool: Update the logic to make it more clear for some dumb static analyzers 2021-07-15 09:51:59 +02:00
Jakub Jelen d34e84c78d eidenv: Avoid memory leak 2021-07-15 09:51:59 +02:00
Frank Morgner d90048e5bb
Merge pull request #2357 from a-dma/p11_extractable
pkcs11-tool: allow setting CKA_EXTRACTABLE during keypair generation
2021-07-05 16:21:41 +02:00
Jakub Jelen aa6574b60e New rc published 2021-06-29 18:17:19 +02:00
Jakub Jelen fd6b64b91b Update NEWS with recently merged changes 2021-06-29 13:58:55 +02:00
Alessio Di Mauro 2f94a6b155
pkcs11-tool: allow setting CKA_EXTRACTABLE during keypair generation
Section 4.9 of the PKCS#11 v2.40 specification [1], mentions
CKA_EXTRACTABLE as a valid attribute for Private Key objects. However,
when calling "pkcs11-tool" with the "--exportable" option, the
attribute is not set as part of the private key template.

[1]: http://docs.oasis-open.org/pkcs11/pkcs11-base/v2.40/errata01/os/pkcs11-base-v2.40-errata01-os-complete.html
2021-06-23 15:29:29 +02:00
Doug Engert aebebac432 p11test: Use OPTIONAL_OPENSSL_CFLAGS
Needed if building with OpenSSL in non stanard location.

 Changes to be committed:
	modified:   src/tests/p11test/Makefile.am
2021-06-11 05:28:07 -05:00
Frank Morgner c42792c216
Merge pull request #2343 from Jakuje/ossl3v1
Working subset of #2337 (OpenSSL 3.0)
2021-06-07 14:38:30 +02:00
Stephan Mühlstrasser 151583ce26 C_Initialize() must copy CK_C_INITIALIZE_ARGS
C_Initialize() must make a copy of the function pointers supplied
via pInitArgs, as the PKCS#11 specification makes no guarantee that
the pInitArgs pointer is allowed to be dereferenced after C_Initialize()
returns.

Fixes issue #2170.
2021-06-07 12:44:07 +02:00
Jakub Jelen 9be6dc6606 pkcs11: Update the version to 3.0 (unused anywhere though) 2021-06-02 15:46:00 +02:00
Jakub Jelen 9d1a214340 pkcs11: Undefine internal typedef and remove its usage 2021-06-02 15:46:00 +02:00
Jakub Jelen fc2fecc80e Use const types for RSA and EC_KEY
These are anyway not supposed to be modified even in older versions of
openssl.

Visible when building with -Wno-deprecated-declarations
2021-06-02 15:46:00 +02:00
Jakub Jelen ffd6e2a576 p11test: Expect DERIVE to be set on both private and public key
Basically reverts part of 485b6cf, which turned out to be wrong.

Alternative to #2292
2021-05-31 15:36:29 +02:00
Jaime Hablutzel 465375bda2 Fixing command-line option names in error messages 2021-05-26 10:41:30 +02:00
Jakub Jelen 33426df3ff p11test: Do not return on warnings for (X)EDDSA keys 2021-05-24 11:25:53 +02:00
Jakub Jelen 8e4134841d p11test: Add new mechanisms from softhsm 2021-05-24 11:25:53 +02:00
Jakub Jelen a8a4bddfad p11test: Debug level from commandline
This replaces the debug level defined at build time with -NDEBUG,
which turned out to be quite confusing.

Fixes #2304
2021-05-24 11:25:53 +02:00
Jakub Jelen a69ab7c70c tests: Fix context for the asn1 test 2021-05-24 11:25:53 +02:00
Jakub Jelen fd96d2c960 Do not use deprecated ERR_load_ERR_strings() with OpenSSL 3.0 2021-05-24 11:25:53 +02:00