Commit Graph

6934 Commits

Author SHA1 Message Date
Frank Morgner 318329d5b7 macOS: disable notifications only in PKCS#11 module
basically reverts
c35eb1c9bc
by applying a more selective fix for
https://github.com/OpenSC/OpenSC/issues/1174
2018-04-27 23:16:14 +02:00
Frank Morgner 2dad9a9fde gio: changed default symbols 2018-04-27 12:26:48 +02:00
Frank Morgner ac5852836d GIO: Check connection to DBus before notifying
avoids error messages when dbus is not available.
2018-04-27 12:26:48 +02:00
Frank Morgner 537a208c25 Use non unique flag for App ID
When loaded as PKCS#11 module, OpenSC will reuse the application
identifier for each instance. We don't want to put any burdon on the
primary GApplication, so we use a non unique ID.

fixes https://github.com/OpenSC/OpenSC/issues/1332
2018-04-27 12:26:48 +02:00
Frank Morgner 099270092a added documentation of some command line options 2018-04-27 09:23:34 +02:00
Frank Morgner 90a5b262d0 nPA: fixed matching for newer cards
they have other ATRs... match if EF.CardAccess is found
2018-04-26 21:55:54 +02:00
Frank Morgner 4e83e2e1b3 reader-pcsc: fixed default for disconnect_action
Initialize it to "leave", even if no pcsc configuration block was given.
2018-04-26 14:48:54 +02:00
Frank Morgner dd1a606d0d updated tools.xml for inclusion in wiki 2018-04-25 23:43:08 +02:00
Frank Morgner 58a824527b sc-hsm: fixed default labels for GoID 2018-04-25 23:27:55 +02:00
David Ward 841e13c9c1 macOS: Update description at top of MacOSX/build-package script
Explicitly mention that this script builds the tokend and command
line tools (as it does not build the CryptoTokenKit app extension).

Add two missing packages in the list of build dependencies.
2018-04-25 13:01:49 +02:00
David Ward bddef2485f macOS: Remove unused build code for the CryptoTokenKit app extension
OpenSCToken (https://github.com/frankmorgner/OpenSCToken) is now a
standalone package that provides the CryptoTokenKit app extension.
It includes its own 'build-package' script, which handles building
the OpenSC library and statically linking against it.

The 'MacOSX/' directory in OpenSC itself is only used to build the
macOS tokend. Remove unused code for building a CryptoTokenKit app
extension from this directory (which no longer works). This should
help to avoid confusion when building OpenSC for macOS.
2018-04-25 13:01:49 +02:00
David Ward fff4ca901d Provide more space for card holder name in CAC token label
The PKCS#15 emulation layer for the CAC uses a single PIN. Set its
label to "PIN" (rather than the card type "CAC I" or "CAC II"), so
that the PIN label will be omitted from the token label, providing
more space for the card holder name instead.

This is intended to match the behavior used for PIV cards, which
was changed with commit 56c8f59b25.
2018-04-24 14:35:11 +02:00
David Ward eb0f4e1850 Slightly adjust pull request template
During a pull request, it might not be possible for all components
(such as the PKCS#11 module, Windows minidriver, or macOS tokend)
to be tested by the same person using the same card; not everyone
has access to all of the platforms supported by OpenSC. When there
are no card-specific changes, each component might be tested by a
different person using a different type of card.

The pull request template contains a checklist with each component
that needs to be tested (which can be adapted as needed). However,
this checklist also includes an item for the type of card used for
testing. This should certainly be included in the message, but it
doesn't quite seem to belong in the checklist as a separate item,
particularly when considering the multiple-card testing situation
described above. It seems that the checklist is intended to track
specific tasks that still need to be completed.

This change slightly adjusts the template in order to handle this.
(It is still just a template, and it can be adapted for each pull
request as needed.)
2018-04-24 12:31:48 +02:00
Peter Marschall 504d267e76 openpgp: don't treat OpenPGP v3 cards special in src/libopensc/pkcs15-syn.c
As OpenPGP v3 cards are backward compatible with earlier versions,
fix an inconsitency in src/libopensc/pkcs15-syn.c
2018-04-22 21:32:17 +02:00
Frank Morgner 3bfede17d4 AppVeyor: let configure know that we're building with native tools 2018-04-20 15:09:06 +02:00
David Ward 2c167a9982 Address compiler warnings when using --disable-optimization (#1325)
* Handle errors as intended in sc_pkcs15emu_openpgp_add_data()

If a data object can be read, but it cannot be added to the PKCS#15
framework, return from this function with an error; do not continue
reading other data objects. Otherwise, do not return an error from
this function when a data object cannot be read or is empty.

Improve existing comments for clarity.

* Address other compiler warnings when using --disable-optimization

Certain variables that are not initialized when they are declared
prevent the build from completing, when --disable-optimization is
passed to ./configure.
2018-04-15 09:37:43 +02: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
Frank Morgner b4bc6de81b prepare 0.18.0 2018-04-13 18:43:18 +02:00
Jakub Jelen 29a27dd6d7 pkcs11-tool: Add examples section to the manual page 2018-04-13 09:28:09 +02:00
Feitian Technologies 7b249084d8 Improve code and fix sign bugs (#1306)
1. In epass2003_set_security_env, remove unused code, add condition
check of ec and rsa
2. Line 1709 - add return check of hash_data
3. In epass2003_decipher API, the old sign using apdu.le = 256, now add
condition check of rsa
4. Line 2731-2734 - After login successful, need get session status,
adjust code, improve condition check of data->cmd.
2018-04-11 13:48:41 +02:00
Frank Morgner 54097c0fc0 fixed .travis.yml 2018-04-07 14:32:53 +02:00
Frank Morgner 647b623357 (hopefully) fixed .travis.yml 2018-04-07 13:04:27 +02:00
Frank Morgner 148bc25238 fixed coverity issues
- CID 145623 (#1 of 1): Resource leak (RESOURCE_LEAK)
- CID 269069 (#1 of 1): Resource leak (RESOURCE_LEAK)
- CID undefined (#1 of 1): Dereference before null check (REVERSE_INULL)
2018-04-07 12:27:12 +02:00
Frank Morgner e1bc515363 optionally try covertiy_scan with every build on master
idea from https://github.com/umlaeute/Gem/blob/master/.travis.yml
2018-04-07 12:08:08 +02:00
Laurent Bigonville 491e5a47fc Clean up the belpic driver
Remove all the code related to the old GUI and PIN PAD.

This code was initially developed by Zetes and had the ability to
display a dialog to request the PIN to the user. It was also able to
manage some specific proprietary pin pads.

As the Belgian government/fedict has now its own implementation, all
these old crufts can be removed.

https://github.com/OpenSC/OpenSC/issues/1296
2018-04-06 12:42:12 +02:00
Frank Morgner fc64c87c5c with keep_alive, use cache only within the transaction
fixes https://github.com/OpenSC/OpenSC/issues/1159
2018-04-06 12:20:32 +02:00
Frank Morgner 74bdcad4e8 fixed description of --disable-strict 2018-04-06 12:20:32 +02:00
Frank Morgner 445ae0919b rename opensc-notify goi app id
fixes https://github.com/OpenSC/OpenSC/issues/1309
2018-04-05 21:13:23 +02:00
Doug Engert 0911982bef Various PIV changes
Some ActivIdentity CAC/PIV cards lose the login state when selecting
the PIV AID SC_CARD_TYPE_PIV_II_CAC and CI_PIV_AID_LOSE_STATE were added
so piv_card_reader_lock_obtained will  try and do a SELECT PIV AID.

card->type is reset to its original value if piv_match_card_continued
fails to match a card as PIV.

pkcs15-piv.c now uses sc_card_ctl which checks card->ops->card_ctl for NULL.

closes https://github.com/OpenSC/OpenSC/pull/1307
fixes https://github.com/OpenSC/OpenSC/issues/1297
2018-04-05 15:23:16 +02:00
Jakub Jelen a5839bb83c Temporarily disable tests to make CI pass 2018-04-04 21:43:01 +02:00
Jakub Jelen 8a63103229 Properly report errors from make check in travis 2018-04-04 21:43:01 +02:00
Jakub Jelen eb646dd370 Do not create getSUBJECT without OpenSSL 2018-04-04 21:43:01 +02:00
Jakub Jelen 58cd9aaeb6 card-authentic.c: Initialize variables and make it build
Ammends: #1205
2018-04-04 21:43:01 +02:00
Jakub Jelen 0997c33a30 pkcs11-tool: Print also SUBJECT of certificate
List also the names of generated functions for better searchability
2018-04-04 21:43:01 +02:00
Jakub Jelen a6e6cfb6de Log return value of C_GenerateRandom() 2018-04-04 21:43:01 +02:00
Jakub Jelen 0c974a0cc7 Incorporate the first manpage integrity check 2018-04-04 21:43:01 +02:00
Jakub Jelen db2ceff911 Avoid circullar dependency 2018-04-04 21:43:01 +02:00
Jakub Jelen 161e83a243 Add missing pkcs11-tool options to man page 2018-04-04 21:43:01 +02:00
Jakub Jelen e193b31e1a Log the used config file after processing it 2018-04-04 21:43:01 +02:00
Mouse b7dc5a0890 Retrieve OpenPGP applet version from OpenPGP applet on YubiKey token (#1262) 2018-04-04 21:41:39 +02:00
Frank Morgner 3e22daf7b5 OpenPGP: fixed memory leak 2018-04-04 10:02:30 +02:00
sergioag 098eed146f [AuthentIC v3] Correctly handle APDUs with more than 256 bytes (#1205) 2018-03-31 21:51:11 +02:00
AnthonyA 74885fb1c1 pkcs11-tool: allow mechanism to be specified in hexadecimal
To support vendor mechanisms, let -m accept hexadecimal strings,
e.g., -m 0x80001234
2018-03-31 21:39:53 +02:00
Frank Morgner 45ad44e311 fixed handling SC_ASN1_TAG_EOC from sc_asn1_read_tag
We can't check for `tag == SC_ASN1_TAG_EOC` directly, because this
would also be true for a tag of 0x80 (with `class ==
SC_ASN1_CLASS_CONSTRUCTED`). So what we do is we check for the output
buffer to be NULL!

fixes https://github.com/OpenSC/OpenSC/issues/1273
2018-03-30 08:28:51 +02:00
Frank Morgner fe0d6f9187 fixed invalid read 2018-03-22 15:09:25 +01:00
Frank Morgner a84bf918af fixed memory leak 2018-03-22 14:54:50 +01:00
Frank Morgner b643bbbe40 fixed memory in case of a certificate parsing problem 2018-03-22 14:34:02 +01:00
Vadim Penzin e1d6f0869b Add missing initialisation of variables to pacify Clang.
1. src/libopensc/card-openpgp.c:pgp_store_key().
2. src/libopensc/cwa14890.c:cwa_verify_icc_certificates().
3. src/libopensc/cwa14890.c:cwa_prepare_external_auth().
4. src/libopensc/pkcs15-itacns.c:itacns_check_and_add_keyset().

(Discovered by Clang 4.0.0 on OpenBSD 6.2.)
2018-03-19 09:48:21 +01:00
Vadim Penzin 1ac08f96e7 epass2003: Fix buffer underrun in epass2003_decipher(), etc.
1. Buffer underrun in epass2003_decipher().
2. The parameter `data' in update_secret_key() must be constant.

(Discovered by Clang 4.0.0 on OpenBSD 6.2.)
2018-03-19 09:48:21 +01:00
AnthonyA ea4baf50d5 pkcs11-tool: make ECPoint behaviour standards compliant by default
Fixes #1286. The behaviour of pkcs11-tool will follow the standard -
send DER. If EC_POINT_NO_ASN1_OCTET_STRING is defined then it will
write plain bytes.
2018-03-19 09:39:10 +01:00