Commit Graph

56 Commits

Author SHA1 Message Date
Vesa Jääskeläinen 1991fa24ae [merge] new output for pMechas
Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
2021-08-10 08:52:42 +02:00
Vesa Jääskeläinen 6431f69dcc pkcs11-spy: Fix crash for pMechanism=NULL
Some test suites are excercising pMechanism==NULL case and this causes
crash when using pkcs11-spy for logging in between.

Centralize logging for pMechanism and handle NULL case.

Signed-off-by: Vesa Jääskeläinen <vesa.jaaskelainen@vaisala.com>
2021-08-10 08:52:42 +02:00
Jakub Jelen 9d1a214340 pkcs11: Undefine internal typedef and remove its usage 2021-06-02 15:46:00 +02:00
Philip Prindeville b9c0addf88 update configure.ac to be less noisy
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-04-01 11:09:22 +02:00
Frank Morgner 5f9085fedb
Merge pull request #1960 from Jakuje/eddsa
Add support for (X)EdDSA keys in OpenPGP driver
2021-03-22 15:36:59 +01:00
Jakub Jelen 16b7c60fd3 Fix more issues with strict aliasing reported by gcc v8
Thanks popoves for reporting this issue
2021-03-18 09:58:21 +01:00
Jakub Jelen e82f875047 pkcs11-spy: Systematize output of C_GetMechanismInfo 2021-03-01 14:35:50 +01:00
Jakub Jelen 0d693f63cb pkcs11-spy: Fix behavior of PKCS#11 3.0 applications when proxying PKCS#11 2.x module
Fixes #2204
2021-01-26 13:52:23 +01:00
Jakub Jelen d224b2612d pkcs11-spy: Implement new functions and interfaces to intercept PKCS #11 3.0 calls 2021-01-11 14:49:22 +01:00
Jakub Jelen b418601942 pkcs11-spy: Dump slot id for C_WaitForSlotEvent 2020-06-09 13:02:27 +02:00
Ludovic Rousseau 2bfd022180 pkcs11-spy: add support of CKM_*_PSS in C_VerifyInit()
In bdb1961dee the same code was added to
C_SignInit(). Now it is also used in C_VerifyInit().
2019-08-27 14:52:10 +02:00
Jakub Jelen df0bbc110e pkcs11-spy: Dump EC Derive parameters 2019-06-17 12:49:11 +02:00
Ludovic Rousseau cc189585c8 pkcs11-spy: display CK_GCM_PARAMS.ulIvBits field 2019-05-29 15:17:15 +02:00
Ludovic Rousseau ffaaf1c0d3 pkcs11-spy: parse CKM_AES_GCM for C_EncryptInit() 2019-04-25 14:52:20 +02:00
Ludovic Rousseau 98ec27e768 pkcs11-spy: log pParameter buffer for C_EncryptInit & C_DecryptInit 2019-04-25 14:52:20 +02:00
Frank Morgner fe95520e3e explicitly import libpkcs11.h 2019-04-08 11:16:13 +02:00
Frank Morgner 54cb1099a0 fixed warnings about precision loss 2018-11-01 00:17:22 +01:00
Peter Marschall 5abe99d228 fix typos
Mass-typo fixing, almost exclusively in comments and text strings.

While at it also fixed a few (very few) grammar errors.
2018-04-15 09:34:45 +02:00
Mouse e4c589639d Add support in pkcs11-tool and pkcs11-spy for RSA-OAEP (#1169)
* Add RSA-OAEP documentation
* Add definitions and structures needed for RSA-OAEP
* Add ability to display RSA-OAEP parameters to SPY

Closes https://github.com/OpenSC/OpenSC/issues/1170
2017-10-19 22:12:47 +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
Frank Morgner 172f320c9a win32: Dedicated md/pkcs11 installation folders
Don't install non-permanent files (md/pkcs11) to system folder anymore.
2017-08-22 23:41:29 +02:00
Ludovic Rousseau 80a313fb2a pkcs11-spy.c: fix 1 warning
pkcs11-spy.c:259:49: warning: format specifies type 'long' but the argument has
      type 'int' [-Wformat]
        fprintf(spy_output, "%s.%03ld\n", time_string, tv.tv_usec / 1000);
                                ~~~~~                  ^~~~~~~~~~~~~~~~~
                                %03d
2016-02-29 20:19:42 +01:00
Frank Morgner ac0424e947 fixed pkcs11spy's version number 2015-01-28 07:09:02 +01:00
Mathias Brossard c3a0bbc715 Update email and year 2015-01-20 23:14:36 -08:00
Ludovic Rousseau 02a2b3d887 Display the flags argument of C_Initialize()
The the pInitArgs argument of C_Initialize() is not NULL it is a pointer
to a CK_C_INITIALIZE_ARGS structure.
This structure contains a flags bitfield with possible values:
- CKF_LIBRARY_CANT_CREATE_OS_THREADS
- CKF_OS_LOCKING_OK

This flags parameter is now parsed and displayed.
2012-06-04 15:42:57 +02:00
Viktor Tarasov fe80ffdbd2 pkcs11-spy: invalid ExpandEnvironmentStrings() call parameter
pkcs11-spy.c(168) : warning C4047: 'function' : 'DWORD' differs in levels of indirection from 'DWORD *'
pkcs11-spy.c(168) : warning C4024: 'ExpandEnvironmentStringsA' : different types for formal and actual parameter 3
pkcs11-spy.c(205) : warning C4047: 'function' : 'DWORD' differs in levels of indirection from 'DWORD *'
pkcs11-spy.c(205) : warning C4024: 'ExpandEnvironmentStringsA' : different types for formal and actual parameter 3
2012-05-30 10:08:30 +02:00
Viktor Tarasov 76b8ad8ad6 pkcs11-spy: timestamp, environment strings in paths
Add to the spy logs the timestamp with millisecond resolution.
Environment strings are accepted in the key registries paths related to spy module.

pkcs11-spy: code formatting
2012-05-28 20:05:28 +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
vtarasov 795dbf0342 win32: change path to the OpenSC registry keys
Now it begins with "SOFTWARE\\OpenSC Project\\..." .


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4940 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-12 10:30:07 +00:00
martin 283ac67229 pkcs11-spy: log matching objects in hex. Patch from Andre Zepezauer
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4781 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-05 14:42:01 +00:00
ludovic.rousseau f47416d60e Do not cast the return value of malloc(3) and calloc(3)
From http://en.wikipedia.org/wiki/Malloc#Casting_and_type_safety
" Casting and type safety

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

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

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

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

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

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


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4636 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-18 15:08:51 +00:00
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 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 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 28c0c6283d print_ptr_in(): change log format
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3516 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-20 09:47:27 +00:00
ludovic.rousseau 232a26b62d C_Initialize(): log the value of the pInitArgs argument
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3515 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-20 09:41:44 +00:00
ludovic.rousseau d7bb718e24 C_Finalize(): do not unload the module since the application may try to
make PKCS#11 calls again


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3513 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-12 09:41:48 +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 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
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 4608716c53 Douglas E. Engert:
Change PKCS11-Spy so it looks in HKEY_LOCAL_MACHINE, before
HKEY_LOCAL_USER.

This should not cause any problems, as the HKEY_LOCAL_MACHINE,
"Software\PKCS11-Spy" would not normally be set, accept while
the sysadmin of the machine as trying to debug a login type problem. 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3006 c6295689-39f2-0310-b995-f0e70906c6a9
2006-08-13 21:20:05 +00:00
aj 347c5b0496 remove a function that is no longer used at all.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2888 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-18 15:15:45 +00:00
aj 881c80d839 pkcs11-spy no longer uses a config file.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2602 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-18 11:00:00 +00:00
sth fd86e44094 Typo fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2570 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-11 19:57:43 +00:00
nils 7a2fec9b86 remove dependence on libopensc, instead use scconf directly.
Note: this code is still experimental !


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2552 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-07 20:05:13 +00:00
nils 9c011b0cab fix check of the return value in C_GetAttributeValue; supplied by Marc Bevand <bevand_m@epita.fr>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2385 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-08 21:04:23 +00:00
bert eb4717ea17 API fixup: use defined type instead of struct for exposed structs (part 2)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2233 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-09 00:04:44 +00:00
nils 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 720b2810ee Little fix: forgotten to log an input param
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1657 c6295689-39f2-0310-b995-f0e70906c6a9
2003-12-04 15:07:26 +00:00