Commit Graph

1638 Commits

Author SHA1 Message Date
Frank Morgner
1df8faa540 fixed possible integer underflow
fixes CID 443646, thanks coverety scan

(cherry picked from commit 007230711693cf12ae59a8439f22399f9727cb24)
2026-06-27 15:03:59 -07:00
Christoph Honal
238ace8c46 Sign using VivoKey certificate 2024-05-23 12:29:26 -07:00
Christoph Honal
1d71760f34 Rename BixV Reader to VivoKey Smart Reader 2024-05-21 07:31:18 -07:00
Maksim Ivanov
d2e607f4c6 Missing newline in CCID error 2024-04-17 23:22:04 +02:00
Frank Morgner
29ccf47113 more compact view of macos' usb devices 2024-03-12 09:11:03 +01:00
Frank Morgner
a985e84a04 update python version
fixes https://github.com/frankmorgner/vsmartcard/issues/269
2024-03-12 08:23:13 +01:00
Frank Morgner
780cc7c4fa pcsc-relay: allow no-ops when sending/receiving 2024-02-27 10:57:12 +01:00
Frank Morgner
1a395716cb ccid-emulator: added Raspberry Pi Zero OTG configuration (untested)
source: ec3e2519ee
2023-10-23 18:57:40 +02:00
Frank Morgner
00f150856b virtualsmartcard: distribute install instructions for Windows 2023-10-01 18:24:52 +02:00
Frank Morgner
5db58fec6e docs: fixed generated images 2023-09-30 03:00:40 +02:00
Frank Morgner
4a442fb3e2 updated documentation 2023-09-27 03:03:35 +02:00
Frank Morgner
bb990a2995 virtualsmartcard: version bump 2023-09-27 02:53:47 +02:00
Frank Morgner
11cccf8873 virtualsmartcard: version bump 2023-09-27 02:35:38 +02:00
Frank Morgner
022931902b fixed documentation warnings 2023-09-27 02:28:03 +02:00
Frank Morgner
56dea5c853 virtualsmartcard: added missing reader.h to distribution 2023-09-27 01:56:03 +02:00
Frank Morgner
b0818e6877 pcsc-relay: version bump 2023-09-27 01:43:28 +02:00
Frank Morgner
e7f0d693a7 appveyor: fixed dubious ownership in repository 2023-09-27 01:35:40 +02:00
Frank Morgner
ecdba39a0d ccid: version bump 2023-09-27 01:19:49 +02:00
Frank Morgner
5059bf4e2e updated shield.io badge images 2023-08-03 01:14:47 +02:00
Frank Morgner
3c816b50d1 virtualsmartcard: disable build of openpace
for now, don't hassle with creating fat ssl binaries by using lipo. just
remove openpace from the binaries for now.

fixes https://github.com/frankmorgner/vsmartcard/issues/242
2023-04-12 03:54:19 +02:00
Frank Morgner
bae7079d2f Merge pull request #252 from mildsunrise/avoid-extra-rtt
avoid unnecessary RTTs for communication
2023-03-17 11:19:43 +01:00
Alba Mendez
8c8116724e swap alloca for malloc 2023-03-16 11:00:15 +01:00
Alba Mendez
76e267968d send length + data at the same time 2023-03-14 17:03:35 +01:00
Frank Morgner
38709f3ad8 vicc: fixed type error in nPA generation
fixes https://github.com/frankmorgner/vsmartcard/issues/247
2023-02-14 16:22:13 +01:00
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