Commit Graph

7041 Commits

Author SHA1 Message Date
Jakub Jelen 3998fffbdc configure: Use correct variables for testsuite 2018-06-21 12:48:57 +02:00
Jakub Jelen 0789961320 Add a badge about card status 2018-06-21 12:48:57 +02:00
Frank Morgner 9c2afad417 fixed copy/paste error 2018-06-20 00:56:01 +02:00
Frank Morgner 8b3f5b7d97 epass2003: fixed logical error 2018-06-19 23:24:36 +02:00
Frank Morgner 9150d92447 fixed out of bounds access 2018-06-19 23:22:00 +02:00
Frank Morgner d8cdf66d3d fixed memory leak 2018-06-19 23:15:29 +02:00
ytoku 63ed8d7368 gids: file selection via gids_select_file 2018-06-19 08:00:01 +02:00
ytoku 46c0bbd803 gids: use file id instead of path in gids_delete_key_file 2018-06-19 08:00:01 +02:00
ytoku ab16228e26 gids: fix gids_delete_cert 2018-06-14 14:05:45 +02:00
asc 31941bc3d9 sc-hsm: Ensure that applet returns version information (Fix #1377) 2018-06-11 22:51:45 +02:00
Peter Marschall 7c99adaaa6 PIV: limit scope of some variables 2018-06-11 22:37:42 +02:00
Peter Marschall f2ba0ad9be PIV: refactor to use sc_compacttlv_find_tag() 2018-06-11 22:37:42 +02:00
Jakub Jelen 40b02b2582 Namespace the function name, update comment 2018-06-11 22:31:44 +02:00
Jakub Jelen 50b5eb3b69 Allow using up to 16 certificates 2018-06-11 22:31:44 +02:00
Jakub Jelen 9dda83e48e cac: Verbose logging, avoid OOB reads 2018-06-11 22:31:44 +02:00
Jakub Jelen 930d457304 Log bad length buffers 2018-06-11 22:31:44 +02:00
Jakub Jelen 298afb072e Properly check length also of the applet entry 2018-06-11 22:31:44 +02:00
Jakub Jelen f27ee858c2 Carefully check the length of the buffers before accessing them.
The lengths are static and based on the GCS-IS 2.1 specification
2018-06-11 22:31:44 +02:00
Jakub Jelen a73b3d549b Address review comments:
* Refactor cac_properties_t structure to make its creation more readable
 * Avoid manual allocation in cac_get_acr() and clean up bogus pointers
 * Avoid bogus comments
 * Properly check lengths of retrieved values
2018-06-11 22:31:44 +02:00
Jakub Jelen aacac57230 Another note/todo about PINs on uninitialized cards 2018-06-11 22:31:44 +02:00
Jakub Jelen d24c23ac0c Use applet properties to recognize buffer formats
Previously, the code handled all the data objects as SimpleTLV,
which caused invalid encoding when we tried to merge TL + V buffers
into single PKCS#15 buffers.

This change is using GET PROPERTIES APDU after applet selection
to explore objects, figure out encoding and check the status of
PKI objects initialization to avoid reading them.
2018-06-11 22:31:44 +02:00
Jakub Jelen 450cff470a Inspect the Alt tokens through the ACA applet
The previous solution was just guessing AIDs of the PKI objects
and trying if they answer.

This solution is inspecting card based on the Service Applet Table
(listing all the applets on the card) and using GET PROPERTIES APDU
listing all the available OIDs of the applet.

This was successfully tested with standard CAC card
(with different ACA AID) and uninitialized HID Alt tokens with empty
certificates slots.
2018-06-11 22:31:44 +02:00
Jakub Jelen ee7b6f4035 cac: Log unknown tags 2018-06-11 22:31:44 +02:00
Jakub Jelen cde06a499c Use correct AID and Object ID 2018-06-11 22:31:44 +02:00
Jakub Jelen 2138d5fe32 One more todo based on the testing with a new libcacard 2018-06-11 22:31:44 +02:00
Jakub Jelen 426914674c Unbreak encoding last tag in the data objects 2018-06-11 22:31:44 +02:00
Jakub Jelen 5b420318d4 Allocate private data outside and avoid memory leaks 2018-06-11 22:31:44 +02:00
Jakub Jelen 92df907681 Typo, clean up comments, dump more useful information from CCC 2018-06-11 22:31:44 +02:00
Jakub Jelen 52451ac438 card-cac.c: Dump also the MSCUID 2018-06-11 22:31:44 +02:00
asc 335c242ce0 Filter certificates other than CKC_X_509 2018-06-08 08:28:37 +02:00
Jakub Jelen 89a8e0cb64 Avoid memory leaks from the failed card detections 2018-06-08 08:26:49 +02:00
Andreas Kemnade 23706635a8 cardos: create pin in mf
If cardos cards are initialized by other software and there is a pinref
without the msb set, also the pin verify works without that bit set.

This patch changes pin initialisation so that the pin is created in mf
which has the effect that pin verify works without | 0x80 to the
pin ref.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
2018-06-08 08:23:37 +02:00
Laurent Bigonville 694822554e dnie: Consider that everything not APPLE or WIN32 is "linux"
This should fix the FTBFS on architectures like kfreebsd

Fixes: #1366
2018-06-08 08:22:58 +02:00
Peter Marschall e6ad737430 OpenPGP: add cast forgotten in previous commit 2018-06-08 08:21:11 +02:00
Peter Marschall ba9eebceaf OpenPGP: refactor do_dump_do()
- limit length of data to write even in raw mode to the real length
- cluster variuable definitions
- restrict scope of variables
- introduce a variable length to make the purpose more obious
- start preprocessor directives at column one
- add comments where needed
- harmonize coding style: space after "if" and casts
2018-06-08 08:21:11 +02:00
Peter Marschall 4a1bf9fb21 OpenPGP: limit output of -d in non-raw mode to real length 2018-06-08 08:21:11 +02:00
Peter Marschall 85f4ba6c5f OpenPGP: allow calling -d multiple times
Put the arguments passed to option -d into an array instead of only
storing the latest value.
During output, iterate over the values passed in via the option.
2018-06-08 08:21:11 +02:00
Peter Marschall 1da7da5e99 OpenPGP: make parsing of option -d more robust
* accept flexible option arguguments: 1-4, 101-104, 0101-0104, ...
2018-06-08 08:21:11 +02:00
Peter Marschall 41d89b52fc OpenPGP: treat option --del-key as an action 2018-06-08 08:21:11 +02:00
Peter Marschall da6e30b38b OpenPGP: clarify usage text 2018-06-08 08:21:11 +02:00
Peter Marschall 266b811e55 compact TLV - add generic sc_compacttlv_find_tag() function (#1374)
* new function sc_compacttlv_find_tag()

Add function sc_compacttlv_find_tag() to search for a tag in a
compact-TLV structure.

* OpenPGP: use sc_compacttlv_find_tag()

While doing so, fix a typo affection OpenPGP v3.x cards
2018-06-08 08:17:13 +02:00
asc 6dfeb9959f Fix #1371 introduced by 45ad44e 2018-06-08 08:13:32 +02:00
Laurent Bigonville f2042f2270 Do not display opensc-notify in the application list
opensc-notify doesn't propose a GUI that can be displayed to the users,
so it doesn't make sense to display it in the application list/launcher

Fixes: #1379
2018-06-06 22:48:12 +02:00
Peter Marschall 76725d5f80 .travis.yml: partially revert commit cb3113a 2018-06-06 22:43:46 +02:00
Peter Marschall ff9df38665 src/tools: remove HELP2MAN_LOCALE from Makefile.am 2018-06-06 22:43:46 +02:00
Peter Marschall c16903140d src/tools: remove deleted man pages from Makefile.am's EXTRA_DIST 2018-06-06 22:43:46 +02:00
Peter Marschall 008845efb3 src/tools: remove legacy man pages generated using help2man
Now that we have proper DocBook sources for them, they can be safely removed.
2018-06-06 22:43:46 +02:00
Peter Marschall a27ade7789 .travis.yml: remove references to help2man
Now that we have proper DocBook sources for all man pages formerly
generated using help2man, it is not needed anymore.
2018-06-06 22:43:46 +02:00
Peter Marschall cedc5a1cf6 configure.ac: remove references to help2man
Now that we have proper DocBook sources for all man pages formerly
generated using help2man, it is not needed anymore.
2018-06-06 22:43:46 +02:00
Peter Marschall 184bc137cd OpenPGP: extend & sort man page
Also try to consolidate the coding style a bit
2018-06-06 22:43:46 +02:00