Commit Graph

7842 Commits

Author SHA1 Message Date
Frank Morgner 45e29056cc Release 0.20.0 2019-12-29 13:42:06 +01:00
Frank Morgner a2b133ef4f Updated NEWS 2019-12-29 13:39:01 +01:00
Khem Raj 05e3f7b667 Fix misleading code indentation
Fixes
error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
         if(cipher)
         ^
../../../git/src/libopensc/card-entersafe.c:369:2: note: previous statement is here
        if(sbuf)
        ^
2019-12-28 18:18:06 +01:00
Julian Strobl e9aa163fe5 pkcs11-tool: fix output of test_decrypt
Before the output looked like this, if a public key was not found:
```
  testing key 1 (IDKey2)
    RSA-X-509: OK
    RSA-PKCS: OK
  testing key 2 (IDKey3)
couldn't find the corresponding pubkey for validation
couldn't find the corresponding pubkey for validation
    RSA-X-509:     RSA-PKCS:   testing key 3 (IDKey4)
couldn't find the corresponding pubkey for validation
couldn't find the corresponding pubkey for validation
```

Now:
```
  testing key 1 (IDKey2)
    RSA-X-509: OK
    RSA-PKCS: OK
  testing key 2 (IDKey3) -- can't find corresponding public key, skipping
  testing key 3 (IDKey4) -- can't find corresponding public key, skipping
```
2019-12-28 18:15:55 +01:00
Julian Strobl 81940e123b pkcs11-tool: align output for test_signature
Before it was a bit confusing, e.g.:
```
  testing key 1 (2048 bits, label=IDKey2) with 1 signature mechanism
    RSA-X-509: OK
couldn't find the corresponding pubkey
  testing key 2 (0 bits, label=IDKey3) with 1 signature mechanism -- can't be used to sign/verify, skipping: can't obtain modulus
```

The error message in line 3 is for IDKey3 and not for IDKey2.

With this patch the output is aligned with `test_verify`:
```
  testing key 1 (IDKey2) with 1 mechanism
    RSA-X-509: OK
  testing key 2 (IDKey3) with 1 mechanism -- can't find corresponding public key, skipping
```
2019-12-28 18:15:55 +01:00
Julian Strobl 9eed40ea31 tcos: add encryption certificate for IDKey
Fixes https://github.com/frankmorgner/OpenSCToken/issues/21
2019-12-28 18:15:55 +01:00
Frank Morgner 1cc6087126 fix buffer length for printing DFs 2019-12-19 04:44:59 +01:00
Benjamin DELPY b59456b6e4 Update card-gids.c to support 3072 & 4096 RSA key sizes 2019-12-19 04:33:14 +01:00
Julian Strobl 187d908feb tcos: allow correct input length when signing
For 2048 bit keys the padded input is 256 bytes long.

Fixes https://github.com/frankmorgner/OpenSCToken/issues/20
2019-12-19 04:30:27 +01:00
Julian Strobl 55b7a6fefd Revert "tcos: Do not advertize non-functional RSA RAW algorithms"
This reverts commit bee5c6d639.

See https://github.com/frankmorgner/OpenSCToken/issues/20#issuecomment-566455157
2019-12-19 04:30:27 +01:00
Frank Morgner 333c41c5d5 pgp: don't write beyond oid object
fixes Stack-buffer-overflow
https://oss-fuzz.com/testcase-detail/6329203163398144
2019-12-18 14:55:46 +01:00
Jakub Jelen af42a93874 tests: Add missing script to the release tarball 2019-12-17 16:09:35 +01:00
Jakub Jelen ee78b0b805 pkcs15-coolkey: Fix EC key type and fail on invalid key types
Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19251
2019-12-11 09:19:45 +01:00
Jakub Jelen 708cedbdad dir: Correctly free allocated memory on error
Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19265
2019-12-11 09:19:45 +01:00
dojo 17d9d8450c Enabled extended APDU support for StarCOS 3x cards 2019-12-05 16:48:11 +01:00
dojo a450b3427e Fix path unifying of StarCOS 3.5 cards 2019-12-05 16:48:11 +01:00
dojo 9f2c112ecb Add new ATR for StarCOS 3.5 2019-12-05 16:48:11 +01:00
dojo c99d62c04a Add PIN encoding detection for StarCOS 3x cards 2019-12-05 16:48:11 +01:00
Doug Engert 5fa633075d GIDS Decipher fix for TPM
GIDS decipher APDU fails with status '65 00' or '67 00' if
"Padding Indication" byte is present. Debug logs of Microsoft
certutil -v -scinfo  using Microsoft drivers show that for a
decipher, the "Padding Indication" is not present. It maybe
needed if Secure Messaging is added later.

Extended APDU is turned off as this may not be supported on
some cards. Chaining is used used instead, it works on all cards.

RAW RSA is turned off, it is supported.

Tested with pkcs11-tool on Windows 10 with a TPM 2.0 module.

 On branch gids-decipher
 Changes to be committed:
	modified:   src/libopensc/card-gids.c

 Date:      Tue Dec 3 18:08:32 2019 -0600
 interactive rebase in progress; onto 01678e87
 Last commands done (3 commands done):
    squash c968d0dd GIDS No Padding Indication Byte
    squash 0fa940fc Take 3
 No commands remaining.
 You are currently rebasing branch 'gids-decipher' on '01678e87'.
2019-12-05 16:33:27 +01:00
Raul Metsma e91853bda8 Simplify code and card detection
Signed-off-by: Raul Metsma <raul@metsma.ee>
2019-12-05 10:51:55 +01:00
AdriaoNeves 366adbd546 Fixing invalid signature with 3072 RSA bits in GemsafeV1 2019-12-05 10:46:21 +01:00
AdriaoNeves dbe932152d Fixing invalid signature with 3072 RSA bits in GemsafeV1 2019-12-05 10:46:21 +01:00
Jakub Jelen 642a3ee734 cardos: Use more appropriate RSA flags for CardOS 5
Fixes #1864
2019-12-05 10:45:34 +01:00
Jakub Jelen afe255c5b2 Remove never set constants and their handling in cardos driver 2019-12-05 10:45:34 +01:00
Jakub Jelen 2bab09ac03 tcos: Use unique IDs for certificates 2019-12-05 10:43:17 +01:00
Jakub Jelen 88e3c44f22 tcos: Drop undocumented tags from security environment data 2019-12-05 10:43:17 +01:00
Jakub Jelen bee5c6d639 tcos: Do not advertize non-functional RSA RAW algorithms 2019-12-05 10:43:17 +01:00
Jakub Jelen 424eca8bef tcos: Remove duplicate lines 2019-12-05 10:43:17 +01:00
Jakub Jelen 4c67bbf383 coolkey: Avoid addressing behind allocated buffers
Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19222
2019-12-04 21:47:47 +01:00
Jakub Jelen c246f6f69a coolkey: Make sure the object ID is unique when filling list
Thanks to oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19208
2019-12-04 21:47:47 +01:00
Andreas Schwier 32b49894c5 sc-hsm: Add ATR for faster token variant 2019-12-04 21:43:47 +01:00
Andreas Schwier 7858f3cd06 sc-hsm: Add support for SmartCard-HSM MicroSD card 2019-12-04 21:43:47 +01:00
Frank Morgner 78548a9394 mac: don't forget to uninstall OpenSCTokenApp
fixes https://github.com/OpenSC/OpenSC/issues/1862
2019-12-04 14:55:23 +01:00
Frank Morgner 39c1400fac opensc-notify: fixed name in plist 2019-12-04 14:55:23 +01:00
Jakub Jelen 8ab39bdec7 pkcs11-session: Explicitly reset login_user and release lock 2019-12-04 12:00:07 +01:00
Frank Morgner e9957b9a92 include build-package-from-ci in autoconfig/automake 2019-12-02 16:54:32 +01:00
Frank Morgner 754a409191 added build-package-from-ci until proper dmg creation is realized in CI 2019-12-02 12:31:53 +01:00
Frank Morgner 433377f76e macos: use start_selected instead of selected
otherwise the user's choice would be overwritten when the user clicks
some other installation option.

also, use the domain tag to install to the local drive only
2019-12-02 12:29:32 +01:00
Frank Morgner 118929df93 macos: use generic location for NotificationProxy
to be installed with OpenSC core and to be used from
the tools, tokend and CTK
2019-12-02 08:22:34 +01:00
Frank Morgner a581cbfc2d mac: group CTK token seperately in installer 2019-12-01 00:16:47 +01:00
Jakub Jelen ef61a95b31 coolkey: Make sure the matching objects have same lengths
This ensures that we do not go behind the allocated buffer if
we get wrong data.

Thanks to oss-fuzz:

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19031
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19032
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19038
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19039
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19040
2019-11-29 22:48:00 +01:00
Jakub Jelen aa6d3e1d36 coolkey: Fix the comparator return value 2019-11-29 22:48:00 +01:00
Jakub Jelen 249e928176 gp: Correctly check for the CPLC data length 2019-11-29 22:47:26 +01:00
Jakub Jelen 4f3d87d03c coolkey: Split the CPLC related structures and function to the generic GP file 2019-11-29 22:47:26 +01:00
Jakub Jelen 326955a147 reader-pcsc: Preserve the CARD_PRESENT flag to make sure the card is detected after reader reinsertion 2019-11-28 11:18:25 +01:00
Jakub Jelen 4bd8cda966 pkcs11-session: When we notice logout in lower layers, while pkcs11 thinks we are logged in, invalidate all sessions in given slot 2019-11-28 11:18:25 +01:00
Jakub Jelen e0e1f10bd3 pkcs11/slot: Fix indentation 2019-11-28 11:18:25 +01:00
Oskar Wiksten 79a51e0d18 pkcs11: Support for RSA PSS padding in verify
* Explicitly copies the mechanism parameters during a PKCS#11 `C_VerifyInit`
  and `C_DecryptInit` operation.
* Resolves issues where the calling application deallocates the `pParameter`
  pointer in the `CK_MECHANISM` struct between calls to `C_VerifyInit` and
  `C_Verify`, or between `C_DecryptInit` and `C_Decrypt`.
* These mech parameters are used in RSASSA-PSS and RSAES-OAEP, for example.
* This commit copies the same fix that was applied to `sc_pkcs11_sign_init` in
  commit e5707b545e for supporting RSASSA-PSS.
2019-11-28 11:17:12 +01:00
AdriaoNeves ce71b171e2 Add support for 4K RSA keys in GemsafeV1 2019-11-23 22:13:28 +01:00
carblue 6d98f8c8d8 card-myeid.c: issue #1219 2019-11-23 21:38:14 +01:00