Commit Graph

3577 Commits

Author SHA1 Message Date
martin 409284ed60 opensc-tool: Fix ACL reporting for EF-s. Patch by Emanuele Pucciarelli.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4623 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-14 12:18:27 +00:00
martin 9f639f48c4 Add back MAX_ATR_SIZE which was erroneously removed in r4611. Fixes mingw32 build.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4622 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-13 09:27:38 +00:00
ludovic.rousseau 7ac66ae4cf Correctly use pin2 when needed.
Patch from OpenSUSE.

Closes ticket #249.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4621 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-12 21:49:14 +00:00
ludovic.rousseau c7a99c2e03 Use || instead of | in a #if check
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4619 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-30 07:09:15 +00:00
martin 5c2c12bb78 Trac #244: Fix structure packing on Apple and SUN. Fix display detection by updating structure definitions.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4611 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-26 13:16:37 +00:00
martin 11dc9ba797 cardos-tool: fix handing of --help/--verbose/--debug
--debug was not documented and not used by other tools; --help was not handled.

Thanks to Ludolf Holzheid for noticing this.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4596 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-26 11:18:00 +00:00
martin 002843c140 pkcs15-init: fix help text ordering (Ludolf Holzheid)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4595 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-26 11:17:57 +00:00
viktor.tarasov 13a42de128 pkcs11 tool: fix messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4593 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-21 09:50:10 +00:00
flc 764c1d9183 minors log message corrections to build successfully.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4586 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-20 07:51:07 +00:00
viktor.tarasov 006c30c2e0 #245: pkcs15 asn1: 'subjectName' in 'commonPrivateKeyAttributes' is optional
thanks to Jean-Michel


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4518 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-08 08:09:46 +00:00
viktor.tarasov 3ea6b28405 #229: pkcs15init entersafe: 'sanity-check' includes the update of the User PIN's 'pinFlags'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4516 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-06 12:40:56 +00:00
viktor.tarasov 3a3c41a6db pkcs15: encode/decode 'AccessControlRules' in 'CommonObjectAttributes'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4515 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-06 09:09:04 +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
viktor.tarasov 1090d19d30 #60: pkcs11-tool: print key sizes from CK_MECHANISM_INFO
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4513 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-05 14:43:31 +00:00
viktor.tarasov b78d7630e7 pkcs15: encode/decode 'subjectName' in 'CommonPrivateKeyAttributes'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4512 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-05 13:29:10 +00:00
viktor.tarasov f85b625b47 pkcs15: correct the comments
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4511 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-05 12:57:10 +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 1d82e8abab re-distribute 'define' macros between types.h and opensc.h
move 'define' macros closer to the definition of the related data types


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4509 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-05 09:33:51 +00:00
viktor.tarasov ae14336221 pkcs15init: create frame to implement card specific 'sanity check' procedure
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4508 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-02 14:26:29 +00:00
viktor.tarasov 2883c17b15 pkcs15init: homogenize argument order of pkcs15init operations
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4507 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-02 13:46:13 +00:00
viktor.tarasov 765ea98cfb tools opensc-explorer: for 'apdu' command accept space separated hexadecimal data
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4500 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-01 12:31:52 +00:00
viktor.tarasov bd5c186767 pkcs15/pkcs11: encoding of certificate's attribute 'serialNumber'
Applying patch of Andre Zepezauer. Thanks.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4451 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-21 10:49:58 +00:00
martin bcc4500f24 pkcs15-init: only override --verbose to ctx->debug if it was set on command line.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4423 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-16 21:04:36 +00:00
martin d40da986db Revert "pkcs15-init tool: with the new option 'use-default-debug-settings' the debug settings from opensc.conf are used"
This reverts commit b7d492fbae.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4422 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-16 15:08:14 +00:00
martin d61e7b5ba1 OSX: For Tokend, set the debug file by default to /tmp/opensc-debug.log
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4421 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-16 14:12:27 +00:00
martin df64d39f68 westcos-tool: remove compiler warnings
westcos-tool.c: In function ‘main’:
westcos-tool.c:375: warning: unused variable ‘lecteur’
westcos-tool.c:373: warning: unused variable ‘card_presente’
westcos-tool.c:372: warning: unused variable ‘p’
westcos-tool.c:371: warning: unused variable ‘i’
westcos-tool.c: At top level:
westcos-tool.c:43: warning: ‘version’ defined but not used
westcos-tool.c:45: warning: ‘nom_card’ defined but not used
westcos-tool.c:103: warning: ‘no_lecteur’ defined but not used

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4420 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-16 14:11:39 +00:00
martin ea7a0ac9a1 pkcs11: move the slot list size check to slot creation.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4419 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-16 13:43:10 +00:00
martin bfe5b4a965 style: space -> tab
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4418 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-16 13:43:05 +00:00
martin 02f4507564 pkcs11: Patch from Andre Zepezauer to remove max_virtual_slots allocation.
See http://www.opensc-project.org/pipermail/opensc-devel/2010-June/014356.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4417 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-16 13:42:59 +00:00
martin 48615686ac style: // -> /* */
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4416 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-16 12:01:04 +00:00
ludovic.rousseau e6803d9ca0 Use CK_RV (defined as unsigned long) instead of int for the type the
return code of C_* functions

Thanks to Martin Vogt for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2010-June/014351.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4415 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-16 11:43:10 +00:00
ludovic.rousseau eab7adea12 pkcs11-global.c: In function ‘C_WaitForSlotEvent’:
pkcs11-global.c:624: warning: unused variable ‘ii’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4414 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-16 11:32:21 +00:00
martin 0d01cb1cd1 Rename p15emu-westcos.c to pkcs15-westcos.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4413 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-11 07:36:01 +00:00
martin 3cfc64ee6b style: // -> /* */
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4412 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-11 07:35:45 +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 a1c77b96ab Entersafe: cache the presented PIN on personalization, simplify the code a bit.
See http://www.opensc-project.org/pipermail/opensc-devel/2010-June/014312.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4408 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-09 13:53:11 +00:00
martin 8737ace703 Entersafe: the default profile should have local PIN-s
See http://www.opensc-project.org/pipermail/opensc-devel/2010-June/014310.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4406 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-09 11:18:22 +00:00
martin ce0645d6d1 Fix compilation without OpenSSL
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4404 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-09 10:06:42 +00:00
jps f9daf30bba cardos-tool.c can be now compiled with OpenSSL 0.9.7 (SHA256 checksum verification is replaced by SHA1)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4401 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-08 14:41:49 +00:00
martin 127136caf8 tools: Mac OS X 10.5 uses OpenSSL 0.9.7 which does not include SHA256 support. Fix building for 10.5.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4400 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-08 10:45:07 +00:00
s 06028a7f9e fix:
openssl (lock_dbg_cb): already locked (mode=9, type=30) at eng_list.c:360                                      
openssl (lock_dbg_cb): not locked (mode=10, type=30) at eng_table.c:186\

Thanks to Jan Just Keijser for development and patch
http://www.opensc-project.org/pipermail/opensc-devel/2010-June/014314.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4398 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-05 08:51:37 +00:00
s 7f3f6dec6b fix: 'openssl: double free or corruption' (load gost engine before loading engine_pkcs11 (which loading gost engine))
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4397 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-04 22:23:47 +00:00
martin 073ad7a4c4 Fix #223: implement ctbcs_build_modify_verification_apdu.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4396 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-01 12:28:30 +00:00
martin 6f52711280 CT-API: Fix the mess left from broken [3931] and some pieces from [4118].
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4395 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-01 12:28:23 +00:00
martin 68f12c881d Fix a segfault leftover from r4118
Thanks to Andre Zepezauer for the report and patch.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4391 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-31 16:49:55 +00:00
s a4e3273298 Rutoken S: add 'aid' to profile (for '-init --create-pkcs15 --so-pin 87654321 --so-puk -p rutoken+small')
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4390 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-30 13:54:54 +00:00
s 15d51479ae fix: SIGSEGV
Program received signal SIGSEGV, Segmentation fault.
0x00007f7d6f29fd55 in free () from /lib64/libc.so.6
(gdb) bt
#0  0x00007f7d6f29fd55 in free () from /lib64/libc.so.6
#1  0x00007f7d703a4128 in sc_update_dir (card=0x17463a0, app=<value optimized out>) at dir.c:306
#2  0x00007f7d7040cb58 in sc_pkcs15init_add_app (card=<value optimized out>, profile=0x1754840,
    args=<value optimized out>) at pkcs15-lib.c:2354



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4389 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-30 13:52:04 +00:00
s 0f74f69695 fix: memory leak (but see FIXME)
==21111== 1,360 (120 direct, 1,240 indirect) bytes in 1 blocks are definitely lost in loss record 107 of 109
==21111==    at 0x4C24F0D: realloc (vg_replace_malloc.c:476)
==21111==    by 0x409D23: sc_pkcs11_register_mechanism (mechanism.c:44)
==21111==    by 0x410595: pkcs15_bind (framework-pkcs15.c:3160)
==21111==    by 0x4085DD: card_detect (slot.c:214)
==21111==    by 0x408887: initialize_reader (slot.c:114)
==21111==    by 0x404C50: C_Initialize (pkcs11-global.c:247)
==21111==    by 0x4034C9: main
==21111==
==21111== LEAK SUMMARY:
==21111==    definitely lost: 120 bytes in 1 blocks



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4388 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-30 07:56:34 +00:00
s a91e77187b fix: memory leak - next object missed out to release
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4387 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-30 07:52:14 +00:00
s c5c649e0ea fix: memory leak
example:

int main()
{
        C_Initialize(NULL);
        C_Finalize(NULL);
        return 0;
}

==4625== 592 (504 direct, 88 indirect) bytes in 1 blocks are definitely lost
in loss record 9 of 10
==4625==    at 0x4C24137: calloc (vg_replace_malloc.c:418)
==4625==    by 0x407FD9: create_slot (slot.c:80)
==4625==    by 0x40452C: C_Initialize (pkcs11-global.c:243)
==4625==    by 0x40342A: main
==4625==
==4625== 4,736 (4,032 direct, 704 indirect) bytes in 8 blocks are definitely
lost in loss record 10 of 10
==4625==    at 0x4C24137: calloc (vg_replace_malloc.c:418)
==4625==    by 0x407FD9: create_slot (slot.c:80)
==4625==    by 0x408102: initialize_reader (slot.c:108)
==4625==    by 0x4044E0: C_Initialize (pkcs11-global.c:247)
==4625==    by 0x40342A: main
==4625==
==4625== LEAK SUMMARY:
==4625==    definitely lost: 4,536 bytes in 9 blocks



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4386 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-30 07:31:31 +00:00
viktor.tarasov 78d6bc4189 pkcs15init: fix undeclared variable
Noted by Jean-Michel, thanks.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4383 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-27 08:12:20 +00:00
viktor.tarasov fff1963931 pkcs15init: do not reuse existing file when storing object data or updating certificate
merged with r4380:4380 of https://www.opensc-project.org/svn/opensc/branches/vtarasov/opensc-sm.trunk



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4382 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-26 14:33:01 +00:00
viktor.tarasov fec213ad2e pkcs11: DER encoded value for CKA_SERIAL_NUMBER
discussed in http://www.opensc-project.org/pipermail/opensc-devel/2010-May/014264.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4375 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-25 08:06:28 +00:00
s 2d3722389d fix: Rutoken S: no need to reserve 5000 bytes for AppDF (pkcs15.profile: size = 5000)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4365 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-19 19:49:12 +00:00
viktor.tarasov 73c516a7a0 pkcs11: resolve 'endless polling' in C_WaitForSlotEvent()
http://www.opensc-project.org/pipermail/opensc-devel/2010-April/013947.html

Tested with Firefox 3.6.3 in WinXP SP3 .




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4363 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-19 09:18:38 +00:00
viktor.tarasov d9b0d643de libopensc: in sc_pkcs15_verify_pin() if no PIN provided try to use pin pad
It's a complement to the r4361.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4362 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-19 08:37:29 +00:00
viktor.tarasov e23756123e pkcs15init: when verifying PIN, if no value supplied, try to use pin pad
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4361 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-19 08:26:01 +00:00
viktor.tarasov 99c51c6748 libopensc: do not invalidate card cache in sc_unlock()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4360 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-19 08:18:34 +00:00
viktor.tarasov ffc9f8efc6 pkcs11: by default do not lock login
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4359 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-19 08:17:53 +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
s 46def8b86c fix: loading openssl engine with GOST algorithms
Thanks to Jan Just Keijser, Martin Paljak, Andreas Jellinghaus, Robert Relyea, Dimitrios Siganos

see:
http://www.opensc-project.org/pipermail/opensc-devel/2010-April/013956.html
http://www.opensc-project.org/pipermail/opensc-devel/2010-April/013966.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4347 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-13 21:57:28 +00:00
viktor.tarasov ed610517d7 plcs11: set default value for 'lock_login' to 'true' as it' stated by
the commets in opensc.con.in

At the origin there were problem of signing with Feitian card, noted by
Ludovic.

http://www.opensc-project.org/pipermail/opensc-devel/2010-May/014180.html




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4346 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-13 17:47:04 +00:00
viktor.tarasov 39642a5d93 in feitian profile set 'local' flag for the User PIN
so that Feitian card profile will reflect the real card initialisation.

At the origin there were problem of signing with Feitian card, noted by Ludovic.

http://www.opensc-project.org/pipermail/opensc-devel/2010-May/014180.html





git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4345 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-13 17:45:43 +00:00
flc 6f1683d7bd wetcos-tools: add util.c to compile.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4339 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-11 14:40:10 +00:00
flc 5ae92ebcec clean some code and use more opensc standard
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4336 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-11 14:34:39 +00:00
flc a4df57eb4d --wait option don't need argument
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4335 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-11 14:30:15 +00:00
ludovic.rousseau e63d12bc8f replace spaces by tab
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4326 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-10 14:35:43 +00:00
viktor.tarasov 922d7cdc66 add TODO comments
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4325 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-10 09:18:49 +00:00
flc 0ad7704247 westcos pkcs15 emulate certificat or public key not both
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4310 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-07 12:49:53 +00:00
flc 9e74991250 Add cardmod pcsc protocol detection
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4288 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-05 09:31:44 +00:00
viktor.tarasov 140f3d0d98 liopensc: fix debug message
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4283 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-03 15:44:27 +00:00
viktor.tarasov ac41eba3ac win32: merge the branches/vtarasov/opensc-sm.trunk
update win32 compilation;
Unix style line ending in src/pkcs15init/pkcs15-oberthur.h;
variables declaration issue in src/tools/cardos-tool.c.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4280 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-01 12:15:36 +00:00
viktor.tarasov f505d4f5be pkcs15-init tool: remove blank line after PIN was prompted
Noted by Martin.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4273 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-28 09:20:19 +00:00
viktor.tarasov f17ca0fd74 tools: in local 'getpass' procedure getline() is not used any more
Without GNU C extention 'getline()' the same code of the local 'getpass' procedure is used for Mac OS and Linux.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4272 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-28 09:20:18 +00:00
viktor.tarasov d5f201bcb5 pkcs15init: in sc_pkcs15init_update_file() take care about file selection errors
Noted by Ludovic.

In sc_pkcs15init_update_file() procedure the file selection errors other then SC_ERROR_FILE_NOT_FOUND were not treated.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4271 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-28 09:20:17 +00:00
ludovic.rousseau b6fb4ff84a Change in r4269 is not correct since sc_pkcs1_strip_02_padding() returns
an int and not a size_t
The new code is also simpler


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4270 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-28 09:16:27 +00:00
jps 71598ad460 r4208 breaks key unwrap.
pkcs11-tool -tl gives an error and mail can not be anymore decrypted (tested with Thunderbird).


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4269 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-27 13:25:17 +00:00
viktor.tarasov 7d5b34d4e8 tools: thanks to Andreas; for win32 'get password' procedure uses _getch() instead of getchar()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4268 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-27 07:30:38 +00:00
viktor.tarasov 25fa645b90 pkcd15-tool: use local 'getpass' procedure
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4267 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-26 12:29:44 +00:00
viktor.tarasov 122d357fde tools: thanks to Ludovic; check for getline() in configure.ac and use 'HAVE_GETLINE' macro in get password procedure.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4266 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-26 12:29:42 +00:00
viktor.tarasov 06f5b0ba5b pkcs15init: when updating certificate and when there are no ACLs in FCI of selected file use default ACLs from the card profile
Some cards do not include security attributes into the FCI returned by 'SELECT' command.
    For such cards, when updating certificate, to authenticate 'UPDATE' operation use the
    'sc_file' with default ACLs instantiated from the card profile.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4265 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-24 17:37:02 +00:00
jps aa4d951101 Support for CardOS 4.4
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4264 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-21 14:38:23 +00:00
ludovic.rousseau ba04831e34 sc_to_cryptoki_error(): check for the validity of ctx outside of the
for loop to make the code more natural


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4263 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-21 11:57:10 +00:00
viktor.tarasov 0400a2dc35 pkcs11: make possible context dependent 'sc' to 'cryptoki' error conversion
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4262 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-21 10:51:13 +00:00
viktor.tarasov 8f4ee1b6e4 pkcs15init: fix #96: more details for the load profiles error
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4261 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-20 17:09:26 +00:00
viktor.tarasov 34841669a2 fix #118: thanks to Andreas: list algorithms in opensc-tool
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4260 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-20 15:43:44 +00:00
viktor.tarasov 1966822aa7 fix 201: thanks to Christian Hohnstaedt: delete objects in pkcs11
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4259 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-20 15:11:58 +00:00
viktor.tarasov b7d492fbae pkcs15-init tool: with the new option 'use-default-debug-settings' the debug settings from opensc.conf are used
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4258 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-19 12:13:16 +00:00
viktor.tarasov 83ca335da7 cflex pkcs15init: use temporary PINs that satisfy default pin policy
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4257 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-19 12:10:56 +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
viktor.tarasov 07c98da3a8 pkcs15-init: #101: use PIN object's label in the PIN prompt
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4254 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-18 16:01:13 +00:00
viktor.tarasov 0004461734 oberthur: add in emulator and create in pkcs15init the private data object
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4253 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-18 14:51:44 +00:00
viktor.tarasov 3c813ce57b pkcs15-init tool: use Ctrl-C sensible 'getpass'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4252 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-18 09:45:44 +00:00
viktor.tarasov a10bf0e356 pkcs11-tool: #120: use 'getpass' sensible to Ctrl-C, thanks to Andreas
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4251 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-18 08:32:35 +00:00
pk 238ebeb159 fixed incorrect IDs of SigG-PINs from 6,7 to 5,6
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4250 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-18 08:24:17 +00:00
viktor.tarasov d0618ba24c tools: #120: 'getpass' sensible to Ctrl-C, thanks to Andreas
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4249 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-18 07:47:16 +00:00
viktor.tarasov f7575879cc pkcs11-tool: useless assignment
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4248 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-18 07:30:21 +00:00
viktor.tarasov ce485e4895 pkcs11-tool: fix #124; thanks to Thomas Harnings: for the signature tests cannot be used private key without corresponding public key or certificate
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4247 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-17 19:59:32 +00:00
ludovic.rousseau 7a0578c670 set_cka_label(): remove a possibly invalid memory access
See
http://www.opensc-project.org/pipermail/opensc-devel/2010-April/013990.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4245 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-17 18:51:34 +00:00
viktor.tarasov d10effd58c libopensc: fix #209
In APDU consider Le=0 as Le=256

Thanks to FrankMpunkt, Martin, ludovic.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4244 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-16 19:34:47 +00:00
viktor.tarasov 2fdfe2574d pkcs11: Christian Hohnstaedt's patch: convert CKA_LABEL to the null-terminated pkcs15 label
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4243 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-15 15:37:55 +00:00
viktor.tarasov ad0207852e libopensc for win32: get working logging when compiled with Visual Studio
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4242 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-14 11:52:27 +00:00
viktor.tarasov 9396297f21 libopensc for win32: to be compiled
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4241 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-14 11:41:16 +00:00
viktor.tarasov 2e5b3c540c common for win32: to be compiled
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4240 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-14 11:40:08 +00:00
viktor.tarasov f3e3dc9bee common for win32: add simclist
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4239 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-14 11:37:39 +00:00
viktor.tarasov 801fdcefe2 pkcs11, libopensc, pkkcs15init: not use C99 designated initializers
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4238 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-14 11:36:40 +00:00
viktor.tarasov 3d6eaca830 pkcs11 for win32: add source for display functions
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4237 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-14 11:34:11 +00:00
martin 7ec26d75ae JCOP/BlueZ: remove unused code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4236 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:30:03 +00:00
martin dac21574bf card-incrypto34: Remove dead code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4235 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:29:59 +00:00
martin be43ca7bb2 Remove cardos-info (renamed to cardos-tool in 2008)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4234 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:29:53 +00:00
martin a20fa13922 pkcs15-init: remove dead code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4233 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:29:50 +00:00
martin 75df8e9d2a piv-tool: remove dead code.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4232 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:29:45 +00:00
martin 349b31ecf3 westcos-tool: fix header, the file is .c not .exe
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4230 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:29:37 +00:00
martin f63e2eef4b cryptoflex-tool: remove dead code from 2002
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4229 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:29:33 +00:00
martin 57c38d94ad cryptoflex-tool: remove dead code.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4228 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:29:27 +00:00
martin f161552890 netkey-tool: The tool is included in OpenSC, no need to have a compilation tip in the file header.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4227 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:29:21 +00:00
martin c73aaf990a pkcs15-tool: fix help text, reader must no be a number
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4226 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:29:17 +00:00
martin 119546e7bc cryptoflex-tool: use the code in util.c to connect to the card.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4225 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:29:12 +00:00
martin 9361c956ad pkcs15-crypt: remove useless #if 1
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4224 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:29:08 +00:00
martin 7720f3759c eidenv: remove a redundant sc_lock call, already done in util.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4223 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:29:03 +00:00
martin 5b40b0eb0c pkcs15-tool: Remove a redundant sc_lock/sc_unlock pair
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4222 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 11:28:59 +00:00
viktor.tarasov 64d05bb6d7 compile for win32: fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4221 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-13 09:12:03 +00:00
viktor.tarasov a31be9540c libopensc in win32: no more ui.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4220 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-12 13:48:54 +00:00
viktor.tarasov d3068f58d2 libopensc in win32: no more ui.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4219 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-12 13:42:11 +00:00
viktor.tarasov 523d529248 pkcs15init: no more 'keycache' sources
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4218 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-12 13:41:04 +00:00
viktor.tarasov d3652ebf83 pkcs15init: no more 'keycache' sources
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4217 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-12 13:37:38 +00:00
viktor.tarasov 1c7aefe76e pkcs15init: corrent debug messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4216 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-12 08:46:27 +00:00
viktor.tarasov f9eb1b3bbb pkcs15init: for the newly generated key object set public key as it's content
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4215 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-12 08:44:24 +00:00
viktor.tarasov 741d8fc0b8 pkcs11-tool: #75: key for signature can be selected by object_id
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4214 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-11 17:44:39 +00:00
ludovic.rousseau a3177b727a Use explict field names in the static initialisation to make it more
robust to code change

Fix
card-myeid.c:44: warning: missing initializer
card-myeid.c:44: warning: (near initialization for ‘myeid_drv.atr_map’)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4213 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 14:08:22 +00:00
ludovic.rousseau f8fa636311 Do not use a type of possibly different size.
Would fail on PowerPC in 64-bits for example.

Fix
card-entersafe.c: In function ‘entersafe_cipher_apdu’:
card-entersafe.c:197: warning: passing argument 3 of ‘EVP_EncryptUpdate’ from incompatible pointer type
card-entersafe.c: In function ‘entersafe_mac_apdu’:
card-entersafe.c:270: warning: passing argument 3 of ‘EVP_EncryptUpdate’ from incompatible pointer type
card-entersafe.c:278: warning: passing argument 3 of ‘EVP_EncryptUpdate’ from incompatible pointer type
card-entersafe.c:286: warning: passing argument 3 of ‘EVP_EncryptUpdate’ from incompatible pointer type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4212 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 13:57:30 +00:00
ludovic.rousseau 70b649e01b Use (const char *) for static C-strings
Fix
reader-pcsc.c: In function ‘pcsc_detect_readers’:
reader-pcsc.c:856: warning: initialization discards qualifiers from pointer target type
reader-pcsc.c:884: warning: initialization discards qualifiers from pointer target type
reader-pcsc.c:894: warning: initialization discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4211 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 13:51:51 +00:00
ludovic.rousseau a2ff157eef Rename variables and parameters
Fix
muscle.c: In function ‘msc_create_object’:
muscle.c:144: warning: declaration of ‘read’ shadows a global declaration
/usr/include/unistd.h:477: warning: shadowed declaration is here
muscle.c:144: warning: declaration of ‘write’ shadows a global declaration
/usr/include/unistd.h:513: warning: shadowed declaration is here
muscle.c: In function ‘msc_import_key’:
muscle.c:941: warning: declaration of ‘read’ shadows a global declaration
/usr/include/unistd.h:477: warning: shadowed declaration is here
muscle.c:942: warning: declaration of ‘write’ shadows a global declaration
/usr/include/unistd.h:513: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4210 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 13:49:54 +00:00
ludovic.rousseau 0500ef628b Do not cast a pointer to a type of possibly different size.
Would fail on PowerPC in 64-bits for example.

pkcs15-wrap.c: In function ‘do_cipher’:
pkcs15-wrap.c:152: warning: dereferencing type-punned pointer will break strict-aliasing rules
pkcs15-wrap.c:159: warning: dereferencing type-punned pointer will break strict-aliasing rules


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4209 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 13:45:27 +00:00
ludovic.rousseau e0bf75f69f Do not cast a pointer to a type of possibly different size.
Would fail on PowerPC in 64-bits for example.

pkcs15-sec.c: In function ‘sc_pkcs15_decipher’:
pkcs15-sec.c:136: warning: dereferencing type-punned pointer will break strict-aliasing rules


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4208 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 13:33:27 +00:00
ludovic.rousseau 0c77a52f37 Remove 2 ugly casts and fix warnings
asn1.c: In function ‘asn1_decode_entry’:
asn1.c:979: warning: dereferencing type-punned pointer will break strict-aliasing rules
asn1.c: In function ‘asn1_encode_entry’:
asn1.c:1263: warning: dereferencing type-punned pointer will break strict-aliasing rules


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4207 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 13:12:53 +00:00
martin 379519e84e Revert r4191 "Fix logic in pkcs15-tool/pkcs15-init -v"
This reverts commit a61f619296.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4206 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 13:11:07 +00:00
ludovic.rousseau 2820f78e09 Fix
pkcs15-oberthur-awp.c: In function ‘awp_encode_data_info’:
pkcs15-oberthur-awp.c:1211: warning: implicit declaration of function ‘sc_asn1_encode_object_id’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4205 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:23:21 +00:00
ludovic.rousseau d4b143830a Rename variable rand in rand_buf
pkcs15-oberthur-awp.c: In function ‘awp_new_container_entry’:
pkcs15-oberthur-awp.c:241: warning: declaration of ‘rand’ shadows a global declaration
/usr/include/stdlib.h:176: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4204 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:21:48 +00:00
ludovic.rousseau 8f6317b31b Use size_t instead of int to fix a compiler warning
pkcs15-oberthur.c: In function ‘cosm_write_tokeninfo’:
pkcs15-oberthur.c💯 warning: comparison between signed and unsigned


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4203 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:19:14 +00:00
ludovic.rousseau 8822668466 Use size_t instead of int to fix a compiler warning
pkcs15-myeid.c: In function ‘myeid_generate_key’:
pkcs15-myeid.c:687: warning: comparison between signed and unsigned


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4202 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:15:12 +00:00
ludovic.rousseau 28a2ed6bd1 Fix
pkcs15-myeid.c: In function ‘myeid_new_file’:
pkcs15-myeid.c:321: warning: assignment discards qualifiers from pointer target type
pkcs15-myeid.c:323: warning: assignment discards qualifiers from pointer target type
pkcs15-myeid.c:325: warning: assignment discards qualifiers from pointer target type
pkcs15-myeid.c:327: warning: assignment discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4201 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:13:41 +00:00
ludovic.rousseau 4c6b6f937a Fix
pkcs15-entersafe.c:200: warning: initialization discards qualifiers from pointer target type
pkcs15-entersafe.c:201: warning: initialization discards qualifiers from pointer target type
pkcs15-entersafe.c:202: warning: initialization discards qualifiers from pointer target type
pkcs15-entersafe.c:203: warning: initialization discards qualifiers from pointer target type
pkcs15-entersafe.c:204: warning: initialization discards qualifiers from pointer target type
pkcs15-entersafe.c:205: warning: initialization discards qualifiers from pointer target type
pkcs15-entersafe.c:206: warning: initialization discards qualifiers from pointer target type
pkcs15-entersafe.c:207: warning: initialization discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4200 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:12:27 +00:00
ludovic.rousseau de2b498c31 setcos_generate_key(): use size_t instead of int to fix a compiler
warning

pkcs15-setcos.c:488: warning: comparison between signed and unsigned


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4199 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:10:33 +00:00
ludovic.rousseau a3aa685be2 Use explict field names in the static initialisation to make it more
robust to code change

pkcs15-setcos.c:588: warning: missing initializer
pkcs15-setcos.c:588: warning: (near initialization for ‘sc_pkcs15init_setcos_operations.emu_update_dir’)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4198 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:05:40 +00:00
ludovic.rousseau 0f32e86732 declare a variable (const char *) to fix compiler warnings
pkcs15-setcos.c: In function ‘setcos_new_file’:
pkcs15-setcos.c:263: warning: assignment discards qualifiers from pointer target type
pkcs15-setcos.c:265: warning: assignment discards qualifiers from pointer target type
pkcs15-setcos.c:267: warning: assignment discards qualifiers from pointer target type
pkcs15-setcos.c:269: warning: assignment discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4197 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 11:58:08 +00:00
ludovic.rousseau 88764575f2 use (const char *) as return type to avoid compilation warnings:
pkcs15-lib.c: In function ‘get_template_name_from_object’:
pkcs15-lib.c:2152: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2154: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2156: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2159: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2161: warning: return discards qualifiers from pointer target type
pkcs15-lib.c: In function ‘get_pin_ident_name’:
pkcs15-lib.c:2815: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2817: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2819: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2823: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2825: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2827: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2829: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2832: warning: return discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4196 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 11:55:13 +00:00
ludovic.rousseau ad1dddabf3 use explict field names in the static initialisation to make it more
robust to code change


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4195 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 11:43:09 +00:00
martin 5957c7a880 Fix a line ordering error.
Thanks to Roland Schwarz

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4194 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-01 14:37:33 +00:00
martin d1d47d44c5 Fix #198: set correct access flags to private keys
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4193 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-01 14:16:43 +00:00
martin cd83821502 Don't use sc_debug in src/tools/*, use fprintf(stderr) instead.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4192 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-01 14:16:23 +00:00
martin a61f619296 Fix logic in pkcs15-tool/pkcs15-init -v
Only override ctx->debug if -v given.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4191 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-01 13:44:02 +00:00
ludovic.rousseau 629aef2ee8 Use an argument to cardos_format()
Thanks to Andreas Jellinghaus for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2010-March/013849.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4190 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-01 11:21:57 +00:00
martin 8323182d4a Remove leftover from r4113, allow easy side-by-side comparison
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4189 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-01 10:14:22 +00:00
viktor.tarasov 4eaba6b404 muscle profile: keep default ACLs for the 'DIR' file
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4188 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-31 12:41:39 +00:00
alonbl e61f5964d7 Fix r4182, LIBS must never go into LDFLAGS
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4187 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-30 06:35:00 +00:00
ludovic.rousseau d67f3f93f6 Use the correct integer type.
Fix openssl.c:182: warning: passing argument 3 of ‘EVP_DigestFinal’ from
incompatible pointer type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4186 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 14:34:02 +00:00
ludovic.rousseau 30d43413be Add missing (optional) initializer
Fix
openssl.c:42: warning: missing initializer openssl.c:42: warning: (near initialization for ‘openssl_sha1_mech.sign_init’)
openssl.c:53: warning: missing initializer openssl.c:53: warning: (near initialization for ‘openssl_sha256_mech.sign_init’)
openssl.c:63: warning: missing initializer openssl.c:63: warning: (near initialization for ‘openssl_sha384_mech.sign_init’)
openssl.c:73: warning: missing initializer openssl.c:73: warning: (near initialization for ‘openssl_sha512_mech.sign_init’)
openssl.c:96: warning: missing initializer openssl.c:96: warning: (near initialization for ‘openssl_md5_mech.sign_init’)
openssl.c:106: warning: missing initializer openssl.c:106: warning: (near initialization for ‘openssl_ripemd160_mech.sign_init’)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4185 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 14:30:03 +00:00
ludovic.rousseau cb5a21c5fa Use a temporary pointer to avoid a pointer cast.
Fix pkcs11-display.c:137: warning: dereferencing type-punned pointer
will break strict-aliasing rules


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4184 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 14:19:26 +00:00
ludovic.rousseau 502db6bd36 Do not cast a pointer to a type of possibly different size.
Would fail on PowerPC in 64-bits for example.

pkcs15-crypt.c: In function ‘sign_ext’:
pkcs15-crypt.c:293: warning: dereferencing type-punned pointer will break strict-aliasing rules
pkcs15-crypt.c:299: warning: dereferencing type-punned pointer will break strict-aliasing rules


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4183 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 14:10:17 +00:00
ludovic.rousseau 7d782f63a3 Link libpkcs11 to $(LTLIB_LIBS) since the lib uses ld_dlopen(), etc.
Fix a compilation error for src/tools/pkcs11-tool:
/usr/bin/ld: ../../src/pkcs11/.libs/libpkcs11.a(libpkcs11.o): in function C_UnloadModule:libpkcs11.c:78: error: undefined reference to `lt_dlclose'
/usr/bin/ld: ../../src/pkcs11/.libs/libpkcs11.a(libpkcs11.o): in function C_LoadModule:libpkcs11.c:36: error: undefined reference to `lt_dlinit'
/usr/bin/ld: ../../src/pkcs11/.libs/libpkcs11.a(libpkcs11.o): in function C_LoadModule:libpkcs11.c:43: error: undefined reference to `lt_dlopen'
/usr/bin/ld: ../../src/pkcs11/.libs/libpkcs11.a(libpkcs11.o): in function C_LoadModule:libpkcs11.c:52: error: undefined reference to `lt_dlsym'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4182 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 13:30:33 +00:00
ludovic.rousseau ad648c4a18 Use the correct type (const_DES_cblock *) instead of (const_DES_cblock)
for DES_ecb_encrypt() input and output parameters.

I have no idea how it could have worked.

Fix
cardos-tool.c: In function ‘cardos_sm4h’:
cardos-tool.c:421: warning: passing argument 1 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:421: warning: passing argument 2 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:426: warning: passing argument 1 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:426: warning: passing argument 2 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:432: warning: passing argument 1 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:432: warning: passing argument 2 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:434: warning: passing argument 1 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:434: warning: passing argument 2 of ‘DES_ecb_encrypt’ from incompatible pointer type
cardos-tool.c:472: warning: passing argument 1 of ‘DES_ecb3_encrypt’ from incompatible pointer type
cardos-tool.c:472: warning: passing argument 2 of ‘DES_ecb3_encrypt’ from incompatible pointer type
cardos-tool.c:483: warning: passing argument 1 of ‘DES_ecb3_encrypt’ from incompatible pointer type
cardos-tool.c:483: warning: passing argument 2 of ‘DES_ecb3_encrypt’ from incompatible pointer type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4181 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 12:55:13 +00:00
ludovic.rousseau 4ce1e8c831 Rename parameter wait in do_wait
util.c:11: warning: declaration of ‘wait’ shadows a global declaration
/usr/include/sys/wait.h:255: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4180 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 08:23:07 +00:00
ludovic.rousseau cf8a7f894f use a (const char *) for the reader_id and fix 2 warnings
opensc-explorer.c:1606: warning: passing argument 3 of
‘util_connect_card’ discards qualifiers from pointer target type
rutoken-tool.c:492: warning: passing argument 3 of ‘util_connect_card’
discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4179 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 08:20:27 +00:00
ludovic.rousseau d24de6ab58 Fix
piv-tool.c: In function ‘load_object’:
piv-tool.c:130: warning: implicit declaration of function ‘sc_asn1_find_tag’
piv-tool.c:130: warning: nested extern declaration of ‘sc_asn1_find_tag’
piv-tool.c:130: warning: cast from function call of type ‘int’ to non-matching type ‘u8 *’
piv-tool.c:130: warning: cast to pointer from integer of different size


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4178 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 08:13:55 +00:00
ludovic.rousseau 6946e513da Fix piv-tool.c:216: warning: suggest parentheses around comparison in
operand of |


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4177 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-29 08:11:32 +00:00
ludovic.rousseau 3f30d90045 Use a "const char *" to store a const C-string ptr. Fix a lot (31) of
warning: initialization discards qualifiers from pointer target type

Also cast from now (const char *) to (void *) for free()


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4176 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 21:02:56 +00:00
ludovic.rousseau cb5dd59d87 Use a "const char *" to store a const C-string ptr. Fix a lot (162) of
warning: initialization discards qualifiers from pointer target type

Also cast from now (const char *) to (void *) for free()


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4175 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 21:00:41 +00:00
ludovic.rousseau 6add573782 Do not cast to a possibly different type size.
Would fail on PowerPC in 64-bits for example.

Fix pkcs11-tool.c:2954: warning: dereferencing type-punned pointer will
break strict-aliasing rules


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4174 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 20:40:13 +00:00
ludovic.rousseau 5be62d9d67 Use a "const char *" to store a const C-string ptr.
Fix
pkcs11-tool.c:1899: warning: assignment discards qualifiers from pointer target type
pkcs11-tool.c:1902: warning: assignment discards qualifiers from pointer target type
pkcs11-tool.c:1906: warning: assignment discards qualifiers from pointer target type
pkcs11-tool.c:1910: warning: assignment discards qualifiers from pointer target type
pkcs11-tool.c:1914: warning: assignment discards qualifiers from pointer target type
pkcs11-tool.c:1918: warning: assignment discards qualifiers from pointer target type
pkcs11-tool.c:1922: warning: assignment discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4173 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 20:30:25 +00:00
ludovic.rousseau 66fc414db7 Fix framework-pkcs15init.c:175: warning: initialization from
incompatible pointer type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4172 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 20:16:46 +00:00
ludovic.rousseau bcba5c94a7 Fix slot.c:151: warning: ‘p11card’ may be used uninitialized in this
function


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4171 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 20:09:19 +00:00
ludovic.rousseau 227cb82612 Fix slot.c:234: warning: function declaration isn’t a prototype
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4170 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 20:08:30 +00:00
ludovic.rousseau bdd4477c29 Fix sc-pkcs11.h:328: warning: function declaration isn’t a prototype
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4169 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 20:06:56 +00:00
ludovic.rousseau 0c60be861c Use a "const char *" to store a const C-string ptr.
Fix
westcos-tool.c:41: warning: initialization discards qualifiers from pointer target type
westcos-tool.c:43: warning: initialization discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4168 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 19:57:24 +00:00
ludovic.rousseau cd89cb31cf Use a "const char *" to store a const C-string ptr.
Fix
netkey-tool.c:43: warning: initialization discards qualifiers from pointer target type
netkey-tool.c:63: warning: initialization discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4167 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 19:55:39 +00:00
ludovic.rousseau 2b57feadf2 Use a temporary variable to not lose negative values (errors)
Fix
westcos-tool.c:591: warning: comparison of unsigned expression < 0 is always false
westcos-tool.c:615: warning: comparison of unsigned expression < 0 is always false


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4166 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 16:15:26 +00:00
ludovic.rousseau 24b2d23585 westcos_pkcs15_create_pin(): use a temporary variable to not lose
negative values (errors)

Fix
pkcs15-westcos.c:135: warning: comparison of unsigned expression < 0 is always false
pkcs15-westcos.c:159: warning: comparison of unsigned expression < 0 is always false


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4165 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 15:04:20 +00:00
ludovic.rousseau df96df3356 Remove useless key argument from scconf_item_find()
Fix
parse.c: In function ‘scconf_item_find’:
parse.c:80: warning: unused parameter ‘key’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4164 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 14:18:20 +00:00
ludovic.rousseau 652ef326b4 revert changes 4154 and 4155 as suggested by Martin Paljak
http://www.opensc-project.org/pipermail/opensc-devel/2010-March/013827.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4163 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 14:13:32 +00:00
ludovic.rousseau 425efc939a Use a "const char *" to store a const C-string ptr. Fix
card-piv.c: In function ‘piv_get_data’:
card-piv.c:612: warning: assignment discards qualifiers from pointer target type
card-piv.c:615: warning: assignment discards qualifiers from pointer target type
card-piv.c:618: warning: assignment discards qualifiers from pointer target type
card-piv.c:621: warning: assignment discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4162 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 12:01:14 +00:00
ludovic.rousseau 2e4610e3be Use a "const char *" to store a const C-string ptr. Fix
pkcs15-oberthur-awp.c:97: warning: assignment discards qualifiers from pointer target type
pkcs15-oberthur-awp.c:98: warning: assignment discards qualifiers from pointer target type
pkcs15-oberthur-awp.c:99: warning: assignment discards qualifiers from pointer target type
[etc...]


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4161 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:53:44 +00:00
ludovic.rousseau 35036bceca Fix
pkcs15-oberthur.c: In function ‘cosm_write_tokeninfo’:
pkcs15-oberthur.c:94: warning: format not a string literal and no format arguments
pkcs15-oberthur.c:96: warning: format not a string literal and no format arguments


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4160 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:50:05 +00:00
ludovic.rousseau 10bf1fc8df Fix
pkcs15-oberthur.c:61: warning: redundant redeclaration of ‘cosm_delete_file’
pkcs15-oberthur.h:93: warning: previous declaration of ‘cosm_delete_file’ was here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4159 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:46:06 +00:00
ludovic.rousseau f66a1cc5d5 Fix
pkcs15-westcos.c:41: warning: redundant redeclaration of ‘sc_check_sw’
../../src/libopensc/opensc.h:674: warning: previous declaration of
‘sc_check_sw’ was here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4158 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:44:56 +00:00
ludovic.rousseau 30b7888c34 Remove unused variables. Fix warning: unused variable
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4157 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:43:17 +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
ludovic.rousseau 5ae0d01918 Fix
parse.c: In function ‘scconf_item_find’:
parse.c:80: warning: unused parameter ‘key’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4155 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:25:01 +00:00
ludovic.rousseau 05dd36dfa9 Fix
test-conf.c: In function ‘ldap_cb’:
test-conf.c:32: warning: unused parameter ‘depth’
test-conf.c: In function ‘card_cb’:
test-conf.c:60: warning: unused parameter ‘entry’
test-conf.c:60: warning: unused parameter ‘depth’
test-conf.c: In function ‘write_cb’:
test-conf.c:81: warning: unused parameter ‘depth’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4154 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:24:14 +00:00
ludovic.rousseau 10bcef99a9 Fix
simclist.c: In function ‘list_meter_int8_t’:
simclist.c:1337: warning: unused parameter ‘el’
simclist.c: In function ‘list_meter_int16_t’:
simclist.c:1338: warning: unused parameter ‘el’
simclist.c: In function ‘list_meter_int32_t’:
simclist.c:1339: warning: unused parameter ‘el’
simclist.c: In function ‘list_meter_int64_t’:
simclist.c:1340: warning: unused parameter ‘el’
simclist.c: In function ‘list_meter_uint8_t’:
simclist.c:1342: warning: unused parameter ‘el’
simclist.c: In function ‘list_meter_uint16_t’:
simclist.c:1343: warning: unused parameter ‘el’
simclist.c: In function ‘list_meter_uint32_t’:
simclist.c:1344: warning: unused parameter ‘el’
simclist.c: In function ‘list_meter_uint64_t’:
simclist.c:1345: warning: unused parameter ‘el’
simclist.c: In function ‘list_meter_float’:
simclist.c:1347: warning: unused parameter ‘el’
simclist.c: In function ‘list_meter_double’:
simclist.c:1348: warning: unused parameter ‘el’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4153 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:22:38 +00:00
ludovic.rousseau 5914be4e58 Fix
pkcs15-lib.c:799: warning: no previous prototype for ‘sc_pkcs15init_store_puk’
pkcs15-lib.c:2814: warning: no previous prototype for ‘get_pin_ident_name’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4152 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 09:45:54 +00:00
ludovic.rousseau 6973403675 Fix pkcs15-oberthur-awp.c:729: warning: no previous prototype for
‘awp_update_object_list’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4151 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 09:44:22 +00:00
ludovic.rousseau 1eb944e256 Fix pkcs15-oberthur-awp.c:1246: warning: no previous prototype for
‘awp_set_data_info’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4150 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 09:43:20 +00:00
ludovic.rousseau 385c5da2eb Fix
pkcs15-pubkey.c:445: warning: no previous prototype for ‘sc_pkcs15_decode_pubkey_gostr3410’
pkcs15-pubkey.c:462: warning: no previous prototype for ‘sc_pkcs15_encode_pubkey_gostr3410’ 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4149 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 09:41:34 +00:00
ludovic.rousseau 815baad156 Fix pkcs15-esinit.c:77: warning: no previous prototype for
‘sc_pkcs15emu_entersafe_init_ex’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4148 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 08:41:55 +00:00
ludovic.rousseau 8dd1590662 Fix p15emu-westcos.c:248: warning: no previous prototype for
‘sc_pkcs15emu_westcos_init_ex’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4147 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 08:40:10 +00:00
ludovic.rousseau 9b73e45a07 Fix westcos-tool.c:322: warning: no previous prototype for ‘usage’
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4146 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 08:33:14 +00:00
viktor.tarasov c891886f56 oberthur pkcs15init: sorry, fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4145 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-23 10:03:05 +00:00
viktor.tarasov c63225cf99 oberthur pkcs15init: non-install header; join pkcs15-oberthur-awp.obj to object list for win32
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4144 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-23 10:02:22 +00:00
viktor.tarasov 7106674d41 oberthur pkcs15init: support for creation of the 'public' DATA objects
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4143 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-22 14:17:27 +00:00
viktor.tarasov f75f539a6f libopensc: export 'sc_asn1_encode_object_id'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4142 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-22 14:14:51 +00:00
viktor.tarasov 0608713b07 oberthur pkcs15init: use macro for debug level
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4139 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 17:51:06 +00:00
viktor.tarasov 9b72b24d42 oberthur: forgotten header file
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4138 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 17:21:39 +00:00
viktor.tarasov 0f82c7c1d4 oberthur: pkcs15init emulator
Now the native Oberthur card format is supported for emulation of pkcs15 and pkcs15init.

It means that card personalized with OpenSC and the obejcts created with OpenSC 
will be usable with the native Oberthur's middleware 
and vice-versa.





git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4137 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 12:30:39 +00:00
viktor.tarasov 42b90f8ada pkcs11-tool: to be compiled without OpenSSL
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4136 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 10:49:53 +00:00
viktor.tarasov 0c9b9f21a8 pkcs15init: free cert object if 'link object' failed
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4135 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 10:25:50 +00:00
viktor.tarasov ef8e169955 pkcs15init: use encoded public key as the 'content' of private and public key pkcs15 objects
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4134 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 10:15:51 +00:00
viktor.tarasov 7d6739feb2 pkcs15init: in pkcs15-init.h don't use parameters name in the function declarations
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4133 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 09:49:49 +00:00
viktor.tarasov ecbe32f778 pkcs15init: fix pkcs15-init.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4132 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 09:46:35 +00:00
viktor.tarasov 8419f95f76 pkcs15init: in pkcs15-init.h, for the function prototypes, homogenize using 'struct *' vs. '*_t'; do not use paramters name
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4131 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 09:39:16 +00:00
viktor.tarasov 965ecbf9a1 pkcs15init: pkcs15 card flags
Set 'TOKEN INITIALIZED' after an application has been added,
set 'USER PIN INITIALIZED' and 'LOGIN REQUIRED' after User PIN object has been created.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4130 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 09:27:09 +00:00
viktor.tarasov 5eba20e263 pkcs15init emulation: use emu_update_tokeninfo() if available
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4129 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 09:20:33 +00:00
viktor.tarasov e214ba206c pkcs15init: emulation API
Four method are added to the 'sc_pkcs15init_operations':
emu_update_dir		-- create or not the DIR file;
emu_update_any_df	-- update the non-pkcs15 descriptors that are equivalents to pkcs15 xDF files;
emu_update_tokeninfo	-- update analog of tokenInfo;
emu_write_info		-- to not create OPENSC-INFO file;


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4128 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 09:10:51 +00:00
viktor.tarasov a17e519708 pkcs15-tool: 'verify-pin' is not an action
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4127 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-17 18:24:26 +00:00
viktor.tarasov e0f39c529c pkcs15-init tool: make possible pin verification immidiately after card was binded
It's implemented for the card with emulated pkcs#15 and protected private object attributes.

Update to man pages is comming soon.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4126 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-17 18:16:27 +00:00
viktor.tarasov 69a2fb1941 oberthur: in profile do not use 'combined' pins in ACLs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4125 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-17 16:45:02 +00:00
viktor.tarasov 5bba49e58c oberthur: in card profile set 'do-last-update' to 'false'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4124 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-17 16:40:12 +00:00
viktor.tarasov fb45d8925b pkcs15init: simplify internal API
; do not pad PIN in pkcs15init. It's already done in libopensc/pkcs15-pin;
; the 'do_verify_pin()', 'sc_pkcs15init_verify_key()' and 'do_get_and_verify_secret()' are replaced by unique 'sc_pkcs15init_verify_secret()'; edit debug messages;



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4123 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-17 16:26:07 +00:00
aj 84934adab9 don't complain about missing "--slot" parameter, when you don't
need it (if you only "--list-slots").


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4122 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-16 14:59:20 +00:00
aj 5972022ffc Add code to write pubkey objects to pkcs11-tool.
By: Jaroslav Benkovský <jaroslav.benkovsky@nic.cz>

Slightly modified by me.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4121 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-16 14:11:39 +00:00
viktor.tarasov c74016b8cc fix #202: pkcs15-tool: print message when there is PIN verify error
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4119 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-15 17:58:17 +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 0fdb4478bc On blank, but otherwise perfectly supported card, we get an error here
(with "Unsupported card"). This needs to be improved.

This patch changes the "initialization" to "binding", so we at least
can tell people: you need to initialized an empty card first.
Needs to be improved of course.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4117 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-15 10:34:18 +00:00
viktor.tarasov da9aa435c4 fix second part of #199: pkcs15init: when freeing pkcs15 object remove it from list
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4116 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-15 08:36:36 +00:00
flc 6b1a8423a3 clean libopensc.exports (2 functions removed)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4115 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-15 07:23:48 +00:00
viktor.tarasov e5300b1c2d fix #199: to authenticate 'update' in sc_pkcs15init_update_file() use the file instantiated from profile, rather then selected one
This bug concerned the card drivers for which the file ACLs cannot be obtained from the FCI of the selected file.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4114 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-13 23:35:08 +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
aj 5bc11ac39c Redirect output to file given by "--output" / "-o" option. Closes bug #200.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4112 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-13 22:47:58 +00:00
aj c1bb3ae9cd compile tools with PTHREAD so we can debug them in GDB.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4111 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-13 22:26:07 +00:00
viktor.tarasov 8b15f0f340 pkcs15init: sc_pkcs15_add_df() has no more 'handler' parameter
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4110 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-13 19:54:28 +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 172d710a35 oberthur emu: create pkcs15 object for SOPIN; accept non-initialized token; use 'define' macros for the native file paths
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4108 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-11 13:29:10 +00:00
viktor.tarasov f9b27b1699 pkcs15-tool: 'pkcs15_pin_info' parameter replaced by 'pkcs15_object'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4107 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-11 13:00:07 +00:00
martin 72a9d8e58f pkcs15-init: sign key usage shortcut does not expand to non-repudiation.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4106 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-11 11:23:47 +00:00
flc c3de15d2d0 westcos card small fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4105 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-11 06:41:55 +00:00
viktor.tarasov af1bf44cef framework-pkcs15: fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4104 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-10 15:03:20 +00:00
viktor.tarasov 052881c38f libopensc: in pkcs15 PIN commands 'pin_info' parameter replaced by 'pin_object'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4103 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-10 09:23:01 +00:00
martin 91230bdbc9 there is no ui.h any more.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4102 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-10 07:07:13 +00:00
viktor.tarasov 9961fa2487 libopensc: add oberthur pkcs15 emulator to Makefile.mak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4101 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-09 17:43:09 +00:00
viktor.tarasov ffab538bcc oberthur: pkcs15 emulator for the native cards
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4100 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-09 17:40:22 +00:00
viktor.tarasov b6cd025106 pkcs11 framework-pkc15: at user login try to do the postponed private keys load
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4099 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-09 17:38:08 +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 e47baeaf9e pkcs11: configuration option to report as zero the CKA_ID of CA certificates
In fact, the middleware of the manufacturer of the gemalto (axalto, gemplus) cards
reports the CKA_ID of CA certificates as '0'.

But it's not true for the others middlewares (Oberthur), NSS (afais) and PKCS#11 standard.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4095 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-09 15:43:16 +00:00
viktor.tarasov 54d2b20fe2 pkcs11 framework: change prototype of the 'login' method
It gives the access to the 'slot' object inside the framework method 'login'.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4094 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-09 15:05:29 +00:00
viktor.tarasov 93210eae9f pkcs15-tool: add 'verify-pin' option" src/tools/pkcs15-tool.c
Implemented to have the possibility to verify PIN after binding of the pkcs15 card and before any 'substantial' operation.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4093 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-09 14:51:48 +00:00
flc 8e8ee649bd add windows.h include to ctx.c to satisfy dependencies and move internal.h include at end of includes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4092 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-09 13:39:29 +00:00
flc 995dda778a internal.h must be before winreg.h include, and change path for include log.h in cardmod.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4091 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-09 07:41:28 +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
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
viktor.tarasov 26dc34c83f libopensc: add structure name to the 'typedef structure' definitions
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4087 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 16:19:41 +00:00
viktor.tarasov 3a424cf26a pkcs15init: dummy object is not needed for the sc_pkcs15_find_XX() procedures; coding style issues
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4086 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 16:14:30 +00:00
viktor.tarasov 0e8e1a1bf0 pkcs15init cflex: fix protected initialisation
In the 'flex' card profile the ACLs of the public objects are set to 'NONE'.

As the pkcs15init core currently implemented, the AuthID attribute is not used for the public objects. 
Without AuthID the destination 'pin-domain' DF cannot be determined in a simple and sure manner.
That's why 'pin-domain' works only for private key, private data
and the public objects are placed into the application DF. 


; take 'flex' CHV files settings from the card profile;






git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4085 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 13:37:11 +00:00
viktor.tarasov de3e6aeba9 pkcs15init: prepare instantiation of the pin-domain templates
When binding profile and p15card (in sc_pkcs15init_set_p15card()), add to the profile EF list the named DF for the path of the all existing AUTH.

; variables name and coding style issues;
; debug messages;


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4084 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 13:05:03 +00:00
viktor.tarasov 21acf3ed3d pkcs15init profile: fix indexed instantiation of pin/key domain; more of debug messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4083 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 12:55:09 +00:00
viktor.tarasov 5d08b13f98 pkcs15init asepcos: unused variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4082 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 12:49:12 +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 1bd07bacd6 pkcs15init profile: syntax error can provoke segmentation fault
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4080 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-03 17:22:01 +00:00
viktor.tarasov 0bb56af014 pkcs15init: no more need for static keycache
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4079 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-02 17:03:44 +00:00
viktor.tarasov 02c35be138 asepcos: 'trasport PIN' (global PIN with reference '0') is presented as 'AUT' key
; no more need of athena dedicated PIN flag 'TRANSPORT KEY';



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4078 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-02 16:22:33 +00:00
viktor.tarasov de6649fed5 pkcs15init asepcos: fixup initialisation with protected profile
; new, athena dedicated, PIN pkcs15 flag 'TRANSPORT_KEY': 
in the Athena initialization procedure the 'trasport' SOPIN object is used. This object references to the pre-existing global SOPIN and is different from the final SOPIN of the card. This object should be ignored when fixing up the ACLs of the newly created file;

; the pkcs15 refereces of the new private keys are derived from the file-id;

; remove duplicated code;

; some log messages in  pkcs15-lib.c;




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4077 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-02 09:50:07 +00:00
viktor.tarasov 70ee7c1438 pkcs15init: in sc_pkcs15init_add_object() if DF update fails, remove object from the list before return
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4076 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-01 15:29:39 +00:00
viktor.tarasov dbd315c7e9 profile: 'cbs' member of 'struct sc_profile' is not used
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4075 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-01 14:01:25 +00:00
viktor.tarasov abd3a43b3e include: do not create link to the non-existing ui.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4074 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-01 13:51:05 +00:00
viktor.tarasov bb6ccdb9fb pkcs15init oberthur: no extractable key; for generated key set reference from the key's path
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4073 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-01 13:36:02 +00:00
flc 7a48d4a6f2 add support for westcos card with crypto component and minor renames to westcos-tool
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4072 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-25 15:16:23 +00:00
martin cf4ec4ab3f #47: C_SignRecover is not implemented at the moment, don't give any promises with C_SignRecoverInit either.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4071 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-24 14:06:04 +00:00
martin 6f887e5b62 #185: drop opensc-config. If required, pkg-config and libopensc.pc can be used instead.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4070 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-24 12:20:59 +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
s adf4035d86 fix mistake in r4065
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4068 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-24 08:57:37 +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
aj 9e64de79e4 Remove openssh/ directory and our patch for openssh,
as they removed the opensc code in favor or new pkcs#11 code.
This new code works out of the box with opensc-pkcs11.so, 
so we don't need the patch any more.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4066 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-24 08:25:13 +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
flc 9a11b3019a set default auth_method SC_AC_CHV for emulated cards thanks to Martin Paljak patch
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4064 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-24 07:48:53 +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 9485f168ee pkcs15init: 'defined bu not used'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4062 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 20:33:51 +00:00
martin 23b7c2673c pincache: pkcs15-pin.c:515: warning: unused variable ‘i’
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4061 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 19:54:59 +00:00
martin 7b6d2525da pincache: correct message for user consent PINs (it is a matter of policy not software support)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4060 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 19:53:53 +00:00
martin a8c4f57c55 Fix exports file:
{{{
Undefined symbols:
  "_sc_pkcs15init_fixup_acls", referenced from:
     -exported_symbols_list command line option
  "_sc_pkcs15init_set_pin_data", referenced from:
     -exported_symbols_list command line option
  "_sc_pkcs15init_set_secret", referenced from:
     -exported_symbols_list command line option
}}}


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4059 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 19:47:53 +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
martin edcf32337e libopensc: only one pkgconfig file is required.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4055 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 11:02:12 +00:00
martin ba4b02e098 pkcs15-init: don't suggest using --erase-card with --create-pkcs15 in help message.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4053 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 09:09:33 +00:00
viktor.tarasov e5233e7297 cyberflex: no more 'protect-certificates' profile option
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4051 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 23:20:38 +00:00
viktor.tarasov ef919e94d4 pkcs15init: 'protect-certificates' profile option not used
Profile option 'protect-certifcates' was activated by default for all the cards, 
was mentioned and commented out only in 'flex' profile,
and finaly is not working 'by design' of pkcs15-lib.c

So, no need to keep this option, untill the valid arguments to restore it back.
Anyway, the access to certificates is controlled by the file's ACLs defined in profile.


;in profile use the 'define' macros to define the pin encoding type;



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4050 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 23:14:45 +00:00
viktor.tarasov 128e066176 pkcs11: no pincache concept at the pkcs11 level -- it's implemented at the pkcs15 one
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4049 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 22:16:19 +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
viktor.tarasov ac5307d457 pkcs15init: when updating 'OpenSC Info' file, cleanup its non-used tail part -- thanks to Xiaoshuo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4047 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 20:09:22 +00:00
viktor.tarasov d7dfa2104a entersafe: fix import key RSA 2048 bits
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4046 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 10:09:06 +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
martin 26f1750cd7 entersafe: don't mix hexadecimal and decimal in code and comments
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4044 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 08:31:19 +00:00
viktor.tarasov ba3299bcef entersafe: sorry, fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4043 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-19 16:52:50 +00:00
viktor.tarasov 9bf12ba47f entersafe: unify cards behavior - don't throw error when erasing empty card
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4042 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-19 16:41:05 +00:00
flc 6380feb1fd Use cardmod if explicitly request on config only
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4041 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-19 10:41:33 +00:00
viktor.tarasov 9c45262f5e MyEID: fix 'Activate Applet' apdu case
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4040 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-18 17:08:01 +00:00
viktor.tarasov d89e6377a0 MyEID: 'read until the end' not supported -- set maximal receiving size to 255
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4039 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-18 10:26:08 +00:00
viktor.tarasov 4395d5b8b3 MyEID: fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4038 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-18 10:08:32 +00:00