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
aet
73aa989875
- Unify a bit the output of commands like opensc-tool -D
...
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2166 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-09 14:47:46 +00:00
aet
42ecafabb8
- Cleanup
...
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2163 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-09 14:05:55 +00:00
aet
91fb274b1a
- Checkpoint commit, add support for the next generation FinEID
...
cards with ISO/IEC 7816-15 layout.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2161 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-09 11:37:25 +00:00
aet
69d2e9014d
- Optimize a few cpu cycles from _sc_match_atr_hex
...
- Replace struct sc_atr_table / _sc_match_atr with
recently introduced _hex variants
- Rewrote _add_atr
- Introduce int type variable to sc_card_t, so that
every other card driver won't have to glue around
with this
- Card driver cleanups, optimize the number of
sc_match_atr called per card driver. Also
always try direct match with _sc_match_atr
first, before relying on eg. historical bytes
information on some card drivers
- Fixed a memory leak from the miocos driver
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2145 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-06 19:40:40 +00:00
aet
bd0f86f69c
- Unify all card drivers ATR matching code to use _sc_match_atr_hex,
...
untested as of yet.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2134 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-04 20:29:35 +00:00
aet
5616dba08e
- Stop using unflexible automake conditionals when
...
building PC/SC, OpenCT or USBToken support,
use ifdef's directly in source.
- Because of above, add HAVE_PCSCLITE for winconfig.h
- Remove unnecessary includes for log.h, opensc.h and
errors.h in libopensc sources, they're already taken
care by internal.h.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1406 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-03 09:28:55 +00:00
aet
763fc16704
Rename libopensc specific error/debug to sc_error/sc_debug
...
We should have done this ages ago.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1392 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-25 14:21:18 +00:00