Commit Graph

36 Commits

Author SHA1 Message Date
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
aet d208a04872 Cleanups to scconf handling
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1473 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-29 09:00:11 +00:00
sth b5984fccd6 Some changes for the spy: (1) renamed opens-spy to pkcs11-spy, (2) exported all pkcs11 functions, (3) start the log with the name of the module-to-be-loaded, (4) first look in the opensc.conf file for the module and log names
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1471 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-28 19:22:30 +00:00
aet ba1a685c8e Don't bother exposing sc_pkcs11_module_t and scdl_context_t
to public headers, use void instead.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1424 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-06 16:18:15 +00:00
aet 915ddc91ca PKCS#11 spy fixes by Mathias Brossard
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1416 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-04 13:50:30 +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