Commit Graph

132 Commits

Author SHA1 Message Date
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
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
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 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 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
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
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
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 875fe4a50f pkcs11-tool: test hotplug partial commit fix + make a slot ID mandatory and parse it as an unsigned long, not int.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3911 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-15 09:36:00 +00:00
martin c5effc32c3 pkcs11-tool: test hotplugging and events (C_GetSlotList/C_WaitForSlotEvent) before others tests and only if --hotplug is given
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3910 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-15 09:33:27 +00:00
martin cc5c03197d pkcs11-tool: Check for CKA_ALWAYS_AUTHENTICATE and CKU_CONTEXT_SPECIFIC login for --test operations.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3909 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-15 09:27:17 +00:00
martin e595042474 pkcs11-tool: Call C_Finalize when a fatal error happens. (Otherwise OSX pcsc locks up)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3908 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-15 09:22:03 +00:00
viktor.tarasov e2dae6b97b Unlock User PIN with PKCS#11:
One of the three unblock methods can be activated from the 'opensc-pkcs11' section of opensc.conf:
- C_SetPin() in the unlogged sesssion;
- C_SetPin() in the CKU_SPECIFIC_CONTEXT session;
- C_InitPin() in CKU_SO session (inspired by Pierre Ossman).
-- This last one works, for a while, only for the pkcs15 cards without SOPIN auth object.
   For the pkcs15 cards with SOPIN, this method will be useful for the cards 
   that do not have then modes '00' and '01' of ISO command 'RESET RETRY COUNTER'.

Test commands:
# pkcs11-tool --module ./opensc-pkcs11.so --slot 0 --unlock-pin --puk "123456" --new-pin "9999"
# pkcs11-tool --module ./opensc-pkcs11.so --slot 0 --unlock-pin -l --login-type context-specific --puk "123456" --new-pin "9999"
# pkcs11-tool --module ./opensc-pkcs11.so --slot 0 --init-pin -l --new-pin "9999"



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3901 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-08 15:41:07 +00:00
s e4780e82ec add to pkcs11-tool: GOST mechanisms and GOSTR3410 key to show objects on token
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3869 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-27 11:15:33 +00:00
martin f2d6ec2c76 Always print the slot description (reader name in case of OpenSC)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3867 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-25 18:01:30 +00:00
martin 56fb57603b Merge [3758:3783/trunk]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3785 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-22 09:18:16 +00:00
martin 6a48771ce1 Implement CKA_ALWAYS_AUTHENTICATE
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3722 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 08:51:53 +00:00
aj 3fa5747e33 Fix security issue.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3688 c6295689-39f2-0310-b995-f0e70906c6a9
2009-05-07 10:57:07 +00:00
martin 16baddcc74 Engine API is not used.
Thanks to Robert Konklewski for noticing this.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3678 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-08 09:40:21 +00:00
ludovic.rousseau 9ef196c2cd store the generated public key on the token.
Thanks to Rickard Bondesson for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2009-February/011884.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3663 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-12 08:33:37 +00:00
martin 5b5a7d3c58 Upgrade to safe and sane values of late 2008
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3602 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-06 20:04:11 +00:00
martin 1e41d4d267 * Fix issues with pkcs11-tool testing of C_GenerateRandom/C_SeedRandom and OpenSC PKCS#11 implementation of those functions.
Thanks goes to Rickard Bondesson who noticed the issues.

http://www.opensc-project.org/pipermail/opensc-devel/2008-November/011436.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3595 c6295689-39f2-0310-b995-f0e70906c6a9
2008-11-24 22:06:27 +00:00
martin 04b30cdac3 Add --list-token-slots / -T to pkcs11-tool to list only slots with tokens.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3592 c6295689-39f2-0310-b995-f0e70906c6a9
2008-11-21 22:34:31 +00:00
alonbl 597bcd7635 Cleanup some Windows issues with open
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3491 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-25 11:51:03 +00:00
alonbl 80a16f686d ruToken cleanups
Move constants out of standard files.
Create ruToken specific interface.
Update symbols.

Thread at:
http://www.opensc-project.org/pipermail/opensc-devel/2008-March/010917.html

Cleanup of:
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010617.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3439 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-26 06:24:37 +00:00
alonbl 0a809dd5cb Complete rewrite of OpenSC build system.
1.  Build system now supports MinGW (Windows) compilation using msys and cross compilation.
2.  Ability to explicitly disable and enable dependencies of the package.
3.  openct, pcsc and nsplugins features are disabled by default.
4.  Modified pcsc driver to use pcsc dynamically, no compile time dependency is required.
5.  --enable-pcsc-lite configuration option renamed to --enable-pcsc.
6.  Install opensc.conf file (as opensc.conf.new if opensc.conf exists).
7.  Add--enable-doc configuration option, allow installing documentation into target.
8.  Add --disable-man configuration option, allow msys mingw32 users to
    build from svn without extra dependencies.
9.  Add export files to each library in order to export only required symbols.
    Windows native build may use these files instead of scanning objects' symbols.
10. Add opensc-tool --info to display some general information about the build.
11. Create compatibility library to be linked against library instread of recompiling the
    same source files in different places.
12. Add different win32 version resource to each class of outputs.
13. Make xsl-stylesheets location selectable.
14. Some win32 fixups.
15. Some warning fixups.
16. Many other autoconf/automake cleanups.

Alon Bar-Lev

svn diff -r 3315:3399 https://www.opensc-project.org/svn/opensc/branches/alonbl/mingw

_M   .
D    configure.in
_M   src
_M   src/openssh
M    src/openssh/Makefile.am
_M   src/tools
M    src/tools/rutoken-tool.c
M    src/tools/opensc-tool.c
M    src/tools/cardos-info.c
M    src/tools/pkcs15-crypt.c
M    src/tools/pkcs15-init.c
M    src/tools/piv-tool.c
M    src/tools/netkey-tool.c
M    src/tools/eidenv.c
M    src/tools/cryptoflex-tool.c
M    src/tools/util.c
M    src/tools/pkcs11-tool.c
M    src/tools/pkcs15-tool.c
M    src/tools/util.h
M    src/tools/opensc-explorer.c
M    src/tools/Makefile.am
_M   src/pkcs11
M    src/pkcs11/pkcs11-global.c
M    src/pkcs11/framework-pkcs15.c
M    src/pkcs11/mechanism.c
M    src/pkcs11/pkcs11-display.c
M    src/pkcs11/pkcs11-object.c
A    src/pkcs11/opensc-pkcs11.exports
M    src/pkcs11/sc-pkcs11.h
M    src/pkcs11/pkcs11-spy.c
M    src/pkcs11/openssl.c
M    src/pkcs11/Makefile.am
A    src/pkcs11/pkcs11-spy.exports
_M   src/tests
_M   src/tests/regression
M    src/tests/regression/Makefile.am
M    src/tests/sc-test.c
M    src/tests/pintest.c
M    src/tests/Makefile.am
_M   src/include
_M   src/include/opensc
M    src/include/opensc/Makefile.am
A    src/include/opensc/svnignore
M    src/include/Makefile.am
_M   src/signer
_M   src/signer/npinclude
M    src/signer/npinclude/Makefile.am
M    src/signer/Makefile.am
A    src/signer/signer.exports
_M   src/common
A    src/common/compat_dummy.c
D    src/common/getopt.txt
D    src/common/strlcpy.c
D    src/common/LICENSE
A    src/common/compat_getopt.txt
A    src/common/compat_strlcpy.c
A    src/common/LICENSE.compat_getopt
A    src/common/compat_getopt.c
D    src/common/strlcpy.h
D    src/common/ChangeLog
D    src/common/getpass.c
D    src/common/my_getopt.c
A    src/common/compat_strlcpy.h
A    src/common/compat_getpass.c
A    src/common/compat_getopt.h
A    src/common/ChangeLog.compat_getopt
D    src/common/README.strlcpy
D    src/common/my_getopt.h
A    src/common/compat_getpass.h
A    src/common/README.compat_strlcpy
D    src/common/strlcpy.3
A    src/common/README.compat_getopt
D    src/common/getopt.3
D    src/common/README.my_getopt
A    src/common/compat_strlcpy.3
A    src/common/compat_getopt.3
M    src/common/Makefile.am
M    src/Makefile.am
_M   src/pkcs15init
M    src/pkcs15init/pkcs15-oberthur.c
M    src/pkcs15init/profile.c
M    src/pkcs15init/pkcs15-lib.c
M    src/pkcs15init/pkcs15-rutoken.c
A    src/pkcs15init/pkcs15init.exports
M    src/pkcs15init/pkcs15-gpk.c
M    src/pkcs15init/Makefile.am
_M   src/scconf
M    src/scconf/Makefile.am
M    src/scconf/parse.c
A    src/scconf/scconf.exports
_M   src/libopensc
M    src/libopensc/card-rutoken.c
M    src/libopensc/compression.c
M    src/libopensc/sc.c
M    src/libopensc/card-piv.c
M    src/libopensc/pkcs15-openpgp.c
M    src/libopensc/pkcs15-postecert.c
M    src/libopensc/pkcs15-tcos.c
M    src/libopensc/opensc-config.in
M    src/libopensc/reader-pcsc.c
A    src/libopensc/internal-winscard.h
M    src/libopensc/ctx.c
A    src/libopensc/libopensc.exports
M    src/libopensc/pkcs15-piv.c
M    src/libopensc/pkcs15-infocamere.c
M    src/libopensc/internal.h
M    src/libopensc/pkcs15-actalis.c
M    src/libopensc/pkcs15-starcert.c
M    src/libopensc/card-oberthur.c
M    src/libopensc/pkcs15-atrust-acos.c
M    src/libopensc/p15card-helper.c
D    src/libopensc/part10.h
M    src/libopensc/ui.c
M    src/libopensc/card-gpk.c
M    src/libopensc/pkcs15-wrap.c
M    src/libopensc/pkcs15-gemsafeGPK.c
M    src/libopensc/log.c
M    src/libopensc/pkcs15-esteid.c
M    src/libopensc/pkcs15-prkey-rutoken.c
M    src/libopensc/log.h
M    src/libopensc/Makefile.am
M    src/libopensc/reader-openct.c
_M   aclocal
M    aclocal/Makefile.am
_M   win32
M    win32/Makefile.am
A    win32/versioninfo.rc.in
A    win32/ltrc.inc
A    configure.ac
_M   doc
_M   doc/tools
M    doc/tools/pkcs15-profile.xml
D    doc/changelog.sh
D    doc/export-wiki.xsl
_M   doc/api
_M   doc/api/file
M    doc/api/man.xsl
_M   doc/api/asn1
_M   doc/api/apps
_M   doc/api/init
_M   doc/api/types
_M   doc/api/card
M    doc/api/html.xsl
_M   doc/api/misc
_M   doc/api/util
M    doc/Makefile.am
D    doc/export-wiki.sh
AM   doc/nonpersistent
A    doc/nonpersistent/export-wiki.xsl
A    doc/nonpersistent/Makefile.am
A    doc/nonpersistent/export-wiki.sh
A    doc/nonpersistent/svn2cl.xsl
D    doc/generate-man.sh
D    doc/svn2cl.xsl
M    Makefile.am
A    svnignore
_M   etc
M    etc/opensc.conf.in
M    etc/Makefile.am
D    man
_M   solaris
M    solaris/Makefile



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3405 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-06 16:06:59 +00:00
ludovic.rousseau 0ecc294ed8 add support of ruToken
Thanks to Andrew V. Stepanov for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010617.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3304 c6295689-39f2-0310-b995-f0e70906c6a9
2007-12-17 13:39:20 +00:00
aj 7ea1d00791 pkcs11-tool crashes while printing its usage message.
fixed by Ville Skyttä.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3233 c6295689-39f2-0310-b995-f0e70906c6a9
2007-07-28 18:22:07 +00:00
aj cea32a8016 make app_name, options and option_help static.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3192 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-29 13:19:19 +00:00
aj 1069b4e018 Douglas E. Engert: fix more compiler warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3190 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-24 21:03:30 +00:00
ludovic.rousseau be309330e5 do not use global variables app_name, options and option_help so they
can be static


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3188 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 13:46:08 +00:00
aj b0bc6df80c fix more warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3187 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 13:38:16 +00:00
ludovic.rousseau 2f66c5b87e correct a typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3184 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 13:20:45 +00:00
aj 0c604cb294 silence more warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3183 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 12:58:57 +00:00
aj 4cc1a50a49 Alessandro Premoli:
add support for reading, writing and deleting private (require cache_pins) and
public data objects in PKCS11. updated the pkcs11-tool and fixed a few
bugs in the code. Tested on an aladdin etoken.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3176 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 09:37:18 +00:00
aj 6c324049e7 If a PKCS11 get attrribute failes for some reason, pkcs11-tool may return
garbage along with the error message. The attached patch to pkcs11-tool.c
initializes the type to 0 so the attribute will be 0 in case of an error.
by Douglas E. Engert


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3172 c6295689-39f2-0310-b995-f0e70906c6a9
2007-05-25 20:09:11 +00:00
nils a2f622a215 implement support for SHA2 (still experimental)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3115 c6295689-39f2-0310-b995-f0e70906c6a9
2007-02-02 22:15:14 +00:00
aj 1a9d5290f1 kill warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3091 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-19 22:11:07 +00:00
nils a127dd93ef add option to write data objects; patch supplied by Cornelius Kölbel <cornelius.koelbel@lsexperts.de> et. al.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3017 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-18 05:30:41 +00:00
aj ab0066b0d7 fix printf size_t problem with "%lu" and (unsigned long) cast.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2923 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:02:50 +00:00
aj 41ff15ec1f fix signed and size_t warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2916 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-26 11:41:57 +00:00
nils a092e863b8 fix some warnings + cleanup
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2847 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-15 17:05:05 +00:00
aj 93dae31ca7 #if out the dead code.
remove some dead code in the hexdump code.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2702 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-05 21:25:08 +00:00
nils fa65fbf285 summary: - add new function sc_format_oid to libopensc
- cleanup libopensc api


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2670 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-30 18:05:30 +00:00
nils 0ad2a0782d fix typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2655 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-21 19:40:37 +00:00
sth 58943d59b5 Compiler warning fix: use 'char * argv[]' in main() because getopt_long() does so too
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2648 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-13 11:19:25 +00:00