Commit Graph

5826 Commits

Author SHA1 Message Date
Thomas Calderon 22fb49b554 PKCS#11: Improve compliance for public keys.
* Key usage required when calling C_CreateObject for public key are not used.
    This adds the logic to convert from PKCS#11 attributes to PKCS#15 in the
    structure that is sent to underlying _store_pubkey functions.
2015-02-07 20:17:12 +01:00
Viktor Tarasov 96265e6d08 pkcs15init: superpluous 'ec-params' in init data
Pkcs15init data, used to import/generate key objects, includes twice the same EC parameters data:
 - explicit 'params' data
 - part of sc_pkcs15_pubkey/sc_pkcs15_prkey
Explicit 'ec-params' data is removed.
2015-02-07 20:00:41 +01:00
Viktor Tarasov e374f88b82 pkcs15-pubkey: add EC params in SPKI encoding 2015-02-07 19:55:08 +01:00
Viktor Tarasov 9148f21cd1 pkcs15-pubkey: possible NULL dereference, logs
... remove obsolete comments, minor coding style corrections
2015-02-07 19:55:08 +01:00
Philip Wendland faaa11e091 Prefer serial number from EF(TokenInfo) and cached serials over CARDCTL
sc_pkcs15_get_object_guid() should prefer the serial number from
EF(TokenInfo) over card->serialnr because the user may override the
card's serial number with "pkcs15-init -C --serial". The card->serialnr
should be used before calling card CTL with SC_CARDCTL_GET_SERIALNR
because it might contain a cached value.

This change *should* allow cards to be used with the minidriver even if
SC_CARDCTL_GET_SERIALNR is not implemented. For example, a driver might
set card->serialnr at initialization or the user might initialize a
PKCS#15 card with its own "--serial".

See also the discussion at the mailing list:
[Opensc-devel] AT_SIGNATURE and AT_EXCHANGE Problem
2015-02-07 19:48:10 +01:00
Viktor Tarasov 08eb700b97 revert or partially revert some of recent commits
b94c163 - invalid, non-tested
11881a6 -- src/libopensc/card-iasecc.c -- return from select has to be ignored,
3a92bf7 -- src/pkcs11/slot.c -- SEGFAULT issue #373
3a92bf7 -- src/tools/piv-tool.c -- confirmed by author
6759c04 -- src/pkcs15init/pkcs15-lib.c -- file instantiation error has to be ignored
2015-02-07 19:31:17 +01:00
Frank Morgner 3a92bf7af5 fixed resource leaks 2015-02-05 01:38:41 +01:00
Frank Morgner 11881a61b8 removed/fixed dead code 2015-02-05 01:38:41 +01:00
Frank Morgner a3fc62f79f fixed NULL dereference (or warning thereof) 2015-02-05 01:38:40 +01:00
Frank Morgner 8d902d1ed3 fixed out of bounds read/write/access 2015-02-04 09:24:50 +01:00
Frank Morgner a4c8d67110 fixed improper use of negative value 2015-02-04 09:03:27 +01:00
Frank Morgner 761e175212 fixed sc_driver_version check 2015-02-04 08:52:30 +01:00
Frank Morgner 5cafbe0f4b fixed undefined shift behaviour 2015-02-04 08:50:19 +01:00
Frank Morgner ed9572422f check return values 2015-02-05 01:37:53 +01:00
Frank Morgner 47df45f5f2 set le instead of p2 twice 2015-02-05 01:37:53 +01:00
Frank Morgner 5e3d54186a removed useless check for non-null array 2015-02-05 01:37:53 +01:00
Frank Morgner ac4da89d0d use memmove for overlapping memory 2015-02-05 01:37:53 +01:00
Frank Morgner 53e1992cc2 use strerror for failure of gettimeofday 2015-02-05 01:37:53 +01:00
Viktor Tarasov 9cb4a09e30 readme.md: add jenkins build status 2015-02-03 09:45:40 +01:00
Viktor Tarasov 44ed1a3d6b readme.md: fix url of status icon 2015-02-03 09:27:16 +01:00
Frank Morgner 6a7875c4af use general travis-ci badge 2015-02-03 00:21:41 +01:00
Frank Morgner 2a7db13d34 Merge branch 'master' into coverity_scan
Conflicts:
	.travis.yml
2015-02-02 23:59:59 +01:00
Frank Morgner db0cb7557c Merge pull request #363 from frankmorgner/travis-ci
added travis-ci configuration
2015-02-02 23:51:54 +01:00
Frank Morgner 2f3eaa1dbe Merge pull request #366 from frankmorgner/coverity
Fixes for Problems reported by Coverity Scan
2015-02-02 23:51:10 +01:00
Viktor Tarasov 3047fe2c3b log: implement 'dump OID' 2015-02-02 17:03:33 +01:00
Viktor Tarasov 8e9a2361c6 pkcs15-tool: print length of EC public key
when this key is read from dedicated EF
2015-02-02 16:55:07 +01:00
Frank Morgner 6759c04b26 don't ignore errors 2015-01-28 04:45:08 +01:00
Frank Morgner 2e04fa99c1 fixed pointless array comparisons 2015-01-28 07:39:35 +01:00
Frank Morgner bd3cfcf5ef fixed copy/paste error 2015-01-28 07:26:34 +01:00
Frank Morgner b94c16394f card-asepcos: fixed puk handling 2015-01-28 07:25:46 +01:00
Frank Morgner 734cb67924 fixed algo ref 2015-01-28 07:23:34 +01:00
Frank Morgner 3a557ad0dd fixed parsing pace output data 2015-01-28 07:22:03 +01:00
Frank Morgner 92ad6eb63c fixed determining ef type 2015-01-28 07:21:55 +01:00
Frank Morgner 7fb495ac31 fixed self assignment 2015-01-28 07:10:57 +01:00
Frank Morgner ac0424e947 fixed pkcs11spy's version number 2015-01-28 07:09:02 +01:00
Frank Morgner b9f1fb333c fixed bad output data length 2015-01-28 07:07:33 +01:00
Frank Morgner 08fcfcc8f0 fixed wrong sizeof argument 2015-01-28 07:04:02 +01:00
Frank Morgner 87b2403673 fixed out of bounds access/write 2015-01-28 07:00:02 +01:00
Frank Morgner 68d86644fd fixed use after free 2015-01-28 06:10:16 +01:00
Frank Morgner b1b99ce7e5 fixed integer underflow 2015-01-28 06:03:52 +01:00
Frank Morgner 027e4a0867 fixed out of bounds read 2015-01-28 05:59:41 +01:00
Frank Morgner 7c497b324f fixed not null terminated buffer 2015-01-28 05:51:00 +01:00
Frank Morgner 77752f442d fixed unused value 2015-01-28 05:47:20 +01:00
Frank Morgner fdd38f6e04 fixed copy into fixed size buffer 2015-01-28 04:30:40 +01:00
Frank Morgner ea40322a30 added travis-ci configuration 2015-01-27 22:56:11 +01:00
Viktor Tarasov 02214dca86 coverity-scan: test build 2015-01-27 08:54:32 +01:00
Frank Morgner b6a935a261 fixed memory leak 2015-01-24 23:12:47 +01:00
Frank Morgner 00330b2c79 fixed resource leak 2015-01-24 22:16:22 +01:00
Frank Morgner 6641cbf455 fixed potential string overflow 2015-01-24 20:17:26 +01:00
Frank Morgner 3f64d3a805 fixed bad memory allocation 2015-01-24 20:11:16 +01:00