Commit Graph

1470 Commits

Author SHA1 Message Date
Jakub Jelen aaa302ca35 asn1: Allow non-strict INTEGER parsing for other code paths (FCI parsing) 2020-01-07 14:50:47 +01:00
carblue f14043aad6 opensc-explorer get: prevent sc_read_binary applied on record-based files 2020-01-07 10:35:39 +01:00
carblue c1fb5b130e opensc-tool print_file: fix addressing records 2020-01-07 10:24:10 +01:00
Priit Laes 0b4b7fbaf0 openssl: Drop all compatibility checks for <=openssl-1.0.0 2020-01-06 15:47:07 +01:00
Khem Raj 05e3f7b667 Fix misleading code indentation
Fixes
error: misleading indentation; statement is not part of the previous 'if' [-Werror,-Wmisleading-indentation]
         if(cipher)
         ^
../../../git/src/libopensc/card-entersafe.c:369:2: note: previous statement is here
        if(sbuf)
        ^
2019-12-28 18:18:06 +01:00
Julian Strobl e9aa163fe5 pkcs11-tool: fix output of test_decrypt
Before the output looked like this, if a public key was not found:
```
  testing key 1 (IDKey2)
    RSA-X-509: OK
    RSA-PKCS: OK
  testing key 2 (IDKey3)
couldn't find the corresponding pubkey for validation
couldn't find the corresponding pubkey for validation
    RSA-X-509:     RSA-PKCS:   testing key 3 (IDKey4)
couldn't find the corresponding pubkey for validation
couldn't find the corresponding pubkey for validation
```

Now:
```
  testing key 1 (IDKey2)
    RSA-X-509: OK
    RSA-PKCS: OK
  testing key 2 (IDKey3) -- can't find corresponding public key, skipping
  testing key 3 (IDKey4) -- can't find corresponding public key, skipping
```
2019-12-28 18:15:55 +01:00
Julian Strobl 81940e123b pkcs11-tool: align output for test_signature
Before it was a bit confusing, e.g.:
```
  testing key 1 (2048 bits, label=IDKey2) with 1 signature mechanism
    RSA-X-509: OK
couldn't find the corresponding pubkey
  testing key 2 (0 bits, label=IDKey3) with 1 signature mechanism -- can't be used to sign/verify, skipping: can't obtain modulus
```

The error message in line 3 is for IDKey3 and not for IDKey2.

With this patch the output is aligned with `test_verify`:
```
  testing key 1 (IDKey2) with 1 mechanism
    RSA-X-509: OK
  testing key 2 (IDKey3) with 1 mechanism -- can't find corresponding public key, skipping
```
2019-12-28 18:15:55 +01:00
Frank Morgner 39c1400fac opensc-notify: fixed name in plist 2019-12-04 14:55:23 +01:00
carblue d4823541b7 pkcs15-init: Fix issue #1219 2019-11-23 21:38:14 +01:00
Frank Morgner 07cff0e168 fixed 341844 Incorrect deallocator used 2019-11-05 21:49:30 +01:00
Frank Morgner 3a1bd36e20
Use onepin-opensc-pkcs11.so for Chromium (#1828)
* pkcs11-register: Fixed detection of already registered OpenSC

Anny configuration of onepin-opensc-pkcs11.so and opensc-pkcs11.so
should be enough to skip registering the default module again.

* Use onepin module for generic NSS DB

fixes https://github.com/OpenSC/OpenSC/issues/1818

May have the disadvantage that some other programs that use NSS don't
see the signature keys. However, we currently only know for sure that
Chromium is using the generic NSS DB.
2019-10-16 13:16:22 +02:00
Frank Morgner 53ff7182fb
pkcs11-tool: disable wrap/unwrap test (#1808)
... until https://github.com/OpenSC/OpenSC/issues/1796 is resolved
2019-10-01 11:52:33 +02:00
Frank Morgner e2491a7d7f
pkcs11-tool: fixed displaying secret key attributes (#1807)
fixes https://github.com/OpenSC/OpenSC/issues/1805
2019-10-01 11:51:55 +02:00
Frank Morgner 25bc8fc167 fix https://github.com/OpenSC/OpenSC/issues/1786
Thanks to Alexandre Gonzalo
2019-09-16 13:06:38 +02:00
Peter Popovec 5b8095ca2c string null-termination fix
strncpy does not generate null-terminated string, fixed by memcpy.
2019-09-02 09:32:12 +02:00
Frank Morgner a1d3e76999 openpgp: handle cards with static algorithms
fixes https://github.com/OpenSC/OpenSC/issues/1659
2019-08-28 11:06:55 +02:00
Peter Popovec d7a86d397f opensc-tool: do not connect card if not neccesary, fix util.c errors
opensc-tool: for options --version, --list-readers, -D, etc. we do not
need to connect card/reader. This removes unnecessary error messages
if card is not present in card reader or if reader is not available.
util.c: use symbolic error codes, pass error codes to caller without change.
2019-08-20 13:38:51 +02:00
Frank Morgner b6be87a348 make sc_format_apdu_ex agnostic to card properties 2019-08-20 13:38:20 +02:00
Peter Popovec 426772298a pkcs15-tool: inconsistent -r option fix
Option -r is used in other opensc tools to specify card reader.  pkcs15-tool
uses -r to specify cerfificate.  This fix intorduces warning message if -r
is used, and for future versions of pkcs15-tool -r is used to specify
reader.
2019-08-05 01:14:35 +02:00
carblue 709fa98bb5 opensc-tool: fix --list-algorithms for AES 2019-07-22 13:09:30 +02:00
Peter Marschall 229dd32e3a opensc-explorer: fix APDU command
Do not ignore first parameter.
2019-06-21 14:34:38 +02:00
Raul Metsma 3a192e2c87 pkcs11-tool: Add extractable option to key import
Signed-off-by: Raul Metsma <raul@metsma.ee>
2019-06-03 10:59:58 +02:00
Doug Engert a2dd500624 Fix pkcs11-tool encryption error Fix #1694
Make sure data being encrypted is less then the modulus.

 On branch pkcs11-tool-encryption
 Changes to be committed:
	modified:   ../tools/pkcs11-tool.c
2019-05-31 14:16:24 +02:00
Frank Morgner b7b501d0a5 fixed issues reported by clang-analyzer 2019-05-21 19:34:46 +02:00
Jakub Jelen e501c5ae81 Unbreak build without OpenSSL 2019-05-21 18:44:06 +02:00
Frank Morgner e275b34269 fixed 339157 Unused value 2019-05-14 14:50:17 +02:00
Andreas Kemnade c3a9458fa8 egk-tool: fix missed initialisation of card pointer
If util_connect_card_ex() fails, sc_disconnect_card() will use a
random pointer leading to segmentation faults.
2019-05-02 10:09:08 +02:00
Andreas Kemnade 209be72979 eGK: fix path for vd/gvd
path was wrong, the same as for pd
2019-05-02 10:09:08 +02:00
Frank Morgner f0a6a568f4 fixed Local variable hides global variable 2019-05-02 10:08:28 +02:00
Frank Morgner 86ba3ea489 fixed Wrong type of arguments to formatting function 2019-05-02 10:08:28 +02:00
Frank Morgner c671083ee3 fixed missing file 2019-04-25 16:46:07 +02:00
Frank Morgner 8382f243b2 fixed 337891 Out-of-bounds write 2019-04-25 15:44:11 +02:00
Frank Morgner bfa94dc90d
Merge pull request #1600 from AlexandreGonzalo/trustonic_pkcs11 2019-04-25 14:51:54 +02:00
alegon01 e21cb5712c Fix in encrypt_decrypt(), initialize the mgf 2019-04-24 14:03:35 +02:00
Dmitriy Fortinskiy 8cf1e6f769 pkcs11-tool: List supported GOST mechanisms 2019-04-17 16:42:12 +02:00
Dmitriy Fortinskiy a5382d32fd pkcs11-tool: Show GOSTR3410-2012 keys 2019-04-17 16:42:12 +02:00
Dmitriy Fortinskiy 0e12b1dc71 pkcs11-tool: Generate GOSTR3410-2012 keys 2019-04-17 16:42:12 +02:00
Dmitriy Fortinskiy 4614beb87e pkcs11-tool: Add keys access flags 2019-04-17 16:40:41 +02:00
Raul Metsma 91a1dd9af4 Option to delete object by index
Signed-off-by: Raul Metsma <raul@metsma.ee>
2019-04-17 14:38:40 +02:00
Raul Metsma 3935d501bf Implement Secret Key write object
Signed-off-by: Raul Metsma <raul@metsma.ee>
2019-04-17 14:37:49 +02:00
Frank Morgner 066c30bb4e opensc-notify: add to autostart 2019-04-08 11:16:13 +02:00
Frank Morgner 159821497c egk-tool: fixed verbose logging 2019-04-08 11:16:13 +02:00
Frank Morgner fe95520e3e explicitly import libpkcs11.h 2019-04-08 11:16:13 +02:00
Frank Morgner 6f9b58af72 added pkcs11-register 2019-04-08 11:16:13 +02:00
Jakub Jelen fc4d600634 pkcs11-tool: Allow to set CKA_ALLOWED_MECHANISMS when creating an objects
Also list them in the attributes listing
2019-04-08 11:15:19 +02:00
alegon01 f631b5f733 Fix in encrypt_decrypt(), check for (in_len <= sizeof orig_data) 2019-04-05 10:39:52 +02:00
alegon01 4913feadb8 Fix in encrypt_decrypt(), check for (in_len <= sizeof orig_data) 2019-04-05 10:38:12 +02:00
Peter Popovec f070c99b65 opensc-tool: do not use card driver to read ATR
If card driver fails to connect to card, 'opensc-tool -a' may fail to print
ATR even if ATR is available from card reader.  Before use of card driver,
do only card reader connect, then print ATR.  Only if it is neccesary, use
card driver for the rest of opensc-tool functions.
2019-03-25 14:34:26 +01:00
Frank Morgner 2f4df1b93e tools: unified handling of gengetopt 2019-03-25 14:30:09 +01:00
Frank Morgner fc9277b778 use compat_getopt_long if getopt_long is not available
uses the autoconf way for replacing getopt.h

fixes https://github.com/OpenSC/OpenSC/issues/1527
2019-03-25 14:30:09 +01:00