Commit Graph

30 Commits

Author SHA1 Message Date
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
Maciej S. Szmigiero 62cbda6cd9 Fix log messages format and parameter issues flagged by GCC
Since "Add GCC format checking attributes to log functions" commit GCC
warns us about problems with format strings and their arguments provided
to OpenSC message logging functions.

This commit fixes all cases where GCC warned about incorrect format on
64-bit Linux, 32-bit and 64-bit mingw builds (with SM and OpenSSL enabled).
Well, almost all since on mingw GCC does not recognize "ll" size specifier
(present at least since Visual Studio 2005, also in mingw own CRT) so these
(few) warnings about it remain.

In most cases format size specifier for size_t type was missing (usually
size was left at default int level, with is different on 64-bit x86).
Some formats had too few / too many arguments.
In some cases pointers were printed as integers.
Some long variables were missing "l" prefix (especially with regard to %x
format).

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2017-03-27 11:05:16 +02:00
Michał Trojnara 645780e6d4 NULL parameter check moved to sc_file_free()
This fixes numerous issues where the check is *not* performed,
and also simplifies the code.
2017-01-10 12:46:44 +01:00
Viktor Tarasov 0838520b62 rtecp: fix delete private key
when deleting private key, delete also it's internal public part
Fix #671
Fix #705
2016-03-10 10:33:42 +01:00
Aleksey Samsonov 6b2fcf825f Rutoken ECP: additional Miller-Rabin tests aren't needed
Make universal properties at RSF-files. Additional Miller-Rabin tests
aren't needed for 'Rutoken ECP' and for 'Rutoken ECP 2.0'

fixes https://github.com/OpenSC/OpenSC/issues/648 :
'Incorrect parameters in APDU' at 'Rutoken ECP 2.0' when 'pkcs15-init -G
rsa/1024 ...'
2016-01-24 01:34:05 +03:00
Aleksey Samsonov e1a3bf8805 Rutoken ECP: set more universally 'Attempts' for RFS-files 2016-01-24 01:14:21 +03:00
Frank Morgner 44253c63d0 pkcs15-rtecp: fixed resource leak 2015-05-08 09:11:54 +02:00
Viktor Tarasov e57d443e86 pkcd15init: remove trailing whitespaces
inspired by
http://www.opensc-project.org/pipermail/opensc-devel/2012-March/017883.html

Change-Id: I817f903e67965942d9cc0c30931dbaea0c5f736e
2012-04-02 23:40:05 +02:00
vtarasov d888b3fd55 pkcs15: use general 'AuthenticationObject' instead of 'PinObject'
now the attributes of the previous 'pin-info' data type are included
as the sub-type attributes of the general 'auth-info' data .
It will allow to include support of the 'biometricTemplate' and 'authKey' authentication types.

http://www.opensc-project.org/pipermail/opensc-devel/2011-May/016655.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5550 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-05 15:46:25 +00:00
vtarasov 438cf4b2d4 RuToken-ECP: profile option to allow the reset of User PIN with SoPIN
http://www.opensc-project.org/pipermail/opensc-devel/2011-May/016716.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5542 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-02 19:06:43 +00:00
vtarasov 5e50a14b3f libopensc: introduce 'key-params' data type that contains pointer, size and 'free' handler ...
http://www.opensc-project.org/pipermail/opensc-devel/2011-April/016441.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5413 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-01 19:18:14 +00:00
vtarasov 891f98363b pkcs15init: new 'emulation-store-data' operation ...
the first usage is to update the public key PKCS#15 object attributes 
and to encode it's direct value.
(support of the Oberthur's AuthentIC V3.2 card)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5001 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-30 12:50:35 +00:00
s 659db6f50b Fix: default count of attempt (use profile) for new version firmware
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4752 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-21 18:14:04 +00:00
ludovic.rousseau ecae106253 Fix warning: missing initializer
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4156 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:37:13 +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
s 839644bb4e add check params; fix: pkcs15-rutoken.c:208: warning: unused parameter 'puk'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4065 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-24 08:22:24 +00:00
viktor.tarasov 4dd6abf41b pkcs15init: in the prototypes of the internal procedures the 'struct sc_card' argument replaced with the 'struct sc_pkcs15_card' one
This patch is not largely tested and it will be followed (hope in a few hours) with another one 
that will replace the using of the static pincache 
with the pincache as the content of the AUTH pkcs15 object.

In the intervention into the card specific part I tried to respect its creator's coding style.
Sorry, if it's not always the case.




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4057 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 16:21:57 +00:00
s 709869785c fix: mis-usage of 'type' (PIN encoding style)
Thanks to Viktor TARASOV
http://www.opensc-project.org/pipermail/opensc-devel/2010-February/013454.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4037 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-17 17:19:14 +00:00
s 85613b459d rutoken (ECP): add 4 DF (reserved for internal use)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3996 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-04 12:18:19 +00:00
s 0a4c42ba06 rutoken (S and ECP): never unblock SO PIN
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3995 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-04 10:39:30 +00:00
s b4a24af66d rutoken (S and ECP): both PINs are globals (and addition to changeset 3960, 3946)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3990 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-03 12:10:41 +00:00
viktor.tarasov b065c70695 pkcs15init: abandon Old API
tested with Oberthur, CardOS and SetCOS.




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3981 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 14:50:56 +00:00
s 5320ca6fd1 Corrected GOSTR3410 public key structure
Working now with GOST R 34.10:
$ pkcs15-init --store-private-key key --key-usage sign,decrypt --auth-id 2 --id 1 --pin "12345678"
$ pkcs15-init --store-certificate my_cert --id 1 --pin "12345678"

But have problem: no CKA_GOSTR3410_PARAMS by retrieve pub_key from certificate, if pub_key object was removed (see parse_x509_cert, asn1_decode_gostr3410_params)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3859 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-19 15:41:03 +00:00
martin ea37069272 Merged r3749:3758 from trunk
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3759 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-05 20:10:07 +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
aj 0c2fe83c3b Aktiv Co./Aleksey Samsonov:
fix a bug in rutoken driver.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3711 c6295689-39f2-0310-b995-f0e70906c6a9
2009-07-22 12:24:33 +00:00
aj 7931ded481 Add new rutoken_ecp driver by Aktiv Co. / Aleksey Samsonov
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3696 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-24 15:26:37 +00:00