Commit Graph

34 Commits

Author SHA1 Message Date
Frank Morgner 24b50a4277 replace sc_debug with sc_log 2018-12-06 09:26:42 +01: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
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
ludovic.rousseau 80ed46d689 Remove dead code
pkcs15-starcos.c:158:3: warning: Value stored to 'p' is never read
        *p++ = ipf_file->size & 0xff;
         ^~~
pkcs15-starcos.c:128:3: warning: Value stored to 'p' is never read
        *p++ = 0x00;    /* SM ISF: no */
         ^~~
pkcs15-starcos.c:239:3: warning: Value stored to 'p' is never read
        *p++ = ipf_file->size & 0xff;
         ^~~
pkcs15-starcos.c:206:3: warning: Value stored to 'p' is never read
        *p++ = 0x00;            /* SM ISF: no */
         ^~~
pkcs15-starcos.c:636:4: warning: Value stored to 'p' is never read
                *p++ = 0x00;
                 ^~~
pkcs15-starcos.c:613:4: warning: Value stored to 'p' is never read
                *p++ = (u8) kinfo->key_reference;       /* CHA byte */
                 ^~~
pkcs15-starcos.c:699:3: warning: Value stored to 'p' is never read
        *p++ = (u8) kinfo->key_reference;       /* CHA */
         ^~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5145 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 20:46:24 +00:00
vtarasov 5ab90b9219 libopensc: avoid using of the not completely initialized 'sc_path' variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5106 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-18 09:48:26 +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
andre 5c6afb6bed Add missing initializers. Left over from r4508.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4952 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-16 01:47:03 +00:00
ludovic.rousseau f47416d60e Do not cast the return value of malloc(3) and calloc(3)
From http://en.wikipedia.org/wiki/Malloc#Casting_and_type_safety
" Casting and type safety

malloc returns a void pointer (void *), which indicates that it is a
pointer to a region of unknown data type. One may "cast" (see type
conversion) this pointer to a specific type, as in

int *ptr = (int*)malloc(10 * sizeof (int));

When using C, this is considered bad practice; it is redundant under the
C standard. Moreover, putting in a cast may mask failure to include the
header stdlib.h, in which the prototype for malloc is found. In the
absence of a prototype for malloc, the C compiler will assume that
malloc returns an int, and will issue a warning in a context such as the
above, provided the error is not masked by a cast. On certain
architectures and data models (such as LP64 on 64 bit systems, where
long and pointers are 64 bit and int is 32 bit), this error can actually
result in undefined behavior, as the implicitly declared malloc returns
a 32 bit value whereas the actually defined function returns a 64 bit
value. Depending on calling conventions and memory layout, this may
result in stack smashing.

The returned pointer need not be explicitly cast to a more specific
pointer type, since ANSI C defines an implicit conversion between the
void pointer type and other pointers to objects. An explicit cast of
malloc's return value is sometimes performed because malloc originally
returned a char *, but this cast is unnecessary in standard C
code.[4][5] Omitting the cast, however, creates an incompatibility with
C++, which does require it.

The lack of a specific pointer type returned from malloc is type-unsafe
behaviour: malloc allocates based on byte count but not on type. This
distinguishes it from the C++ new operator that returns a pointer whose
type relies on the operand. (see C Type Safety). "

See also
http://www.opensc-project.org/pipermail/opensc-devel/2010-August/014586.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4636 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-18 15:08:51 +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
viktor.tarasov aff7b5523c pkcs15init: homegenize pin reference type in a different structures; remove unused parameters in the internal procedures;
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4088 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-05 10:37:11 +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
viktor.tarasov 535131adda pkcs15init: instead of static keycache use the pincache as a content of the pkcs15 AUTH object
Tested with cards:
CardOS v4.3B;
SetCOS 4.4.1B;
Oberthur;
Cryptoflex 16k, 32k e-gate, 32k e-gate token;
GPK 8K;
Athena;
Aventra;
Fetian;
Rainbow 3000 (STARCOS SPK 2.3)




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4058 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 18:24:41 +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
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
viktor.tarasov 39a70345b9 pkcs15init profile: 'private key' as BSO is differenciated from the one as EF
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3920 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-21 10:07:40 +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
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 418e87f944 select file even if no acl for writting is set; patch supplied by Tarasov Viktor <vtarasov@idealx.com>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2559 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-09 07:15:03 +00:00
sth b5e2a2afff Added support for deleting pkcs15 objects, each card driver should implement its delete_object() operation in order to support it
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2506 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-22 09:20:13 +00:00
nils d6e5facb0d make old compilers happy
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2487 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-14 22:33:43 +00:00
nils 4d48735d10 initialize sc_pkcs15init_operations at compile time
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2480 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-10 21:31:18 +00:00
nils 45a9d05830 cleanup, mostly signed/unsigned issues
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2469 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-08 10:22:14 +00:00
nils 148b7900f7 Add support for the lastUpdate field to pkcs15init. Add flag to
indicate whether some data has been changed to the profile structure
and set the flag in the functions which change the card contents.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2468 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-05 19:07:24 +00:00
martin 0838631107 scrandom interface is not used by starcos
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2308 c6295689-39f2-0310-b995-f0e70906c6a9
2005-04-16 10:21:36 +00:00
bert eb4717ea17 API fixup: use defined type instead of struct for exposed structs (part 2)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2233 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-09 00:04:44 +00:00
nils 5847b646f9 cleanup: -index shadows a variable in /usr/include/string.h
-some signed vs. unsigned issues
         -and some const cleanup


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2039 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-22 09:48:27 +00:00
aet 55e170e0ac - Build / warning fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2014 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-15 13:53:36 +00:00
nils 1249c9c2ab fix starcos spk 2.3 "onepin" profile support
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1908 c6295689-39f2-0310-b995-f0e70906c6a9
2004-09-28 20:06:04 +00:00
nils c222271165 bugfix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1893 c6295689-39f2-0310-b995-f0e70906c6a9
2004-08-21 14:24:39 +00:00
nils f8c603f559 update starcos spk 2.3 pkcs15-init support
change summary:
- some bug fixes
- support for global so-pins
- use so-pin (if present) to protect key creation etc.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1891 c6295689-39f2-0310-b995-f0e70906c6a9
2004-08-21 10:53:09 +00:00
nils 504fe28dc2 clean up access rights for updating pin/puk
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1800 c6295689-39f2-0310-b995-f0e70906c6a9
2004-06-22 17:46:45 +00:00
nils 846a14849e initial pkcs15-init support for starcos spk 2.3 cards/tokens
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1764 c6295689-39f2-0310-b995-f0e70906c6a9
2004-04-17 09:20:08 +00:00