Commit Graph

5259 Commits

Author SHA1 Message Date
Frank Morgner
5399c264fb cryptoflex-tool.c: fixed potential resource leak 2015-11-01 10:44:23 +01:00
Frank Morgner
c2ff4f090a pkcs15-pubkey.c: fixed potential resource leak 2015-11-01 10:44:23 +01:00
Frank Morgner
0f9645587a cwa14890.c: fixed potential resource leak 2015-11-01 10:44:23 +01:00
Frank Morgner
21a8e7e5f9 Merge pull request #591 from vletoux/isoApplet
isoApplet: fix card not recognized by minidriver
2015-10-31 02:28:21 +01:00
Frank Morgner
451386886d Merge pull request #573 from frankmorgner/coverity
Fix some more memory leaks reported by Coverity
2015-10-31 02:24:51 +01:00
Frank Morgner
8e7049c2fa removed unused variables 2015-10-30 18:21:40 +01:00
Frank Morgner
fa9ffb7b90 fixed uninitialized variable
regression of baab26d871
2015-10-30 18:21:40 +01:00
Frank Morgner
9f0087d968 fixed missing includes 2015-10-30 18:21:40 +01:00
Frank Morgner
ad5d16927c fixed cflags for onepin module 2015-10-30 16:45:22 +01:00
Frank Morgner
00ea7a68be Removes unused variables 2015-10-30 12:18:04 +01:00
Frank Morgner
7e29fcd26c pkcs15-authentic.c: fixed potential resource leak 2015-10-30 12:18:04 +01:00
Frank Morgner
f9a73c0b20 pkcs15-sc-hsm.c: fixed potential resource leak 2015-10-30 12:18:04 +01:00
Frank Morgner
0853ecd887 pkcs15-pubkey.c: fixed potential resource leak 2015-10-30 12:18:04 +01:00
Frank Morgner
98b9b37e12 card-openpgp.c: fixed potential resource leak 2015-10-30 12:18:04 +01:00
Frank Morgner
9e1a5447d4 profile.c: fixed potential resource leak 2015-10-30 12:15:06 +01:00
Frank Morgner
fd904fbcb8 pkcs15-oberthur-awp.c: fixed potential resource leak 2015-10-30 12:15:06 +01:00
Frank Morgner
e7316b60e3 pkcs15-myeid.c: fixed potential resource leak 2015-10-30 12:15:06 +01:00
Frank Morgner
baab26d871 pkcs15-lib.c: fixed potential resource leak 2015-10-30 12:15:06 +01:00
Frank Morgner
4f4c4aa5ec pkcs15-iasecc.c: fixed potential resource leak 2015-10-30 12:15:06 +01:00
Frank Morgner
34b6d95ec6 card-westcos.c: fixed potential resource leak 2015-10-30 12:15:06 +01:00
Frank Morgner
ecf147099a card-epass2003.c: fixed potential resource leak 2015-10-30 12:15:06 +01:00
Frank Morgner
2963588887 card-authentic.c: fixed potential resource leak 2015-10-30 12:15:06 +01:00
Frank Morgner
b96ba14aae added fall through comment 2015-10-30 12:15:06 +01:00
Andreas Schwier
0caf0d1dd6 sc-hsm: Add missing include introduced by #580 2015-10-29 14:09:01 +01:00
Frank Morgner
decd5ab987 Merge pull request #580 from frankmorgner/select
Fix issues related to selecting a file
2015-10-29 13:30:37 +01:00
Frank Morgner
c50a951337 Merge pull request #566 from vletoux/ecc_minidriver
First ECC support for the minidriver
2015-10-24 23:32:42 +02:00
vletoux
206eb7124a isoApplet: fix card not recognized by minidriver 2015-10-23 23:03:25 +02:00
Petr Spacek
52b6505909 export all C_* symbols
Header files distributed with PKCS#11 v2.30 define all functions as
extern and some applications (like BIND 9.10) do not work without all
functions.
2015-10-22 18:07:26 +02:00
Frank Morgner
249f258ff2 Merge pull request #584 from marschap/card-openpgp-cleanup2
OpenPGP card cleanup
2015-10-17 17:36:40 +02:00
Frank Morgner
4ddf2cc042 Merge pull request #579 from dengert/piv-cac
Do not expose access to PIV emulated files from utilities
2015-10-17 17:34:39 +02:00
Frank Morgner
0ca46910f7 use tabs only for indenting 2015-10-16 09:58:01 +02:00
vletoux
35175a814c minidriver: fix according to frank's comments 2015-10-15 22:40:36 +02:00
Peter Marschall
6109a8792d OpenPGP: add additional manufacturers 2015-10-15 16:43:10 +02:00
Peter Marschall
a0ca6b2ef0 OpenPGP: set card's version in pgp_init() 2015-10-15 16:43:10 +02:00
Peter Marschall
7078fbd505 OpenPGP: cleanup pgp_init()
- use LOG_FUNC_RETURN instead of return for symmetry with LOG_FUNC_CALLED
2015-10-15 16:43:10 +02:00
Peter Marschall
e1db96b73b OpenPGP: extend pgp_match_card()
- explicitly check for supported versions
- log successful matches by AID with their type
- log detection of unsupported OpenPGP-type cards
2015-10-15 16:43:09 +02:00
Peter Marschall
7c2adb1fc8 OpenPGP: 1st preparations for newer versions
- add references to new specs
- add new enum _version constants
2015-10-15 16:43:09 +02:00
Peter Marschall
69b482dce6 OpenPGP: cleanup pgp_get_card_features()
- bug fix: re-initialize index to start searching at the right place
- get rid of unnecessary variable
- add some line breaks & comemnts for easier understanding
2015-10-15 16:42:58 +02:00
Peter Marschall
2a269c5267 OpenPGP: cleanup pgp_build_tlv()
- get rid of intermediate variable
- clarify check in while() loop
- line breaks for easier reading
2015-10-15 16:17:22 +02:00
Peter Marschall
3d492ae376 OpenPGP: cleanup pgp_erase_card()
- get rid of unnecessary variable
- use easily understandable hex representation of APDUs
- auto-calculate APDU length based on hex representation
- restrict scope of some variables
- use sc_log() instead of directly writing to console
- line breaks & comments for easier reading/understanding
- fix typo in log message
2015-10-15 16:17:22 +02:00
Peter Marschall
3d4fbd776d OpenPGP: harmonize coding style
- 2 line breaks between functions for easier reading
- function type on separate line
- mark each function as 'ABI' or 'Internal'
- slightly doxygen-ize comments introducing functions
- fix typos in comments
- break over-long comment lines
- break comment lines at sensible places
- consistent calling style for DRVDATA()

- no code change
2015-10-15 16:17:22 +02:00
Peter Marschall
7ba47fd5a9 OpenPGP: consistently use card->ctx in pgp_put_data_plain()
- get rid of unnecessary variable
- harmonize coding style: adapt to prevailing use of card->ctx
2015-10-15 16:17:22 +02:00
Peter Marschall
1a05f968bd OpenPGP: simplify gnuk_write_certificate()
- get rid of unnecessary variables
- use for-loop to initialize/check/increase run variable in one place
- restrict variables to the necessary scope
- use ternary operator inside a statement instead of if...else...
2015-10-15 16:17:22 +02:00
Peter Marschall
d2b1c8228f OpenPGP: set apdu_case on declaration
- use ternary operator to set apdu_case immediately on declaration
  for the GNUK and non-GNUK case
2015-10-15 16:17:22 +02:00
Peter Marschall
3341c5bb8f OpenPGP: make logical structure clearer
- one line per sub-term in the condition of the conditional statement
2015-10-15 16:17:11 +02:00
Frank Morgner
e316bf3140 Merge pull request #582 from marschap/openpgp-tool-fixes
Openpgp tool fixes
2015-10-15 13:13:18 +02:00
Peter Marschall
6498721076 piv: fix typos in usage & man page 2015-10-15 12:51:19 +02:00
Peter Marschall
7de373b3b9 OpenPGP: mark do_erase as an action in openpgp-tool
- avoid the unintended output of user info when only erasing was requested
2015-10-15 12:51:10 +02:00
Peter Marschall
524ad56146 OpenPGP: remove unnecessary semicolons in openpgp-tool
- this is C, not a shell script
2015-10-15 12:51:10 +02:00
Peter Marschall
392bc08d86 OpenPGP: fix pretty name for gender code 39 in openpgp-tool
- use the same term that GnuPG uses
2015-10-15 12:51:10 +02:00
Peter Marschall
e79f1f4b01 OpenPGP: accept -E as option in openpgp-tool
- make behaviour match the usage message by accepting '-E' as
  alternative short form of '--erase'
2015-10-15 12:51:10 +02:00
Frank Morgner
e1073c09ea handle checking of file output in sc_select_file
fixes https://github.com/OpenSC/OpenSC/issues/576
2015-10-14 23:25:13 +02:00
Frank Morgner
bcf9b2bc84 added error checking 2015-10-14 23:14:47 +02:00
Frank Morgner
e634169a92 added error checking 2015-10-14 23:14:47 +02:00
Frank Morgner
c371c3b5ec removed unused variable 2015-10-14 23:08:39 +02:00
Frank Morgner
f9011b7dc0 fixed indenting 2015-10-14 22:57:10 +02:00
Frank Morgner
4f13fde7f1 use size_t for a length instead of int 2015-10-14 22:56:53 +02:00
Frank Morgner
4275dac495 fixed indenting 2015-10-14 22:51:55 +02:00
Frank Morgner
0bf1f3755c removed unused variable 2015-10-14 22:48:45 +02:00
vletoux
fed64b0636 minidriver: fixes according to Frank's comments 2015-10-14 22:48:41 +02:00
Frank Morgner
949d8614d2 removed unused variable 2015-10-14 22:46:55 +02:00
Frank Morgner
0258c91f30 removed unused variable 2015-10-14 22:43:12 +02:00
Frank Morgner
0a96616034 remove unused variable 2015-10-14 22:38:10 +02:00
Frank Morgner
6573a93d4b fixed memory leak 2015-10-14 22:37:56 +02:00
Frank Morgner
a5685b537e fixed memory leak 2015-10-14 22:34:44 +02:00
Frank Morgner
15f204c5d6 fixed indenting 2015-10-14 22:32:51 +02:00
Frank Morgner
895005f4df added error checking 2015-10-14 22:28:49 +02:00
Doug Engert
65bc754b8b Do not expose access to PIV emulated files from utilities
PIV cards uses get/put data not select file and read_binary.
To allow access via pkcs15 emulation card-piv.c emulates
select_file and read_binary but only when used with the path as
created by the piv emulation.

There are no MF.DIR or ED.DIR files.
opensc-tool and opensc-explorer will not work with this emulation.

Patch removes code that caused problems with opensc-tooland opensc-explorer.
2015-10-14 15:27:58 -05:00
Frank Morgner
00daa3f535 added error checking 2015-10-14 22:27:32 +02:00
Frank Morgner
9a82ddea8a fixed memory leak 2015-10-14 22:26:53 +02:00
vletoux
75d76f5ce4 Merge branch 'master' of https://github.com/OpenSC/OpenSC into OpenSC-master
Conflicts:
	src/minidriver/minidriver.c
2015-10-14 22:22:19 +02:00
Frank Morgner
5558b9d368 removed unused parameters 2015-10-14 22:17:33 +02:00
Frank Morgner
2ed4c8ae6c Adds error checking 2015-10-14 22:16:44 +02:00
Frank Morgner
94772c870a Adds error checking 2015-10-14 22:15:17 +02:00
Frank Morgner
c9420046c5 Removed unused parameter 2015-10-14 22:08:14 +02:00
Frank Morgner
77b5138860 Removed unused parameter 2015-10-14 22:02:35 +02:00
Frank Morgner
851e0a24ff Merge pull request #571 from frankmorgner/label
Fixes accessing fixed size arrays
2015-10-14 18:56:29 +02:00
Frank Morgner
ee5915700c Merge pull request #516 from frankmorgner/lock
Only re-lock for Windows and Apple
2015-10-13 14:11:29 +02:00
Doug Engert
0b268f789a Allow PIV driver to use cards where default application in not PIV
card-piv.c was not selecting the PIV AID correctly from piv_find_aid.
This cause a CAC card that also has the PIV application to fail a VERIFY command
of the pin would use a VERIFY  APDU P2 where P2 for PIV is 80, but for CAC was 00.

A CAC card could work if the caller requested the serial number of the card
which did call piv_select_aid. All the OpenSC tools, minidriver and
PKCS#11 do this, but Tokend does not.

This is a partial fix for https://github.com/OpenSC/OpenSC/issues/570.
Tokend in later MacOS versions still has other issues.

A  more complete solution is needed for cards with multiple applications.

I do not have a CAC card or MAC to do any testing.

Thanks to https://github.com/mouse07410 who has a CAC card, and a Mac,
and has tested this fix.
2015-10-11 19:14:02 -05:00
vletoux
747678c83d minidriver: remove unnecessary logs on console (certutil -scinfo) 2015-10-11 18:51:36 +02:00
vletoux
b968fcfb1f minidriver: Windows x509 enrollment works
Removed cmap_record in sc_pkcs15_prkey_info (not used by any driver nor code)
Remove cardcf specific code (cardcf neutralized by CP_CACHE_MODE_NO_CACHE and it maintened by the Base CSP/KSP, not the minidriver)
Add conversion code for Windows GUID / OpenSC self computed GUID
2015-10-11 15:20:04 +02:00
vletoux
bee1a450c9 minidriver: modified configuration functions 2015-10-11 10:39:02 +02:00
vletoux
7551baafbd minidriver: add crt secure functions (*_s) 2015-10-10 22:07:49 +02:00
vletoux
ebfb76d311 minidriver: fix library import for guid & one compilation warning 2015-10-10 19:01:14 +02:00
vletoux
8f4420cb78 minidriver: factorize container naming code 2015-10-10 15:39:27 +02:00
vletoux
227f48d7b0 minidriver: replace one sprintf by sprintf_s 2015-10-10 14:15:23 +02:00
Frank Morgner
da1d4cc78a Fix locking issue on OS X
Works around Apple shipping PCSC-Lite headers without PCSC-Lite. Let's
say they do it for "backward compatibility"...
2015-10-08 08:24:40 +02:00
Frank Morgner
a6b36507a3 removed unused parent in md directory/file 2015-10-06 22:49:32 +02:00
Frank Morgner
d18ddcb446 fixed accessing fixed size md file/directory name 2015-10-06 22:49:16 +02:00
Frank Morgner
6c61bf6815 fixed accessing fixed size guid 2015-10-06 22:49:16 +02:00
Olaf Kirch
f42a1c2563 Replace outdated address okir@lst.de -> okir@suse.de
Signed-off-by: Olaf Kirch <okir@suse.de>
2015-10-05 14:07:28 +02:00
Frank Morgner
137afb10b7 Check for NUL in label to test its presence 2015-10-05 08:30:47 +02:00
Frank Morgner
5b0332528f fixed accessing app_label in sc_pkcs15_data_info_t 2015-10-05 08:23:02 +02:00
vletoux
811a86e72a fix: set the container name as the id if md_guid_as_label is set 2015-10-04 19:49:31 +02:00
Frank Morgner
f9cd1fc476 fixed accessing fixed size cvc members 2015-10-04 17:53:51 +02:00
Frank Morgner
161e84f066 pkcs15-tool.c: fixed accessing label in sc_pkcs15_object_t 2015-10-04 17:33:14 +02:00
Frank Morgner
35f028a57c pkcs15-init.c: fixed accessing label in sc_pkcs15_object_t 2015-10-04 17:33:14 +02:00
Frank Morgner
d709347c2b pkcs15-crypt.c: fixed accessing label in sc_pkcs15_object_t 2015-10-04 17:33:14 +02:00
Frank Morgner
191af692c8 print.c: fixed accessing label in sc_pkcs15_object_t 2015-10-04 17:33:14 +02:00
Frank Morgner
e171789dad pintest.c: fixed accessing label in sc_pkcs15_object_t 2015-10-04 17:33:14 +02:00