Commit Graph

219 Commits

Author SHA1 Message Date
martin 12a1e9d49b pkcs15: don't override TokenInfo PRNG flag. pkcs11: announce CKF_RNG if the card driver supports it, bypassing PKCS#15.
GET CHALLENGE and RNG don't match 1:1 anyway.

Thanks to Andre Zepezauer for noticing this.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4661 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-01 06:23:17 +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
viktor.tarasov f18ba7d984 pkcs15: decode 'supportedAlgorithms' in 'TokenInfo'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4510 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-05 12:54:23 +00:00
viktor.tarasov be3670600b emulator fix #125: thanks to Thomas Harning: emulator specific 'clear' handler
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4255 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-18 16:38:49 +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 02768fb5dc remove "split-key" option and emulat sign for sign,decrypt keys with padding
and decrypt() for cardos.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4113 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-13 22:52:51 +00:00
viktor.tarasov 22f067863a libopensc emu: more general implementation of the postponed DF parsing
In previous version the card specific 'parse_df' handler was a part of 'sc_pkcs15_df'.

Now the placehold ('sc_pkcs15_operations') created for the all card emulator specific operations .


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4109 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-13 19:48:09 +00:00
viktor.tarasov 0027a21204 libopensc emu: sorry, fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4098 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-09 17:11:31 +00:00
viktor.tarasov 3a2f0415fe libopensc emu: postponed object loading
Some non-pkcs15 cards protect the reading of the private objects attributes. 

For the emulated pkcs15 cards, the 'init' emu-handler was the only place where pkcs15 objects could be loaded.
This handler is called before the card is binded, and so, for an application there was no 'normal' way to verify PIN and load the objects with protected attributes.

Actually it's possible to complete list of the pkcs15 objects after the emulated pkcs15 card has been binded. 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4096 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-09 16:49:00 +00:00
viktor.tarasov c837196134 libopensc: homogenize name of 'struct sc_pkcs15_card' parameters and variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4090 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-08 12:32:35 +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 1ef975fa51 #148: clear PIN cache in sc_pkcs15_unbind()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4069 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-24 10:42:36 +00:00
viktor.tarasov 258a867bbc libopensc: re-design 'sc_pkcs15_allocate_object_content' for the case when the 'new' and 'old' data pointers are the same
;change the prototype of 'sc_pkcs15_find_pin_by_type_and_reference' to eliminate the compilation warnings;


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4067 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-24 08:28:15 +00:00
viktor.tarasov 975d703c0d libopensc: remove unused variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4063 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 20:46:59 +00:00
viktor.tarasov 9c964e3d71 pincache: implement pincache as the content of the AUTH pkcs15 object
; in 'sc_pkcs15_pin_info' structure add 'auth_method' member to keep the PIN authentication method: CHV, AUT or SM;
; in pkcs15init profile add function to search PIN template by auth method and reference;
; in 'sc_pkcs15_remove_object' return silently if object to delete is NULL;
; in 'sc_pkcs15_object' structure add 'usage_counter' member;
; new 'sc_pkcs15_find_pin_by_type_and_reference' procedure to search PIN pkcs15 object by auth method and reference;
 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4048 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 22:04:07 +00:00
martin 30924e4e9d PKCS15: set the PRNG flag on PKCS#15 card object even if it was not set in TokenFlags if RNG capability is reported by the low level card driver.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4045 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 08:34:40 +00:00
viktor.tarasov b28add8e3b libopensc: in sc_pkcs15_object introduce the 'content' member
Replace not-used 'der' structure member by the 'content' one.

'Der' member was introduced to keep the ASN1 encoded object attributes. Actually it's not used.
'Content' is intended to keep the object value (AUTH object - pin cache value; CERT object - der value, ...)



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4008 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-09 14:45:07 +00:00
viktor.tarasov 909953d55a libopensc: separate 'remove' and 'free' pkcs15 object
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4007 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-09 14:05:54 +00:00
viktor.tarasov 5cd5728c0e libopensc: search pkcs15 objects: accept NULL value for the output argument
So that, the dummy object for the 'search pkcs15 object' calls is not neccessary. 



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3942 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-26 12:59:08 +00:00
aj f0484968a9 merge changes 0.11.11 -> 0.11.12
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3899 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-18 13:33:03 +00:00
martin bb9423c5f9 Remove unusued variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3831 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 11:13:35 +00:00
martin 3ea5bb7987 Merge [3804:3822/trunk]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3824 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 09:45:21 +00:00
martin 95a5ab0654 Re-implement PIN cache on PKCS#15 layer; remove it from PKCS#11. Re-name and log PKCS#15 options to better reflect the purpose.
Data objects and PKCS#15 init are left broken currently.



git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3784 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-22 08:59:59 +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
alonbl 8828faeccf Allow delete data objects by specifying application-name and label
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3608 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-28 21:28:53 +00:00
aj e243e7f322 make the sign_with_decrypt hack configureable.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3546 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-31 12:17:29 +00:00
aj 29d78fde39 move checks to pkcs15_bind, where we can look at the config.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3545 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-31 12:13:15 +00:00
ludovic.rousseau 4d098d9650 do not add a signature prefix for D-Trust cards
Thanks to Simon Eisenmann for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010609.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3303 c6295689-39f2-0310-b995-f0e70906c6a9
2007-12-07 09:46:21 +00:00
aj f7636ab5db Add same hack for Prime cards.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3236 c6295689-39f2-0310-b995-f0e70906c6a9
2007-08-03 07:47:13 +00:00
aj 14bc32dda2 Sign by using the decrypt function.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3223 c6295689-39f2-0310-b995-f0e70906c6a9
2007-07-20 12:19:27 +00:00
aj 4acfe6b096 fix compiler/sparse warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3177 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 10:07:01 +00:00
martin 9f1d63a56c Allow to specify at compile time that a card will work only via pkcs15 emulation. This way no matter what is
configured in the config file (try_emulation_first option) the card is usable via pkcs15 tools.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3099 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-05 16:20:50 +00:00
aj b3ad2f9dd2 convert to utf-8.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3084 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-19 21:31:17 +00:00
nils 01f72933af add support to parse the seInfo TokenInfo entry, improve aid support in opensc-explorer
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3045 c6295689-39f2-0310-b995-f0e70906c6a9
2006-10-30 18:51:48 +00:00
ludovic.rousseau 07b7abdccd c_asn1_toki[]: the serialNumber field is not mandatory in ISO 7816-15
see
http://www.opensc-project.org/pipermail/opensc-devel/2006-October/009025.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3041 c6295689-39f2-0310-b995-f0e70906c6a9
2006-10-04 07:00:15 +00:00
nils e2dea71ad4 restore backward compatibility: try READ BINARY in case of a unknown file type
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3039 c6295689-39f2-0310-b995-f0e70906c6a9
2006-10-02 16:49:26 +00:00
ludovic.rousseau 4a296307ac c_asn1_ddo[]: the oid field of the DDO is not mandatory in ISO 7816-15
See
http://www.opensc-project.org/pipermail/opensc-devel/2006-October/009022.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3038 c6295689-39f2-0310-b995-f0e70906c6a9
2006-10-02 13:46:00 +00:00
ludovic.rousseau 1ac9b2aba1 sc_pkcs15_make_absolute_path(): a 0 length path stays a 0 length pat
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3032 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-27 12:02:02 +00:00
henryk b45617c451 Make absolute paths from all paths read from the PKCS#15 directories by prepending the DF(PKCS#15) path if necessary.
Fixes compatibility with Siemens HiPath SIcurity formatted cards which use relative paths.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3028 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-26 10:55:02 +00:00
henryk 12c6b11bdd Fix handling for SIMPLE-TLV records with a three-byte length
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3027 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-26 10:43:28 +00:00
henryk 325b9480ea opensc-siemens.diff
Adds support for record-oriented files in linear variable, simple-tlv format.
TODO: Add support for all the other file formats, too.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3026 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-26 10:36:35 +00:00
henryk 5a0e1849d5 Make do { ... } while (...); into while (...) { ... };.
Fixes behaviour with empty files.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3025 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-26 10:31:03 +00:00
nils f087a937ff implement workaround for the Taiwanese id card
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3024 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-24 14:05:06 +00:00
nils d502887f55 bugfixes ...
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2995 c6295689-39f2-0310-b995-f0e70906c6a9
2006-07-13 20:35:17 +00:00
nils 9a5bf3602d initialize pointer
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2994 c6295689-39f2-0310-b995-f0e70906c6a9
2006-07-13 19:59:23 +00:00
aj 6287cf4d9b replace static buffer with dynamically allocated buffer.
patch by Tomasz Lemiech to fix a problem with setec cards.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2983 c6295689-39f2-0310-b995-f0e70906c6a9
2006-07-05 19:45:53 +00:00
aj 7dd7df4e7c Tomasz Lemiech wrote: I found that struct c_asn1_odf[] in pkcs15.c does not
define secretKeys object (as specified in PKCS#15 v. 1.1 standard, par. 6.2).
I consider this to be an omission. My Setec card contains objects of this type
and all PKCS#15 operations fail with "Unable to parse ODF". Attached patch
fixes this issue. 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2982 c6295689-39f2-0310-b995-f0e70906c6a9
2006-07-05 19:36:26 +00:00
ludovic.rousseau 2b8a2f4d90 sc_pkcs15_parse_tokeninfo() and sc_pkcs15_encode_tokeninfo() now use a
(sc_pkcs15_tokeninfo_t *) instead of struct (sc_pkcs15_card *)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2872 c6295689-39f2-0310-b995-f0e70906c6a9
2006-03-07 07:22:58 +00:00
martin 723888d623 Negative r has a meaning in the cached file logic, so be sure to reset it to -1
after sc_print_path has returned a value.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2819 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-23 17:29:59 +00:00
nils e8c05ca648 use more opensc specific names for ASN.1 tags to avoid name conflicts
with other ASN.1 libraries


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2815 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-20 20:52:36 +00:00
nils de4b5c280f - implement thread-safe path printing function sc_path_print() and use
it src/libopensc/ and src/pkcs15init/
- use size_t for the certlen parameter of sc_pkcs15init_update_certificate()


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2811 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-11 23:41:17 +00:00
nils ced2df6b1a remove unused variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2772 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-17 21:52:53 +00:00
sth 9df2cde416 Add support for reading and writing from/to an EF(UnusedSpace) file; this functionality can be used for deleting and creating pkcs15 objects (that reside in a file)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2769 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-17 19:53:12 +00:00
aj 686297304a check if scconf_find_blocks returned NULL.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2713 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-05 21:37: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 c7a8e84caf suppress errors in pkcs15 card detection if we don't know whether we really have a pkcs15 card
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2640 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-08 11:08:34 +00:00
aj ff62b88e1c big configure update.
use pkg-config for openct, openssl, pcsc.
do not compilke libp11. do not compile sslengines.
remove scdl. use libltdl instead.
use libassuan.m4 macro for m4 detection.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2528 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-01 14:01:58 +00:00
nils 9cbac71de9 decode preferredLanguage field if present
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2517 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-24 15:54:43 +00:00
nils f855074c27 check result of sc_file_dup + some cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2499 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-19 17:56:56 +00:00
sth f43d52476e The lengths of the ASN.1 entries are used outside the if blocks -> declare them outside the blocks
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2494 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-18 13:55:36 +00:00
martin fc3048f55e Remove the (stupid) use_pinpad option from pkcs15 structures
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2482 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-13 13:04:02 +00:00
nils 44384eccbf - Initial support for TokenUpdate;;lastUpdate field. Change pkcs15 caching
code to use the card serial number and lastUpdate field (if present) to
  specify the cache file. 
- consistently use unsigned data types to specify object types
- make sc_pkcs15emu_get_df a local function (it's not used outside
  pkcs15-syn.c and honestly I see no reason to export it).
- start of a new ChangeLog file (with some intial entries)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2466 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-05 16:24:35 +00:00
sth 37cd955055 Allow to seach a data object by it's application OID
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2457 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-03 09:05:09 +00:00
nils ac4dfc0e38 cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2292 c6295689-39f2-0310-b995-f0e70906c6a9
2005-04-04 21:52:31 +00:00
pisi b6f9aa561b A single flag for all pkcs15 layer applications to detect a) if pinpad is
present b) and if we should make use of it. Also remove the CCID specific
option for pinpad detection - if detected, the flag will anyway always be
set as it reflects the capabilities of the actual reader. Also, the
detection mechanism is changed to be crossplatform.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2236 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-09 11:45:29 +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 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 4dae83f550 - A fix for ISO 7816-15 cards I'm playing with. No feedback
received about the patch, let's move on. The patch shouldn't
  affect any current behaviour.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2179 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-11 10:05:54 +00:00
nils a82a40e977 some cleanup + improved error checking
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2051 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-03 17:20:17 +00:00
nils 8673508a43 fix memory leak, cleanup: use object specific release method
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2024 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-18 14:14:57 +00:00
nils 4bb760db4d cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1960 c6295689-39f2-0310-b995-f0e70906c6a9
2004-10-29 20:08:54 +00:00
nils 5985415603 some cleanup: 'int' -> 'unsigned int' for flags, 'int' -> 'size_t'
for length + remove some compiler warnings


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1940 c6295689-39f2-0310-b995-f0e70906c6a9
2004-10-17 20:20:59 +00:00
nils 5a328e3dcc update pkcs15 emulation stuff
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1916 c6295689-39f2-0310-b995-f0e70906c6a9
2004-10-08 21:29:55 +00:00
nils f044157553 fix incorrect use of realloc (x = realloc(x, y) doesn't free
the x in case of a failure)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1775 c6295689-39f2-0310-b995-f0e70906c6a9
2004-04-21 18:10:58 +00:00
aj 0b8ff3ce6a it is legal to read all bytes of the file (e.g. offset 0, len 10, fil->len 10).
Bug found by Antonio Iacono.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1758 c6295689-39f2-0310-b995-f0e70906c6a9
2004-03-28 20:30:58 +00:00
okir 13bf8814ef - in sc_pkcs15_read_file, properly destroy objects in case of error (Victor Tarasov)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1709 c6295689-39f2-0310-b995-f0e70906c6a9
2004-01-06 13:40:52 +00:00
okir 1780e10bf2 - Somewhat improved debugging output
- sc_pkcs15_print_id changed to sprintf to a buffer rather than printing
  to stdout.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1612 c6295689-39f2-0310-b995-f0e70906c6a9
2003-11-19 20:30:44 +00:00
okir d91ecdc245 - Moved sc_pkcs15_bind_synthetic to a separate file
- Moved sc_pkcs15_print_card to ../tests/print.c
- added dll_handle and preferred_language fields to p15card


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1583 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-31 12:26:24 +00:00
okir d3d7664c11 - Changed the internal object search machinery quite a bit so it
can search for more than one type of object at the same time.
- When enumerating a DF as part of the search, no longer ignore all
  errors.
- When parsing a DF, SC_ERROR_ASN1_END_OF_CONTENTS really means
  we've just reached the end of data in the file, so return 0
  instead


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1573 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-30 11:43:21 +00:00
okir 9e70efba8a - sc_pkcs15_find_pin_by_reference now searches by reference and path
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1548 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-21 11:02:48 +00:00
okir 734bceb682 - Error logging changes: replace ctx->log_errors with ctx->suppress_errors,
so that we can nest error suppression using suppress_errors++/suppress_errors--


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1518 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-14 09:56:50 +00:00
okir 3d283fd925 - fixed a bug in the previous patch
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1507 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-13 14:52:03 +00:00
okir 45e820cdac - added sc_pkcs15_find_prkey_by_reference
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1506 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-13 14:35:27 +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
aj c34eb2b147 find the keys by usage (patch by Nils Lars)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1290 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-22 15:51:17 +00:00
okir 64c62eb0db - patch for synthetic p15 cards by Nils Larsch
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1268 c6295689-39f2-0310-b995-f0e70906c6a9
2003-07-16 15:17:57 +00:00
okir 2abc504051 - remove signedness warnings printed by new gcc
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1176 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-30 08:54:42 +00:00
okir 27e105540e - added sc_pkcs15_find_pin_by_reference
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1114 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-15 11:27:38 +00:00
okir 8a3992a4db - bumped buffer sizes for EF(TokenInfo) labels
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1110 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-14 16:29:47 +00:00
sth 2fae230794 Make sc_pkcs15_read_file() work if the pkcs15 files contain only FIDs instead of file paths (Nils Larsch)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1099 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-13 07:06:29 +00:00
okir d2075b2c13 - implemented split-key support for CardOS
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1038 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-17 12:38:08 +00:00
okir 98907b68f1 - fixed endianness problem with encoding/deconding of bit fields
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1034 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-16 20:52:26 +00:00
sth b00a91c8af better fix then the previous for the assertion failed bug
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@981 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-09 20:19:42 +00:00
sth ae700e318b Fix: assertion failed (lock_count>=0) in sc_pkcs15_bind()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@979 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-04 09:52:39 +00:00
okir a7962eeed6 - stubs for "synthetic" pkcs15 tokens
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@970 c6295689-39f2-0310-b995-f0e70906c6a9
2003-04-03 09:46:26 +00:00
okir 8160bf64a1 - fixed typo in previous patch
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@901 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-05 15:43:51 +00:00
okir d1a122ce3b - fixed typo in previous patch
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@900 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-05 15:39:44 +00:00
okir af6cfb5537 - Support Belgian eID - be less pedantic about the AID listed in EF(DIR)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@899 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-05 14:45:48 +00:00