Commit Graph

43 Commits

Author SHA1 Message Date
Ludovic Rousseau 2240abcef1 spy: display -1 instead of 18446744073709551615
buf_len is a CK_ULONG (unsigned long). But if the attribute is sensitive
or is not extractable or is invalid for the object then the library set
the buffer length value to (CK_LONG)-1.

It is more friendly to see "-1" instead of "18446744073709551615" (on
64-bits CPU)
2019-08-26 10:53:09 +02:00
Ludovic Rousseau 43a8f870e5 pkcs11-spy: add support of CKA_OTP_* values 2019-08-26 10:18:04 +02:00
Jakub Jelen df0bbc110e pkcs11-spy: Dump EC Derive parameters 2019-06-17 12:49:11 +02:00
Martin Paljak c3a9837b10 Add mechanisms used by SoftHSM2
/Library/OpenSC/bin/pkcs11-tool --module /usr/local/lib/softhsm/libsofthsm2.so -M

will not show any more numeric mechanisms.

Source: https://www.cryptsoft.com/pkcs11doc/STANDARD/include/v240e01/pkcs11t.h
2019-01-15 13:07:58 +02:00
Jakub Jelen bdb1961dee Enable RSA-PSS signatures in pkcs11-tool (#1146)
* Add missing SHA224 RSA algorithms

* Fix wrong replacement in pkcs11-tool manual page

* Add MGF and PSS_PARAMS definitions in PKCS#11 header file

* Inspect PSS signature parameters in pkcs11-spy

* Enable RSA-PSS signatures in pkcs11-tool

* Added short names to RSA-PSS methods

* Reintroduce portable NORETURN indication for functions and use it to avoid compilers complaining
2017-09-21 11:19:22 +02:00
Maciej S. Szmigiero 7f778ccff8 Fix most of warnings shown when building on Linux and mingw
This commit fixes most of warnings shown by GCC on 64-bit Linux, 32-bit and
64-bit mingw builds (with SM and OpenSSL enabled).

These warnings were mostly caused by missing casts.

In minidriver there was also a bit of unused variables and dead code.

Remaining warnings on mingw are mostly caused by GCC not recognizing on
this platform "ll" size specifier (present at least since
Visual Studio 2005, also in mingw own CRT) and "z" size specifier (this one
will be fixed in next commits).

There is also a warning about pointer truncation on Win64 when making
PKCS#11 object handle from pointer to this object.
This is a legitimate warning, since it could result in the same handles
being generated from different pointers and so from different objects.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
2017-03-27 10:58:26 +02:00
Mathias Brossard 762d466b23 Add display of Elliptic Curve flags 2015-01-20 23:15:41 -08:00
Mathias Brossard 7a455f64c7 Support of additional type, mechanisms and attributes 2015-01-20 23:15:31 -08:00
Mathias Brossard c3a0bbc715 Update email and year 2015-01-20 23:14:36 -08:00
Viktor Tarasov 14049fb806 pkcs11: prepare internal API for multi-application mode
- simplify some of framework handles: remove from it's prototype the arguments that can be derived from the other arguments;
for exemple: foo(slot, slot->card) --> foo(slot)
- add the 'application' argument to the bind, unbind and similar handles;
- preview more then one framework data attached to the pkcs11card object.
- placehold for the future 'derive' and 'can_do' handles.
2012-05-22 17:18:00 +02:00
Viktor Tarasov cb13633634 remove trailing whitespaces
inspired by
http://www.opensc-project.org/pipermail/opensc-devel/2012-March/017883.html

Change-Id: If170e830d8d9587a31742feffb6fff54cfdf75b4
2012-04-03 00:00:56 +02:00
Ludovic Rousseau c20cd12809 Fix lookup_enum_spec() prototype
A change introduced in c0072d16dd made the
compilation fail:
pkcs11-display.c:738:1: error: conflicting types for 'lookup_enum_spec'
pkcs11-display.h:64:13: note: previous declaration of 'lookup_enum_spec' was here
2012-02-20 14:01:53 +01:00
Viktor Tarasov c0072d16dd pkcs11: coding style
Signed-off-by: Viktor Tarasov <viktor.tarasov@gmail.com>
2012-02-20 11:54:02 +01:00
Viktor Tarasov 8f9bbbe780 pkcs11: win32 compilation error
pkcs11-display.c(139) : error C2275: 'CK_BYTE' : illegal use of this type as an expression

Signed-off-by: Viktor Tarasov <viktor.tarasov@gmail.com>
2012-02-20 11:34:22 +01:00
Ludovic Rousseau 48f8f982a0 Display the ASCII equivalent of a hex dump
The output format of a hex dump has changed from:
    668C045A 1C3A4EF4 CF8550F3 20926525 1E8BF478
to:
    00000000  66 8C 04 5A 1C 3A 4E F4 CF 85 50 F3 20 92 65 25  f..Z.:N...P. .e%
    00000010  1E 8B F4 78                                      ...x

Is it now possible to find text strings inside a hex dump
2012-01-10 13:44:20 +01:00
andre f1293c372d pkcs11-display: Fixing some type mismatches that the compiler complains about.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4943 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-13 06:28:37 +00:00
andre 0eb404b2e6 pkcs11-display.c: more detailed less verbose output of CK_ATTRIBUTE lists
http://www.opensc-project.org/pipermail/opensc-devel/2010-November/015321.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4881 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-25 00:20:21 +00:00
dengert 09131a4e9f Fix support for CKU_ALWAYS_AUTHENTICATE and CKU_CONTEXT_SPECIFIC
spy segfaulted if CKU_CONTEXT_SPECIFIC was used,
pkcs11-session was reseting the userType before calling 
framework.  Framework will now see CKU_CONTEXT_SPECIFIC
and use slot->login_user to determine which PIN was used
to create the original session, and will send the PIN
to the card. It does not treats CKU_CONTEXT_SPECIFIC 
as a full login, only a reassertion of the PIN. 



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4880 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-24 20:28:30 +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
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 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
martin 94d0f8d835 Remove ancient unused code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3598 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-05 15:53:31 +00:00
ludovic.rousseau 6f3012d959 add CKM_SHA256* and CKM_SHA384* logs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3596 c6295689-39f2-0310-b995-f0e70906c6a9
2008-11-27 10:44:57 +00:00
martin 7b93c51230 Missing SHAs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3593 c6295689-39f2-0310-b995-f0e70906c6a9
2008-11-24 21:53:56 +00:00
ludovic.rousseau 56ea99d8a0 print_mech_info(): replace printf by fprintf to correctly redirect the
log


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3554 c6295689-39f2-0310-b995-f0e70906c6a9
2008-08-12 09:51:43 +00:00
ludovic.rousseau 4fd85ce0cf print_generic() & print_print(): size is a CK_ULONG (unsigned) so compare
using "!= (CK_LONG)(-1)" instead of "> 0"


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3525 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-26 08:30:39 +00:00
ludovic.rousseau 91177e51ec Use size_t instead of int when needed, plus some other minor changes
Patch bug.1 included in Ticket #176


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3510 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-05 13:00:01 +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
aj c66889dc9e fix broken changes.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3182 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 12:14:50 +00:00
aj 4f0329cd18 silence more gcc/sparse warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3180 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 12:01:39 +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 b9daff9b28 replace rsa pkcs#11 header files with rewrite.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3066 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-30 08:11:58 +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
sth 891ed0f197 Added Netscape/Mozilla specific types etc.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2524 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-29 12:49:53 +00:00
nils 65eec98c71 enhance attribute support; patch supplied by supplied by Marc Bevand <bevand_m@epita.fr>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2386 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-08 21:16:31 +00:00
nils a248911ed2 cleanup, patch supplied by Marc Bevand
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2344 c6295689-39f2-0310-b995-f0e70906c6a9
2005-05-20 09:55:13 +00:00
nils d953492739 bugfix; supplied by Marc Bevand <marc.bevand@smartjog.com>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2318 c6295689-39f2-0310-b995-f0e70906c6a9
2005-04-24 09:28:27 +00:00
nils c30494a942 declare some functions static + some type fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2144 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-06 10:28:43 +00:00
nils cb5d576267 some indent fixes from Martin Paljak plus some additional changes from me
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2083 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-19 18:15:43 +00:00
sth 4f580598b0 Fix: don't print the contents of a NULL pointer
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1423 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-06 13:36:59 +00:00
aet d63e83d4e3 - Linking cleanups for libpkcs11 / opensc-pkcs11
- Build fixes for PKCS#11 spy module by Mathias,
  so far untested. TODO: C_UnloadModule?


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1410 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-03 18:08:54 +00:00
aet 3a2a4463b1 Add PKCS#11 spy sources by Mathias Brossard <mathias dot brossard AT idealx
dot com>


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1408 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-03 17:19:08 +00:00