Commit Graph

23 Commits

Author SHA1 Message Date
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
aj 9406ce2885 Updated piv driver by Douglas E. Engert:
the PIV driver no longer need to set the card max_*_size parameters
   to get around emulating read_binary and write_binary. It can
   now handle partial reads and writes.

   The assumptions for write_binary are that the first chuck will
   have idx = 0, and the last chunk will write the last byte.
   The flags parameter will contain the total length.

   The only write_binary operations are done when initializing
   a card, and this is only done from piv-tool.c which was modified
   to pass in the length and other flags.

   Piv-tool continues to be a primative test tool for inializing test
   cards. But it has been expanded to be able to write other objects
   on test cards.

   The serial number of a PIV  card is obtained from the CHUID object
   if present which has a FASC-N which is an ID number created by the
   issuer. Normally PIV cards are issued the U.S. Federal government
   But there are ways to use the same cards with a non government CA.
   This is then be referred to as PIV Compatible. In this case,
   the FASC-N should start with an agency code = 9999 and an RFC 4122
   GUID should be present in the CHUID. If this is the case, the GUID
   is used as the serial number.

   Windows 7 comes with a PIV card card driver, but to get it use one of
   these card the CHUID is required. (piv-tool can now write one.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3998 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-05 06:16:37 +00:00
martin 17b7e1b041 Remove unused variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3828 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 11:12:43 +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 d672fde449 Remove sc_error and sc_ctx_suppress_errors_* in favor of sc_debug/fprintf
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3721 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 08:46:59 +00:00
aj 16f045bf0c Douglas E. Engert: major update for the PIV smartcard.
The major issue is with getting the length of an object or the cert
contained in an object. The PIV card does not have a directory on the card,
So the previous version tried to put off as long as possible the reading
of objects for performance so as to avoid having to read objects that would
not be used. The first standard, NIST 800-73, set maximum sizes for objects.
800-73-2 removed this for certificates.

A certificate object can contain a certificate which might be compressed.
The only way to get the length of the compressed certificate is to decompress
it. Thus the decompressed certificate could be larger then the container object,
so even if the PIV card had a directory, one would still need to decompress
the certificate to find its length.

OpenSC sc_read_binary will use the length obtained by using
sc_select_file(...,&file_out), and thus the lengths must be determined
in sc_select_file.

Change are to card-piv.c and pkcs15-piv.c and include:
  * The old cache code which was not working was removed.
  * New cache code was added which caches all object read from the card
  * If an object has a cert, the cert is decompressed and also cached.
  * As part of reading an object the first 8 bytes are read
    and this is then used to allocate a large buffer to read in the
    object.
  * If pkcs15 or pkcs11 asks about a certificate, the cert object
    will be read, and the cert decompressed, to get the actual length.
  * If piv_select_file is called with the file_out != NULL the object
    will be read to get the length If called with NULL it will not be read.
  * The enumeration of the objects now starts with 0.
  * sc_ctx_suppress_errors_on and off are used to avoid file not found
    messages which are are a by product of not having a directory.
  * "Unsigned Card Holder Unique Identifier" object in card-piv and pkcs15-piv.c
     had conflicting paths, as NIST 800-72-1 had two tables with different
     paths. The enumtag for it in card-piv.c was also wrong.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3710 c6295689-39f2-0310-b995-f0e70906c6a9
2009-07-22 10:09:21 +00:00
ludovic.rousseau e928d5565c convert C++ in C comment
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3502 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:57:03 +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 ca92ec661f patch from Douglas E. Engert for bug #165
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3292 c6295689-39f2-0310-b995-f0e70906c6a9
2007-11-09 08:35:23 +00:00
aj 047ee1d73e fix more warnings found by gcc/sparse.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3178 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 11:07:00 +00:00
aj 9946e237de Douglas E. Engert:
Major improvments in the PIV card modules: 
* OpenSC-0.11.2 only supported RSA 1K keys, the patch supports RSA 2K and 3K
  keys.
* The FASC-N in the CHUID object is used as the card serial number. 
* A PIV card may have additional objects. These can now be read by pkcs11-tool
  and pkcs15-tool. 
* The p15card-helper.c module is no longer used. The code to call the
  sc_pkcs15emu_* routines has been moved back into pkcs15-piv.c and uses
  existing OpenSC routines to parse the certificate to find the modulus_len. 
* pkcs15-piv.c will now get the modulus_len from the certificates to store into
  the emulated prvkey an pubkey objects as they are being created using the
  sc_pkcs15emu_* routines. 
* The caching code that was added to card-piv.c in 0.11.2 is disabled, as
  pkcs15-piv.c will cache the certificate using existing OpenSC routines. 
* piv-tool will now print a serial number. 
* The key-usage bits for prvkey and pubkey objects are set in pkcs15-piv.c 
* The PIV "9E" key was added. It is not a private object, and can be used
  without a PIN. It is used with the "Certificate for Card Authenticaiton". 
* When used with the OpenSSL engine to generate a certificate request, the
  public key saved by piv-tool during a "generate asymmetric key pair" card
  command can be read from a file pointed at by the environment variable
  PIV_9*_KEY. Where * is A, C, D or E. 
* In the card_atr section of opensc.conf, flags = 20; can be used to only show
  the PIV Authentication cert. This feature was in 0.11.1 but was dropped in
  0.11.2 when the p15card-helper.c was introduced.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3174 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 07:07:49 +00:00
aj eab8ade2ec changes by Douglas E. Engert:
change the do_decompress* to sc_decompress* and the initialize_* to
sc_pkcs15emu_initialize_* in the new code.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3126 c6295689-39f2-0310-b995-f0e70906c6a9
2007-03-12 20:15:39 +00:00
aj c6954a9c33 full piv update by Thomas harning Jr. and David E. Engert,
adding compression etc. Also enables opensc to be compiled
with and without zlib support.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3125 c6295689-39f2-0310-b995-f0e70906c6a9
2007-03-10 10:46:32 +00:00
nils 1d1b8779e3 use EVP API for DES encryption
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3106 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-08 20:19:10 +00:00
aj ad79822134 convert to utf-8.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3085 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-19 21:32:31 +00:00
vtarasov 2d4bd463b0 Use do {...} while(0) construction for SC_TEST_RET, SC_FUNC_RETURN and SC_FUNC_CALLED defines
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3050 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-06 11:15:09 +00:00
nils 88bae5c923 remove iso logout function, remove dummy logout functions and remove logout call from sc_unlock()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2971 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-17 12:24:04 +00:00
aj 5dcaeccb1e fix double free and segfault.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2905 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-26 10:04:33 +00:00
aj 0222683058 Douglas E. Engert wrote:
The attached change to card-piv.c is need to recognize a
valid PIV card applet. All of the previous test cards would
return in response to a SELECT the full AID where as they
should have returned the the PIX portion of the AID. The newest
test cards are now doing this correctly.

This change will recognize either as a PIV applet.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2885 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-11 20:50:13 +00:00
nils 126595bb07 fix some warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2858 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-23 18:43:14 +00:00
martin 530dc0916d Add an example config entry for PIV cards and remove a card matching black hole
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2856 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-23 11:49:22 +00:00
nils 8410084f0e fix warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2851 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-17 21:06:31 +00:00
nils b051b08584 add initial PIV card support; patch supplied by Douglas E. Engert <deengert@anl.gov>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2842 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-14 22:09:10 +00:00