Commit Graph

4188 Commits

Author SHA1 Message Date
Diego Elio Pettenò 3c324b8b73 build: fix parallel install by creating directory in the rule
Relying on the rule that creates the directory is a bad idea to be
parallel safe.
2012-05-16 17:18:38 +02:00
Peter Marschall 07d51bea36 OpenPGP: get PKCS#15 token info from preparsed card data
Determine data for sc_pkcs15_card's tokeninfo structure
from sc_pkcs15_card's card structure.
This makes sure the two stay consistent as much as possible.
2012-05-16 17:01:09 +02:00
Peter Marschall 7b4532736e OpenPGP: set version for PKCS#15 2012-05-16 17:01:09 +02:00
Peter Marschall bc0949140d OpenPGP: format paths more nicely 2012-05-16 17:01:09 +02:00
Peter Marschall 0283a6f24e OpenPGP: only add keys with legal algorithm identifier 2012-05-16 17:01:09 +02:00
Peter Marschall 671ac54b71 OpenPGP: more data driven logic
Tie together in a struct what belongs together instead of relying
on the ordering of multiple unrelated arrays.
2012-05-16 17:01:09 +02:00
Peter Marschall 076a4ed2dc OpenPGP: slight cleanup
Use typedef'd types instead of their underlying structs,
use helper functions instead of reinventing the wheel,
and fix typos.
2012-05-16 17:01:09 +02:00
Peter Marschall 4c09e290e1 OpenPGP: make logic more data driven
Instead of doing lots of special-cases in code, create data structures
decide once which variant of the data to use, and then use it.
2012-05-16 17:01:09 +02:00
Martin Paljak 7535f30738 OpenPGP: add the v1.0 spec URL as well to source code comments.
Even though it is obsolete, it makes it more complete;)
2012-05-16 17:01:09 +02:00
Martin Paljak 5f84400ef7 OpenPGP: more support for CryptoStick/OpenPGP v2.0
Using CryptoStick v1.2 with 4096bit keys now allows to authenticate to SSH  with all three keys.
2012-05-16 17:01:09 +02:00
Martin Paljak fb772cccf8 OpenPGP: use actual references in PKCS#15 emulation code for PIN codes. Only v1.1 has 3 PIN codes. 2012-05-16 17:01:09 +02:00
Martin Paljak 63b08786a0 OpenPGP: do not hardcode key sizes to 1024 but fetch actual values from the card.
OpenPGP 2.0 (especially CryptoStick v1.2) supports key sizes up to 4096
2012-05-16 17:01:09 +02:00
viktorTarasov fb1aa8ed11 Merge pull request #32 from frankmorgner/4d9ea43ab24a2e36fc36d1be81b3414cc003786f
new commands for opensc-explorer and bugfix for iso7816 driver

-  opensc-explorer: new find command:
   tested; nice, useful feature.
- opensc-explorer: pace:
   no means to test -- accepted.
- iso driver:
  really bug, thanks.
2012-05-16 06:17:37 -07:00
Viktor Tarasov 20bf3f5484 pkcs11: use short form of log messages
Change-Id: Ice298552238da9eeb0b646fc1ddfaf4d7a8ee4bb
2012-05-13 00:27:38 +02:00
Viktor Tarasov 5d1feb3051 pkcs15: throw an error if there is no valid public key data
Thanks to Nguyen Hong Quan.
http://www.opensc-project.org/pipermail/opensc-devel/2012-May/017997.html

Change-Id: I48bc6664909ca324ef71a2a10d9fddb9096ae598
2012-05-05 14:49:21 +02:00
Frank Morgner 4d9ea43ab2 iso driver: select with p2=0x0c when le is missing 2012-05-03 12:58:45 +02:00
Frank Morgner 59b214ec23 opensc-explorer: implemented `pace` 2012-05-03 12:58:45 +02:00
Frank Morgner 7b630962c1 opensc-explorer: `find [<start fid> [<end fid>]]` 2012-05-03 12:58:34 +02:00
Viktor Tarasov 66aa2b3896 pkcs15: throw an error when trying to read from DF
Change-Id: Ifac6777436f889393e3d3981d98a78149fd6cb17
2012-04-09 11:07:15 +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
Viktor Tarasov e57d443e86 pkcd15init: remove trailing whitespaces
inspired by
http://www.opensc-project.org/pipermail/opensc-devel/2012-March/017883.html

Change-Id: I817f903e67965942d9cc0c30931dbaea0c5f736e
2012-04-02 23:40:05 +02:00
Alon Bar-Lev df8715849d Remove libltdl: Remove ltld references
http://www.opensc-project.org/pipermail/opensc-devel/2011-December/017490.html
cherry-picked from 'libtool' branch of Alon Barlev's github project git://github.com/alonbl/OpenSC.git
and rebased

Remove libltdl: Remove ltld references
(cherry picked from commit a350326c520c5b0cb185f90946648633f4d0e456)

Remove libltdl: Detect libdl
(cherry picked from commit 51e7de45c11823460e776492dcbd40e60583a7eb)

Remove libltdl: Use libscdl
(cherry picked from commit 09f3eadb8a1a47407c011dcd3d5ce461516f3b87)

Remove libltdl: Cleanup libscdl
(cherry picked from commit 52d5f1be01146079e3a6fad1c88ebb0f577d0a94)

Remove libltdl: Cleanup libscdl usage at Microsoft VC build

Untested, I don't have the environment, Martin, please test.
(cherry picked from commit 7fb18f8d0b0bae6d181981a0c71190440e917c2c)

Change-Id: I73c98ccb9365584b12f4b0b97b69316a190b6e45
2012-03-17 20:55:05 +01:00
Ludovic Rousseau 594427e516 Merge pull request #26 from viktorTarasov/staging
merge 'master' into 'staging'
2012-02-22 09:38:37 -08:00
Viktor Tarasov af559fbffd Merge branch 'master' into staging 2012-02-22 11:20:17 +01:00
Viktor Tarasov 2b63213e0a pkcs15-init tool: fix for pin auth_type comparison
partial merge of pull request
https://github.com/OpenSC/OpenSC/pull/8

Thanks to 'joelhockey'.
2012-02-22 09:42:30 +01:00
viktorTarasov 63eb4a4b4b Merge pull request #4 from marschap/iso7816-for-staging
iso7816 cleanups for staging
2012-02-22 00:28:07 -08:00
viktorTarasov e6c501f3de Merge pull request #13 from mjrider/master
2 small fixes for storing a private key
2012-02-22 00:20:49 -08:00
viktorTarasov bc8e320f84 Merge pull request #16 from mjrider/for-opensc-accessflags-fix
Agree,
it's better to fix the key access flags at the general pkcs15init level.
2012-02-22 00:13:57 -08:00
Ludovic Rousseau 006a97b8c8 Use the short form sc_log() instead of sc_debug()
Replace sc_debug(ctx, SC_LOG_DEBUG_NORMAL, ...) by sc_log(ctx, ...) as
suggested by Viktor Tarasov
2012-02-21 21:22:54 +01:00
Ludovic Rousseau 27c6652a1d Remove extra spaces and tabs at end of lines 2012-02-21 21:10:20 +01:00
Ludovic Rousseau af9dada86c Fix compilation error on Windows
SC_READER_CAP_PACE has been renamed to SC_READER_CAP_PACE_GENERIC during
patch discussion.
Thanks to Viktor Tarasov for the bug report
2012-02-21 21:10:20 +01:00
Ludovic Rousseau 97e6ac6ecb Merge pull request #22 from frankmorgner/1141ae520201c91b9859b0cd6cbb59f4ebfbd577
Add possibility to execute PACE on the reader (tested with Reiner SCT RFID standard/komfort)
2012-02-21 05:39:26 -08:00
Frank Morgner 1141ae5202 Add support for PACE-enabled readers
Implements PC/SC interface to PACE-enabled readers defined in PC/SC
pt. 10 AMD 1 and BSI TR-03119.

PACE can be started using `sc_perform_pace`. This function currently
calls the new `perform_pace` from `struct sc_reader_operations`, if the
reader has the needed capabilities. `sc_perform_pace` could also be
extended with a stand-alone implementation of PACE (code could be
imported from here http://vsmartcard.sourceforge.net/npa/README.html).

Note that the reader's PACE capabilities are correctly determined by
calling GetReaderPACECapabilities.

OpenSC's new PACE capabilities can be tested using the `npa-tool` from
the Virtual Smart Card Architecture (see link above).
2012-02-21 14:10:47 +01: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 ec70ee5c4d Merge pull request #20 from LudovicRousseau/staging
Staging
2012-02-17 01:11:49 -08:00
Ludovic Rousseau 0c9717a82e Reformat: remove extra spaces and tabs 2012-02-17 10:06:57 +01:00
Stef Walter 00e02359a3 libopensc: Add 'paranoid-memory' setting for behavior when mlock() fails
* Setting paranoid-memory to true, and mlock() fails, then
   allocations which require non-pageable memory will return NULL
2012-02-17 10:02:55 +01:00
Stef Walter 6ed52a06b8 libopensc: Don't fail to allocate memory when mlock fails
* Print out warning when mlock fails, and continue.
 * The warning required a ctx to be passed in, so that means
   changing a few function signatures.

https://www.opensc-project.org/opensc/ticket/389
2012-02-17 10:02:55 +01:00
Robbert Müller 3248a6b122 Adding default accessflags to the do_store_private_key function in the same way do_generate_key has those accessflags
This seems the right thing to do, when you look at the initial commit which added the flags in do_generate_key and the ticket
http://www.opensc-project.org/opensc/ticket/198

Currently when storing a key, the accessflags are not set
2012-01-10 16:47:27 +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
Ludovic Rousseau 9252eec2d3 Fix compiler warning and real problem
openssl.c: In function 'sc_pkcs11_verify_data':
openssl.c:384:19: warning: 'pkey_ctx' may be used uninitialized in this function [-Wuninitialized]
openssl.c:325:16: note: 'pkey_ctx' was declared here
2012-01-09 11:02:31 +01:00
Robbert Müller 61ea63304b Changing default usage from sign to verify, because verify is the public key opposite of sign for the private key 2012-01-08 15:17:33 +01:00
Robbert Müller d97f239468 Setting usage flags for the public key when storing a private key 2012-01-08 13:50:46 +01:00
Doug Engert 51630a844e Cleanup PKCS15 PIV Card PIN flags
If PIV card Discovery Object is present and Global PIN is preferred,
turn off the LOCAL flag.
2011-12-15 14:58:02 -06:00
Martin Paljak ed7f0b8f79 Merge "Fix for ticket #400" into staging 2011-12-07 13:31:26 +00:00
João Poupino c6fcd68fbc Fix for ticket #400
Specify the path of the Address PIN for IAS-based cards in order to properly
read the Citizen Address Data object.  Remove the "Citizen Data" object
association with the Address PIN, as it incorrectly describes the card layout.

http://www.opensc-project.org/opensc/ticket/400.

Change-Id: I7ca81d6d15c5e2b137ff3c9a40b7471eb2fad55c
2011-12-07 12:49:17 +02:00
Martin Paljak 51804601e4 pkcs15-tool: also print the PIN reference in hex.
This eases debugging.
2011-09-16 14:08:39 +03:00
Martin Paljak 10ae35fd57 Add LGPL header with a generic copyright to util.c
Individual copyright should be delegated to individual commits.
2011-09-13 21:50:20 +03:00