Commit Graph

8626 Commits

Author SHA1 Message Date
Frank Morgner 0e55a3497c fixed date in NEWS 2020-11-20 22:46:30 +01:00
Frank Morgner 96a9fcd628 prepare 0.21.0 2020-11-20 21:08:47 +01:00
Jakub Jelen 412372b024 tcos: Make sure we have at least two bytes to dive into the cycle 2020-11-18 23:02:34 +01:00
Jakub Jelen 65461e4eb5 authentic: Avoid accessing behind buffers
Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26900
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26860
2020-11-18 23:02:34 +01:00
Jakub Jelen 445c651549 authentic: Improve debugging logs 2020-11-18 23:02:34 +01:00
Jakub Jelen c8b2e82713 oberthur: Once again, fix the error check
The shared codition was executed but the condition in LOG_TEST_RET
was not met in case of the acl was null.

Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25962
2020-11-18 23:02:34 +01:00
Jakub Jelen 5eccebb4ee pkcs15-cert: Free memory on error
Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26145
2020-11-18 23:02:34 +01:00
Jakub Jelen b5b1afe401 tcos: Avoid reading behind the end of allocated buffer
Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=27480
2020-11-18 23:02:34 +01:00
Jakub Jelen d3451faa21 tcos: Reformat insert_key 2020-11-18 23:02:34 +01:00
Frank Morgner 4554d69119 code signing is not available in pull requests
(since this is untrusted code)
2020-11-18 13:22:10 +01:00
Frank Morgner c4a75eb1c2 updated NEWS file with CVEs 2020-11-12 11:14:17 +01:00
Frank Morgner 3bad4089fd updated key.p12 password 2020-11-12 00:02:44 +01:00
Frank Morgner b145c2c30e added most recent changes to NEWS 2020-11-10 23:33:17 +01:00
Frank Morgner e05574d942 use correct naming scheme for launch agents 2020-11-10 23:23:11 +01:00
Frank Morgner 4d6ed77a4a Prepare macOS binaries for Notarization
- update code signing credentials, thanks to Tim Wilbrink
- split up large files into 50 MB chunks for Nightly to avoid Github's file size limit
- codesign tools/libs with hardened runtime and entitlements
- avoid relocation of app bundles on installation
- sign installer for distribution
2020-11-10 23:23:11 +01:00
Zhang Xiaohui c5508c5eae Add sc_disconnect_card() before exit() and initialize two variables 2020-11-09 10:21:14 +01:00
Zhang Xiaohui e8f27abd02 Add sc_release_context() before exit() 2020-11-09 10:21:14 +01:00
Arya Senna 4cc0d0c7c9 Update upper length for ATR and the comments. 2020-11-04 11:02:56 +01:00
Arya Senna 64de4a5001 Update minidriver.c
Fix check of ATR length for Ledger
2020-11-04 11:02:56 +01:00
Carsten Blüggel 8098b7de61 pkcs11-tool: disable wrap/unwrap test until #1796 is resolved 2020-10-27 11:28:40 +01:00
Frank Morgner c621f39034 pkcs11-register: free up memory before exiting 2020-10-27 09:48:02 +01:00
Jakub Jelen 704afd0e2d cac: Use the specific pin change operation only on HID cards 2020-10-24 21:01:18 +02:00
Jakub Jelen 42254ae792 cac: Support changing PIN with CAC ALT tokens 2020-10-24 21:01:18 +02:00
Jakub Jelen 88f3d19479 opensc: Expose iso7816_build_pin_apdu function to support different pin APDUs 2020-10-24 21:01:18 +02:00
Doug Engert ce28ea8162 PIV global pin bug
Fixes #2141

NIST 800-73-3 based cards only had 2 bits set in first pin policy byte.
NIST 800-73-4 defines additions bits in first pin policy byte.
When one of these bit is set, and the policy prefers the Global pin,
it is not recognized and the local pin is used.

 On branch PIV-global-pin-bug
 Changes to be committed:
	modified:   src/libopensc/card-piv.c
2020-10-24 00:54:55 +02:00
w00475903 26a404d6a5 pkcs15-oberthur.c:remove redundant code
Signed-off-by: whzhe <wanghongzhe@huawei.com>
2020-10-16 14:02:56 +02:00
Zhang Xiaohui 0dc3dcbc00 There may be a memory leak in main in /src/tools/sceac-example.c
When failed to access reader, cxt needs to be released before
exiting the program. Like in the patch of CVE-2019-6502, a
sc_release_context(ctx) is needed before line 71, or a
memory leak may occur.
2020-10-16 14:00:23 +02:00
w00475903 7551e14c58 westcos-tool.c:fix memory leaks in dst->modulus.data and dst->exponent.data
Signed-off-by: whzhe <wanghongzhe@huawei.com>
2020-10-14 23:09:36 +02:00
Frank Morgner d0c44b9ddc oberthur: fixed missing error handling
fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25962
2020-10-05 23:18:27 +02:00
Frank Morgner fca2ba9474 oberthur: fixed length checking
fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=26116
2020-10-05 08:49:27 +02:00
Frank Morgner 2f6ab4c1a2
Prepare RC1 of 0.21.0 (#2117) 2020-10-03 01:11:33 +02:00
Jakub Jelen b3501ff669 idprime: Unbreak OS version 2 after key&cert renewal 2020-10-03 01:08:05 +02:00
Frank Morgner 0b40d3b999 idprime: check max. buffer length
fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25998
2020-10-02 13:23:11 +02:00
Frank Morgner 3ff059a74b fixed length checking in oberthur profile
fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25943
2020-10-02 13:23:11 +02:00
Jakub Jelen 732ed77ad6 idprime: Unbreak reading of compressed certificates 2020-09-30 23:13:14 +02:00
Anton Logachev 03396707f0 card-rtecp: Add Rutoken ECP SC NFC ATR 2020-09-30 01:18:50 +02:00
Frank Morgner 3ebfb01a3c itacns: fixed length checking
fixes https://oss-fuzz.com/testcase-detail/5116660103774208
2020-09-29 08:53:16 +02:00
Alexander 7296210224 Hide private objects only when not logged in 2020-09-28 13:01:15 +02:00
Alexander d85610b29b Fixed issue with C_FindObjectsInit, when CKU_SO does not see private objects, but CKU_USER see them 2020-09-28 13:01:15 +02:00
Conrado P. L. Gouvea 40da5cace2 pkcs11-tool: add --allow-sw flag that removes CKF_HW and allows using software tokens 2020-09-28 12:59:58 +02:00
rickyepoderi 57a391f16c Issue 2105: Add new DNIe CA structure for the secure channel 2020-09-26 01:36:55 +02:00
Jakub Jelen b577531720 coolkey: Remove dead code
Thanks coverity

** CID 362100:  Control flow issues  (DEADCODE)
/src/libopensc/card-coolkey.c: 1755 in coolkey_rsa_op()
2020-09-24 08:59:47 +02:00
Jakub Jelen 595926471b itacns: Really do not read behind the buffer bounds
Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25885
2020-09-24 08:59:47 +02:00
Doug Engert 6545cd26f4 PIV-update-DOD-Yubikey
Update the ATR table for PIV/CAC matrix to 2019 -10-18 version:
https://www.cac.mil/Portals/53/Documents/DoD%20Token%20utilziation%20and%20variation%20matrix%20v2_06_17October2019.docx?ver=2019-10-18-102519-120

Also update table for several PivKey cards, and added ATR for IDEMIA PIV 2.4.1.
But did not update for use of SM or VCI.

Yubico changed the ATR historical data for Yubikey 5 NFC. Code was added to recognize
it, when used with USB or NFC.

Note: Yubikey 5 NFC  when used with NFC cant use touch policy. NFC reader may not provide
enough power to power the LED on button.

 On branch PIV-update-DOD-Yubikey
 Changes to be committed:
	modified:   card-piv.c
2020-09-24 08:55:01 +02:00
Taylor R Campbell 5a369a8f31 epass2003: Fix erase sequence.
The previous erase sequence did not always work.  For example:

   % pkcs15-init -C
   Using reader with a card: Feitian ePass2003 00 00
   New User PIN.
   Please enter User PIN: 1234
   Please type again to verify: 1234
   Unblock Code for New User PIN (Optional - press return for no PIN).
   Please enter User unblocking PIN (PUK):
   Failed to create PKCS #15 meta structure: Security status not satisfied

   % pkcs15-init -E
   Using reader with a card: Feitian ePass2003 00 00
   Failed to erase card: Security status not satisfied

This apparently bricked many people's ePass2003 devices:

https://github.com/OpenSC/OpenSC/issues/767
https://sourceforge.net/p/opensc/mailman/message/33621883/
https://github.com/OpenSC/OpenSC/wiki/Feitian-ePass2003

Feitian provided a proprietary binary blob called `FIX_TOOL' to recover
devices from this state, but declined to offer source code when asked:

https://download.ftsafe.com/files/ePass/Fix_Tool.tar.gz
https://download.ftsafe.com/files/reader/SDK/Fix_Tool_20200604.zip

With reverse-engineering help by Saleem Rashid (@saleemrashid on
Github), I was able to find the sequence of three APDUs that the tool
submits to the device to erase it.  The mechanism seems to be:

1. Install a magic PIN.  This is like install_secret_key, as used by
   internal_install_pin, but with a few different magic constants.

2. Verify the magic PIN.

3. Delete the MF file, without selecting anything first.

With this patch, `pkcs15-init -E' successfully erases my ePass2003, and
I am able to initialize it with `pkcs15-init -C -p pkcs15+onepin' if I
set both a user pin and a PUK.  (This patch does not prevent the
ePass2003 from getting into the state which could not be erased by the
old erase sequence.)
2020-09-23 08:37:09 +02:00
Jakub Jelen 56acf7b445 oberthur: Do not leak memory on repeated init
Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24518
2020-09-22 23:08:27 +02:00
Jakub Jelen 101e9c720d coolkey: For large data, do not even expect response data
Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25708
2020-09-22 23:08:27 +02:00
Hans-Christoph Steiner 410012f100 add env vars to bash completion for PIN-related options 2020-09-22 22:48:00 +02:00
Hans-Christoph Steiner 644eae691d standardize <replaceable> PIN names in man pages
This makes all PIN-related options use the exact same term throughout the
man pages.
2020-09-22 22:48:00 +02:00
glvnst 16a0aeaa9a * tab to space for safer copy/paste
* add comment labels to steps
* DRY-out lib copy and config file install (one-shot for-loop giving cleaner control flow)
* change mv to cp during config config file install to enable simpler UNIXier mod check in future (diff opensc.conf{,.orig})
* remove refs to man pages during symlink step
* carefully remove the glob character symlinks described in #2092
* shellcheck-recommended quoting
2020-09-22 22:29:50 +02:00