Commit Graph

1614 Commits

Author SHA1 Message Date
Frank Morgner
8c0e373cae add reader.h and updated ifdhandler.h to ccid-1.4.24's macOS version
as found in macOS Sierra's CCID driver version
https://opensource.apple.com/source/SmartcardCCID/SmartcardCCID-55013/ccid/ccid/MacOSX/
2023-01-17 15:40:02 +01:00
Claus Steuer
258ebe2e40 allow feature query for maximum APDU size
If the reader's maximum APDU size (dwMaxAPDUDataSize)
cannot be queried the client application must assume
that only short APDUs are supported.
Since there is no data size limit for virtual smart card communication
dwMaxAPDUDataSize can be set to the maximum APDU size of
65536 (extended APDUs).

This updates pcsclite-vpcd's reader.h/ifdhandler.h to pcsc-1.9.9
https://salsa.debian.org/rousseau/PCSC/-/blob/1.9.9/src/PCSC
2023-01-17 15:40:02 +01:00
Frank Morgner
23d27d3834 avoid *check* with clang-tidy in OpenSC submodule 2022-09-30 13:06:16 +02:00
Frank Morgner
6bcef5705e virtualsmartcard: added more information about VS and WDK dependencies
closes https://github.com/frankmorgner/vsmartcard/issues/149
2022-09-19 17:30:03 +02:00
Frank Morgner
88a2fcfaf7 Merge pull request #232 from michaelweghorn/michaelweghorn/port_from_pycrypto_to_pycryptodome
Port from PyCrypto to PyCryptodome
2022-09-19 16:37:46 +02:00
Michael Weghorn
22edc2a228 Port from PyCrypto to PyCroptodome
As the PyCrypto website says [1]:

> PyCrypto 2.x is unmaintained, obsolete, and contains security
> vulnerabilities.

Therefore, switch to PyCryptodome, a maintained PyCrypto fork
which is listed there as the recommended alternative for
existing software that depends on PyCrypto.

Notes on the port:

1) As the PyCryptodome introduction documentation [2] says,
there are 2 alternative projects/namespaces that can be
used:

* pycryptodome, which uses the `Crypto` package
  that PyCrypto also uses, so is almost a drop-in
  replacement for Pycrypto

* pycryptodomex, which uses the `Cryptodome` package

It also mentions that the use of pycryptodome
"is therefore recommended only when you are
sure that the whole application is deployed in a virtualenv".

Since it isn't sure that the application is deployed in a
virtualenv, to make it more explicit that PyCryptodome
is being used and because Linux distros like Debian
package the `Cryptodome` package [3], the port is done to
the `pycryptodomex` library that uses the `Cryptodome`
package name.

2) As the "Compatibility with PyCrypto" page in the PyCryptodome
doc [4] says:

> The following packages, modules and functions have been removed:
>
> * Crypto.Random.OSRNG, Crypto.Util.winrandom and Crypto.Random.randpool.
>   You should use Crypto.Random only.

The `PublicKey.RSA.generate` method already uses
`Crypto.Random.get_random_bytes()` as default [5],
so just drop the second parameter using `RandomPool.getBytes`
in `virtualsmartcard/src/vpicc/virtualsmartcard/cards/cryptoflex.py`.

[1] https://www.pycrypto.org/
[2] https://www.pycryptodome.org/src/introduction
[3] https://packages.debian.org/bullseye/python3-pycryptodome
[4] https://pycryptodome.readthedocs.io/en/latest/src/vs_pycrypto.html
[5] https://pycryptodome.readthedocs.io/en/latest/src/public_key/rsa.html
2022-09-17 22:15:39 +02:00
Michael Weghorn
141509cce3 Drop unused PyCrypto imports 2022-09-17 21:32:56 +02:00
Frank Morgner
bbe5ab9f8c Merge pull request #230 from michaelweghorn/michaelweghorn/correct_hmac_stdlib_import
Correct hmac import from Python stdlib
2022-09-01 15:23:16 +02:00
Michael Weghorn
468e01d164 Correct hmac import from Python stdlib
Commit 82c0c4fdd2
("Fallback to hashlib instead of deprecated libs")
had changed the hmac import to try the import from
the hashlib module, but there appears to be 'hmac'
underneath hashlib in neither Python 2 nor Python 3, but
it's a separate module.

Test on Debian testing with Python 2.7.18:

    $ python2
    Python 2.7.18 (default, Aug  1 2022, 06:23:55)
    [GCC 12.1.0] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    Jedi is not installed, falling back to readline
    >>> from hashlib import hmac as HMAC
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: cannot import name hmac
    >>> import hmac as HMAC
    >>>

The same with Python 3.10.6:

    $ python3
    Python 3.10.6 (main, Aug 10 2022, 11:19:32) [GCC 12.1.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    Using Jedi for tab completion.
    >>> from hashlib import hmac as HMAC
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ImportError: cannot import name 'hmac' from 'hashlib' (/usr/lib/python3.10/hashlib.py)
    >>> import hmac as HMAC
    >>>

Even the official Python 3.10.6 documentation for the hashlib
module use plain hmac import [1] in its example:

    >>> import hmac, hashlib
    >>> m = hmac.new(b'secret key', digestmod=hashlib.blake2s)
    >>> m.update(b'message')
    >>> m.hexdigest()
    'e3c8102868d28b5ff85fc35dda07329970d1a01e273c37481326fe0c861c8142'

Therefore, revert that change to the import and use the direct hmac
import again to make the case where PyCrypto is not installed work
again.

[1] https://docs.python.org/3/library/hashlib.html

Fixes: #223
2022-08-29 22:42:18 +02:00
Frank Morgner
8b4aa3e7bf Merge pull request #228 from michaelweghorn/michaelweghorn/drop_unused_sha1_import
Drop unused SHA1 import
2022-08-08 11:08:09 +02:00
Michael Weghorn
c6f8011ade Drop unused SHA1 import
It is unused since commit 36970a26d7
("Replace PBKDF2 class by python stdlib implementation").

Fixes #218
2022-07-23 13:50:12 +02:00
Frank Morgner
562eb4297a Merge pull request #225 from bowb/master
Client reconnect
2022-06-08 10:23:59 +02:00
bowb
76543ea32b Change socket fd checks against INVALID_SOCKET. Fix issue with allowing reconnects from client to a server. 2022-06-07 13:42:25 -06:00
Frank Morgner
51fb023c3b vicc: use Quad9 instead of Goolge for detecting IP 2022-06-01 10:28:33 +02:00
Frank Morgner
68ca1fb49d vpcd: add support for SCARD_ATTR_ATR_STRING
fixes https://github.com/frankmorgner/vsmartcard/issues/201
2022-06-01 10:27:56 +02:00
Frank Morgner
2e5fac5e18 ccid: documented OpenSSL dependency 2022-05-12 23:17:30 +02:00
Frank Morgner
fa1643af3f add iniitalization of submodules to docs 2022-05-12 22:56:28 +02:00
Frank Morgner
b57b383a1d vicc: move detailed description to APDU class for generic use 2022-05-09 22:26:58 +02:00
Frank Morgner
63e366d348 pcsc-relay: updated docs 2022-05-06 22:46:02 +02:00
Frank Morgner
471abe6950 vicc: fixed error printing 2022-05-06 14:06:18 +02:00
Frank Morgner
4b872bb000 vicc: debug parsed APDU
closes https://github.com/frankmorgner/vsmartcard/pull/103/
2022-05-06 12:24:03 +02:00
Frank Morgner
fe5977bc39 vicc: use logging.critical if vicc needs exit() 2022-05-06 11:57:23 +02:00
Frank Morgner
1e5731fb0e vicc: debug incoming commands as well 2022-05-06 11:53:05 +02:00
Frank Morgner
a982efd8c5 ePass: Python 3 compatibility 2022-02-02 16:36:27 +01:00
Frank Morgner
ccb482cfe9 ePass: documented BAC test 2022-02-02 16:35:50 +01:00
Frank Morgner
98bd7a0c8e virtualsmartcard: fixed more python3 compatibility 2022-02-01 14:21:48 +01:00
Frank Morgner
d16653d377 CI: upload complete apk directory 2022-02-01 08:56:16 +01:00
Frank Morgner
84ed47b462 Release ACardEmulator-3.5 2022-01-31 22:20:09 +01:00
Frank Morgner
3f15100bed Release remote-reader 2.3 2022-01-31 22:12:53 +01:00
Frank Morgner
0a8b6575fb fixed link to binaries as they are available for bot 32 and 64 bit 2022-01-28 18:20:12 +01:00
Frank Morgner
9367685a7b virtualsmartcard: added documentation about driver signing
fixes https://github.com/frankmorgner/vsmartcard/issues/156
2022-01-28 18:17:51 +01:00
Frank Morgner
be6d6e2f73 virtualsmartcard: added missing include
fixes https://github.com/frankmorgner/vsmartcard/issues/138
2022-01-28 00:06:56 +01:00
Frank Morgner
af028aa8c3 virtualsmartcard: fixed some python3 compatibility
fixes https://github.com/frankmorgner/vsmartcard/issues/200
2022-01-27 22:46:12 +01:00
Frank Morgner
6c792dc0d9 updated CI images and links 2022-01-26 17:39:34 +01:00
Frank Morgner
8d5247c44d ACardEmulator: upgrade to gradle and -plugin 2022-01-26 17:03:09 +01:00
Frank Morgner
7dfe39b67d remote-reader: fixed apk name 2022-01-26 17:03:09 +01:00
Frank Morgner
c2b56d5a7d CI: build ACardEmulator 2022-01-26 17:03:09 +01:00
Frank Morgner
7b62d20f25 fix minor linter warning 2022-01-25 22:36:27 +01:00
Frank Morgner
003e28dcdb updated jCardSIM to latest version with included JC SDK 2022-01-25 22:36:27 +01:00
Frank Morgner
ad4ecbb3e3 Removed submodule vJCRE 2022-01-25 22:36:27 +01:00
Frank Morgner
fc3042bb34 CI: add remote-reader 2022-01-25 15:52:10 +01:00
Frank Morgner
1cc4175c8b remote-reader: fixed linter problems 2022-01-25 01:09:20 +01:00
Frank Morgner
82c044e47a acardemulator: explicitly link to google maven 2022-01-25 01:08:48 +01:00
Frank Morgner
a55b6363a0 Merge pull request #215 from Gu1nness/fix-hashlib
Fallback to hashlib instead of deprecated libs
2022-01-21 17:17:38 +01:00
Guinness
82c0c4fdd2 Fallback to hashlib instead of deprecated libs 2022-01-21 14:38:30 +01:00
Frank Morgner
77ea089793 pcsc-relay: removed disfunctional cross compilation script 2022-01-20 02:18:52 +01:00
Frank Morgner
111eb86d3d CI added GitHub actions 2022-01-20 02:18:52 +01:00
Frank Morgner
24c502f152 moved mv appveyor.yml to .appveyor.yml 2022-01-20 01:21:38 +01:00
Frank Morgner
a81c542fce Merge pull request #214 from wareeezer/master
Added firewall rule to installer
2022-01-14 15:35:26 +01:00
nagyi
1f497d3d03 Added firewall rule to installer 2022-01-12 09:27:17 +01:00