Commit Graph

45 Commits

Author SHA1 Message Date
Jakub Jelen 7360c4bf0c muscle: Avoid access uninitialized memory 2019-11-14 19:36:01 +01:00
Frank Morgner 1a069ca71e fixed Global-buffer-overflow READ 1
https://oss-fuzz.com/testcase-detail/5685978287308800
Thanks to OSS-Fuzz
2019-11-06 23:08:43 +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
Jakub Jelen 65e1cd2df7 muscle: Check return values 2018-10-01 23:07:34 +02: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 360e95d45a fixed out of bounds writes
Thanks to Eric Sesterhenn from X41 D-SEC GmbH
for reporting the problems.
2018-08-14 15:50:13 +02:00
Frank Morgner 410cdf0dcc refactored sc_get_challenge
Let sc_get_challenge() do sc_lock() and loop through the card driver's
get_challenge() until enough bytes were collected. The card driver's
get_challenge() now returns the number of bytes collected (less or equal
than requested) or an error code.

- Allow more code re-use.
- PIV driver now uses ASN.1 parser for reading the random bytes
2018-05-23 14:20:28 +02:00
Frank Morgner f04a2654d9 card-muscle: be more relaxed in card initialization
closes https://github.com/OpenSC/OpenSC/pull/1248
2018-05-18 12:36:28 +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 d719977d14 Reselect PKI-Applets after card reset
PKI-Applets may not be active if the card has been reset or unpowered.
The SELECT command used to activate the applet, is identical to the one
used during card matching or initialization.
2018-02-07 11:57:48 +01:00
Viktor Tarasov 205acbd573 coverify-scan: muscle: use return value 2016-03-10 11:23:39 +01:00
Hubitronic 5898eab373 Update card-muscle.c
re-enable opensc.conf flexibility again
2015-06-18 16:28:11 +02:00
drew thomas 5be35fb3f4 muscle: change TyfoneAT historical bytes to 'Tyfone 242R2'
Fixes #467
2015-05-16 11:59:58 +02:00
drew thomas 8b62221abc muscle: add ATR of Tyfone mSD card
Add Tyfone Connected Smart Card ATR to list for MUSCLE support.

SC_CARD_TYPE_MUSCLE_JCOP242_NO_APDU_EXT

Fixes #463
2015-05-13 09:50:21 +02:00
Frank Morgner bcb5fc15e5 honour HAVE_CONFIG_H 2015-04-22 23:55:33 +02:00
Frank Morgner 6759c04b26 don't ignore errors 2015-01-28 04:45:08 +01:00
Frank Morgner 4d5997dfba fixed selection of muscle applet for some JCREs
Previously, partial DF name selection was used, which is not mandatory
to implement for a JCRE. We now use the full DF name which must always
be implemented.

Note that the MUSCLE applet is deprecated and should not be used.

fixes #135
2014-12-12 22:40:20 +01:00
andre 93baf137c3 libopensc: Fix for drivers returning an error if a challenge of length zero was requested. Actually nothing is done when obtaining such a challenge, thus nothing could fail.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5564 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-09 10:59:04 +00:00
andre 69c846f904 libopensc: Re-defines SC_CARD_FLAG_ONBOARD_KEY_GEN to be local to the file card-flex.c, because that flag is used nowhere else. In principle, this patch only reverts some changes made by r2192.
Relates to #296.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5312 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-08 13:30:32 +00:00
andre b21eeb46b9 libopensc: Removes unused flag SC_CARD_CAP_RSA_2048.
Relates to [http://www.opensc-project.org/opensc/ticket/296#comment:1 #296].

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5308 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-07 18:16:40 +00:00
martin a5ca648afd Revert r4668. Change the way limitations on max send and receive sizes are set.
See http://www.opensc-project.org/pipermail/opensc-devel/2010-September/014836.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4706 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-09 18:58:44 +00:00
martin b7e25bb407 Fix MuscleApplet version detection
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4514 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-05 17:54:12 +00:00
martin 3d511b8610 MuscleApplet: Check for protocol version to be forward-compatible. Remove some whitespace. Remove support for <1024b keys.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4411 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-10 14:49:54 +00:00
martin 268e6270d8 MuscleApplet: Don't set the file ID as the name of the file. It is redundant and does not look nice.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4410 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-10 09:08:00 +00:00
martin 98037b795d MuscleApplet: Detect MuscleApplet specific SW-s; re-organize the source a little.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4350 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-14 13:37:48 +00:00
martin 290d1cb4d6 Muscle: use MuscleApplet as the name of the card as well as driver
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4349 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-14 07:40:02 +00:00
martin bfa340ba51 MuscleApplet: remove useless card detection flagging, don't call the default driver init operation.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4348 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-14 07:39:58 +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 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
jps 8529b7ba3e Add support for JCOP31 v2.4.1 with the modified muscle applet[1].
This add support for 2048bit key and extended APDU.

[1] http://www.opensc-project.org/pipermail/opensc-user/2009-June/003147.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3708 c6295689-39f2-0310-b995-f0e70906c6a9
2009-07-02 13:59:38 +00:00
ludovic.rousseau 04a5c99f77 Detect the eToken 72K and activate RSA 2048 and extended APDU for it.
Thanks to Joao Poupino for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2009-March/011978.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3671 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-25 13:55:25 +00:00
ludovic.rousseau e928d5565c convert C++ in C comment
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3502 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:57:03 +00:00
aj 4f0329cd18 silence more gcc/sparse warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3180 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 12:01:39 +00:00
aj 047ee1d73e fix more warnings found by gcc/sparse.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3178 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 11:07:00 +00:00
martin 30d0066a58 Stop MS visual studio 2005 complaints.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3103 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-06 16:35:38 +00:00
aj 38720ba5e1 update to latest muscle code.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3080 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-18 21:58:16 +00:00
aj 5610edfc2f Thomas Harning: patch to fix the MuscleCard driver to work in the
case of forced drivers.  drv_data is used as a flag so that muscle_init
knows if the applet has been selected during initialization.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3068 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-07 10:35:40 +00:00
aj b3822c349b update the MuscleCard driver for OpenSC to use an msc_id struct rather than
int/bytes and messing around with byte-swapping for that. (by Thomas Harning)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3067 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-30 08:14:16 +00:00
aj ef012c94f5 Thomas Harning: sc_list_files doesn't return the length of the
applicable buffer, but instead the # of files. Fixed.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3047 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-02 06:55:29 +00:00
sth bf23c032ca Endian-independent way to convert numbers to a byte array + vice versa
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2979 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-27 17:49:19 +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
sth 50490acca0 Added support for MuscleCard applet. Thanks to Thomas Harning, David Corcoran of Identity Alliance
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2968 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-07 08:33:37 +00:00