Commit Graph

86 Commits

Author SHA1 Message Date
Frank Morgner 3dede423e6 fixed Out-of-bounds access
Thanks to Coverity scan
2020-02-04 13:56:53 +01:00
Jakub Jelen e50bc29bd9 card-setcos.c: Avoid unsigned integer underflow
Thanks oss-fuzz

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=18798
2019-11-11 22:02:18 +01:00
Frank Morgner c3f23b836e fixed UNKNOWN READ
Reported by OSS-Fuzz
https://oss-fuzz.com/testcase-detail/5681169970757632
2019-11-03 04:45:28 +01:00
Frank Morgner 85485eb9b0 fixed unused assignments 2019-02-14 09:22:23 +01:00
Frank Morgner a899a46b09 replaced SC_TEST_RET with LOG_TEST_RET 2018-12-06 09:26:42 +01:00
Frank Morgner 00a150f74c replaced SC_FUNC_RETURN with LOG_FUNC_RETURN 2018-12-06 09:26:42 +01:00
Frank Morgner 24b50a4277 replace sc_debug with sc_log 2018-12-06 09:26:42 +01:00
Priit Laes 45f407c021 Mark driver-specific global sc_atr_table structures as const
As most of the drivers do not modify these, we can mark them as const.
Two drivers that we cannot convert are dnie and masktech.

section                 size
.data                  35232 ->   25472
.data.rel.ro           36928 ->   46688
2018-08-22 22:50:30 +02:00
Frank Morgner 83f45cda2a Added bounds checking to sc_simpletlv_read_tag()
- Logic is identical to sc_asn1_read_tag()
- Fixes out of bounds access e.g. in cac_parse_CCC
2018-08-14 15:50:13 +02:00
Frank Morgner 8fe377e93b fixed out of bounds reads
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting and suggesting security fixes.
2018-08-14 15:50:13 +02:00
Peter Marschall 5abe99d228 fix typos
Mass-typo fixing, almost exclusively in comments and text strings.

While at it also fixed a few (very few) grammar errors.
2018-04-15 09:34:45 +02:00
Frank Morgner c3ffdecd0b rename SC_SEC_ENV_KEY_REF_ASYMMETRIC to SC_SEC_ENV_KEY_REF_SYMMETRIC
This reflects the actual use of the identifier by the card drivers.
2018-03-09 14:36:55 +01:00
Henrik Andersson 74493ca73f Add support for RSA with keylength 2048
This solves sign issues with swedish eID cards which have
RSA keys with length 2048. This also solves the issue #726.
2016-05-16 11:12:53 +02:00
Frank Morgner bcb5fc15e5 honour HAVE_CONFIG_H 2015-04-22 23:55:33 +02:00
Frank Morgner 87b2403673 fixed out of bounds access/write 2015-01-28 07:00:02 +01:00
andbil 139333f85a Fix error when signing with Swedish BankID card
Added card type check in addition to check for SC_SEC_ENV_KEY_REF_PRESENT

Added card type check in addition to check for SC_SEC_ENV_KEY_REF_PRESENT
2014-09-07 22:19:00 +02:00
Frank Morgner 5d6c4b391d Merge pull request #253 from github-frankmorgner/remove-deadcode
card-asepcos: removed dead code
card-authentic: removed dead code
card-belpic: removed dead code
card-epass2003: removed dead code
card-flex: removed dead code
card-gpk: removed dead code
card-oberthur: removed dead code
card-piv: removed dead code
card-setcos: removed dead code
ctbcs: removed dead code
cwa14890: removed dead code
muscle: removed dead code
pkcs15-atrust-acos: removed dead code
pkcs15-gemsafeV1: removed dead code
pkcs15-skey: removed dead code
reader-ctapi: removed dead code
framework-pkcs15: removed dead code
pkcs11-object: removed dead code
pkcs15-asepcos: removed dead code
pkcs15-cardos: removed dead code
pkcs15-jcop: removed dead code
pkcs15-lib: removed dead code
pkcs15-oberthur: removed dead code
parse: removed dead code
sclex: removed dead code
sm-card-authentic: removed dead code
sm-card-iasecc: removed dead code
sm-cwa14890: removed dead code
sm-global-platform: removed dead code
sc-test: removed dead code
pkcs11-tool: removed dead code
pkcs15-tool: removed dead code
2014-09-07 21:22:43 +02:00
Martin Paljak 17bc2c8809 FINeID: fix for broken organisation cards.
Certain FINeID cards for organisations return 6A88 instead of 6A82 for missing files.
This makes sc_enum_apps fail and will result in unknown card behavior from OpenSC.

See http://www.opensc-project.org/pipermail/opensc-devel/2011-June/016910.html
2011-07-13 17:25:09 +03:00
Martin Paljak dcf9a8e0b2 setcos: remove useless #if 1 2011-06-17 12:12:38 +03:00
Martin Paljak 27572537ce FinnishEid: fix the symbolic names for FINeID v2 cards with 2048 keys and restore compatibility with v2 cards with 1024 keys.
The more proper name for the 2048bit cards could be "v2.5".

Thanks to jem@iki.fi, kivinen@iki.fi and tuju@iki.fi for the patch.
2011-06-15 14:10:37 +03:00
martin dffe79d559 SetCOS/FinEID: add support for cards issued after 01.03.2011
Thanks to Juha Tuomala & Tero Kivinen <kivinen@iki.fi> for the patch.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5502 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-24 19:08:55 +00:00
andre 213fa68ea0 card-setcos.c: Fixes misuse of SC_CARD_FLAG_ONBOARD_KEY_GEN. From [http://www.opensc-project.org/opensc/browser/trunk/src/libopensc/opensc.h?rev=5299#L411 opensc.h]:
#define SC_CARD_FLAG_ONBOARD_KEY_GEN    0x00000001
#define SC_CARD_CAP_APDU_EXT            0x00000001


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5300 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-07 15:38:22 +00:00
ludovic.rousseau 451121f9b5 Remove dead code
card-setcos.c:506:3: warning: Value stored to 'bKeyNumber' is never read
                bKeyNumber = 0;
                ^            ~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5162 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:34:04 +00:00
aj 6545b42c02 cleanup of the debug code:
* reduce to a few, supported functions.
* change all functions to take the debug level as parameter.
* use symbolic names for the debug levels.
* fix tools to pass "verbose"/"opt_debug" as ctx->debug.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4118 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-15 12:17:13 +00:00
aj d22a2483c0 Header file cleanup.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4081 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 08:14:36 +00:00
martin d006b1845e libopensc:
- Remove slot abstraction from internal API and all reader drivers. CT-API (from where it all comes from) readers with multiple slots (if still found) can be presented as separate readers, OpenCT should remove the slot abstraction, PC/SC never knew about it. None of the tools knew how to use slots.
 - Add sc_cancel (translates to SCardCancel)
 - Re-implement sc_wait_for_event; support a blocking call.
 - Replace the "int reader" API with "* sc_reader_t" style; add "Get reader by name" functionality.
 - Remove "action" parameter from sc_disconnect_card() (was not used)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3931 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-24 15:25:08 +00:00
martin 38ba3ad18d Remove card->finish() functions that do nothing
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3839 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 11:32:12 +00:00
martin d672fde449 Remove sc_error and sc_ctx_suppress_errors_* in favor of sc_debug/fprintf
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3721 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 08:46:59 +00:00
ludovic.rousseau caf4207090 setcos_match_card(): replace sc_error() by sc_debug() since some cards
are not SetCOS bug respond to the APDU: 00 CA DF 30 05


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3291 c6295689-39f2-0310-b995-f0e70906c6a9
2007-11-09 08:29:15 +00:00
aj ad79822134 convert to utf-8.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3085 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-19 21:32:31 +00:00
jps 462cd0defc Initial support for SetCOSXpresso (GemXpresso R4 with EID 2.x applet)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3070 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-08 14:56:09 +00:00
nils 88bae5c923 remove iso logout function, remove dummy logout functions and remove logout call from sc_unlock()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2971 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-17 12:24:04 +00:00
nils 8e170f689e initial support for the Swedish NIDEL card
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2873 c6295689-39f2-0310-b995-f0e70906c6a9
2006-03-09 20:35:19 +00:00
ludovic.rousseau fc763ba5d5 etcos_create_file_44(): use sizeof(pins)/sizeof(pins[0]) instead of a
constant (7)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2761 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-08 09:05:56 +00:00
aj 2f8b813d51 sizeof(int[7]) is 28. I think bCommands_pin should have 7 elements, too.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2717 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-05 21:41:14 +00:00
nils 47ee84e72d add functions
void sc_ctx_suppress_errors_on(sc_context_t *ctx);
	void sc_ctx_suppress_errors_off(sc_context_t *ctx);
to turn on/off error suppression (to avoid accessing
sc_context_t directly) and use it.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2671 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-30 19:08:06 +00:00
nils ff795fb1e6 bugfix for a potential segfault in card-setcos.c when the
acl "pointer" is one of the special values 1,2,3

Patch supplied by Jakub Bogusz <qboosh@pld-linux.org>


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2647 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-12 17:52:56 +00:00
nils 59cae4140b fix compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2585 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-12 21:09:12 +00:00
nils f6c95792fe let src/libopensc/ compile with -Wall -W -Wno-unused-parameter -Werror
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2546 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-07 08:33:55 +00:00
nils 61f894a2c3 yet another atr + cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2535 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-04 09:23:28 +00:00
sth bb2506cff9 Return the real pinref
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2521 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-26 19:33:52 +00:00
sth 4b574b7925 SetCOS 4.4.1 supports keypair generation, keysizes of 512, 768 and 1024 are fine
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2378 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-05 15:22:17 +00:00
nils bf089a8fbb cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2309 c6295689-39f2-0310-b995-f0e70906c6a9
2005-04-16 10:37:14 +00:00
nils ab52f802c7 fix compiler warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2302 c6295689-39f2-0310-b995-f0e70906c6a9
2005-04-09 13:32:22 +00:00
sth 3439f9cdd7 Added initial support for SetCOS 4.4 cards
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2291 c6295689-39f2-0310-b995-f0e70906c6a9
2005-04-04 09:30:54 +00:00
bert 2d97002824 API fixup: use defined type instead of struct for exposed structs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2232 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-08 20:59:35 +00:00
aet 3a118fb33f - Some fine-tuning to get previous, current
and future FinEID cards working.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2200 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-24 11:11:12 +00:00
aet 377afe0225 - Typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2189 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-14 09:13:05 +00:00
aet df5e357694 - Whitespace cleanup from me and Martin Paljak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2181 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-11 20:09:34 +00:00
aet 32b417cbf3 - First stab towards standardized card types
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2172 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-10 10:07:13 +00:00