Commit Graph

164 Commits (b79527f876385ecfc23ff47696c32eaf74ff792c)

Author SHA1 Message Date
Hayden Roche b79527f876 Make wolfcrypt-py work with FIPS ready and other improvements.
- Detect ECC timing resistance and call wc_ecc_set_rng where appropriate.
- Detect FIPS version and use that information to figure out how to map hash
enum values (see _TYPE_SHA and friends).
- Don't call wc_HmacSetKey in the _Hmac constructor if the key passed to _init
is length 0. This can happen, for example, when the _Hmac object is being
copied. The copy operation copies over the raw memory from the underlying C
object, so it's not important that we call wc_HmacSetKey in this case.
- Removed a unit test that expected importing an ECC public key from a private
key to fail. This does fail in the default wolfSSL version for wolfcrypt-py,
v4.1.0-stable, but we added the feature to be able to import public from
private with wolfSSL PR #2916. As a result, this test fails with v4.8.1-stable.
We should upgrade wolfcrypt-py's default wolfSSL version (and the wolfcrypt-py
version itself) in the near future.
- The array slicing in test_key_encoding was wrong in many places. This likely
stemmed from the author thinking slices were inclusive, but that's only true
for the first element of the slice (e.g. [0:31] is elements 0-30 inclusive, not
elements 0-31 inclusive). This was uncovered by testing with FIPS ready, which
adds -DWOLFSSL_VALIDATE_ECC_IMPORT, causing us to check ECC keys with
wc_ecc_check_key. wc_ecc_check_key kept saying, "hey, that point's not on the
curve." The array slicing problem was the culprit.
- Fixed tests that were doing HMAC with a key less than HMAC_FIPS_MIN_KEY.
2021-09-16 12:55:47 -07:00
Daniele Lacamera 8ed0316993
Merge pull request #23 from haydenroche5/fips
Modify hashes.py to use correct hash type values when FIPS is enabled.
2021-07-14 06:37:02 -07:00
Hayden Roche 5598580b1b Modify hashes.py to use correct hash type values when FIPS is enabled. 2021-07-12 15:25:40 -07:00
Daniele Lacamera 3569c39d35
Merge pull request #22 from haydenroche5/rsa_blinding
Added detection of FIPS and RSA blinding. Fixed wc_PBKDF2.
2021-07-08 22:56:57 -07:00
Hayden Roche 812d359700 Make several improvements.
- Refactor the feature detection section of _build_ffi.py to be more Pythonic.
- Add detection of FIPS and RSA blinding. Don't enable RSA blinding if FIPS is
enabled. Full-fledged FIPS checks for other features are not included; this just
helps with RSA blinding, for now. Use this to determine if wc_RsaSetRNG is
available.
- Change the various *_ENABLED variables to have extern, since they're
declared in a header and initialized in a source file.
- Add a missing include of pwdbased.h to provide the declaration of wc_PBKDF2.
2021-07-01 14:57:59 -07:00
Chris Conlon 270a7903eb
Merge pull request #20 from haydenroche5/PBKDF2
Add module pwdbased.py and expose wc_PBKDF2.
2021-02-25 15:49:14 -07:00
Hayden Roche 2d7c43714e Add module pwdbased.py and expose wc_PBKDF2. 2021-02-25 16:40:30 -06:00
Hayden Roche 4d03ebbf9c
Merge pull request #21 from cconlon/rmpython2.7
remove python 2.7 from make/osx scripts
2021-02-25 10:03:42 -06:00
Chris Conlon a3c809d585 remove python 2.7 from make/osx scripts 2021-02-24 09:50:44 -07:00
Chris Conlon 4d8e4a3dd5
Merge pull request #19 from haydenroche5/RsaPrivate
Add support for RSA private keys in PKCS #8 format.
2021-01-21 15:49:28 -07:00
Hayden Roche 46b6d6ac0b Add support for RSA private keys in PKCS #8 format. 2021-01-21 10:53:36 -06:00
Chris Conlon 78ee7f77ec
Merge pull request #16 from ejohnstown/update-build
Modernize
2020-11-05 17:15:43 -07:00
John Safranek 947bdf4bbf
Modernize
1. Update the travis script to follow their multi-OS example.
2. Set the path to Python in the osx bulid wheels script.
3. For osx, removed all versions of python except 2.7, 3.7,
   and 3.8.
2020-11-05 15:38:37 -08:00
Chris Conlon 4d6a32bc70
Merge pull request #9 from ejohnstown/build-update
Build Update
2020-11-03 16:47:04 -07:00
David Garske aecdddc833
Merge pull request #15 from wolfSSL/chacha
Fixed arguments in Chacha.set_iv(nonce, counter=0)
2020-06-18 07:34:18 -07:00
Daniele Lacamera 6954491dbd Fixed arguments in Chacha.set_iv(nonce, counter=0) 2020-06-18 10:01:28 +02:00
David Garske e993b65fe4
Merge pull request #14 from wolfSSL/chacha
Added support for ChaCha stream cipher
2020-06-10 14:42:21 -07:00
Daniele Lacamera 1852a13c7f Added support for ChaCha stream cipher 2020-06-09 16:47:17 +02:00
David Garske 7181c60f7a
Merge pull request #10 from cconlon/copyright2020
update copyright to 2020
2020-03-30 06:29:47 -07:00
David Garske 0b8eda9e27
Merge pull request #11 from wolfSSL/keccak
Added support for SHA3
2020-01-07 20:36:58 -08:00
Daniele Lacamera 19cf0db33e Removed magic numbers 2020-01-07 20:20:04 +01:00
Daniele Lacamera 0b4cbfcb4d Added support for SHA3 2020-01-07 20:02:50 +01:00
Chris Conlon e7601183c4 update copyright to 2020 2020-01-03 16:29:04 -08:00
David Garske a4d6dc6d27 Fix spelling error. 2019-12-06 07:49:58 -08:00
John Safranek 255b5bce3b Build Update
One more update to make the build_wheels scripts the same.
2019-09-27 16:25:47 -07:00
John Safranek d89a715622 Build Update
1. Use the same docker image as the wolfSSL python project.
2. Remove the absolute path to the python interpreter. They just need to
be in the path. (For example, you might install old versions in /opt and
add their subdirs to the path while the latest runs out of its location.)
3. Build the name of python, pip, and venv_ based on the version.
2019-09-27 15:44:48 -07:00
Daniele Lacamera c57c4aeba9 update to 'wolfssl-version-4.1.0-stable' 2019-09-26 19:53:24 +02:00
Daniele Lacamera 78ad3f35e5
Merge pull request #8 from cconlon/05.23.19
Native feature detection, CFFI cleanup
2019-09-26 19:52:33 +02:00
Chris Conlon 91835a29af enable SHA-384 and SHA-512 by default 2019-09-26 10:14:30 -06:00
Daniele Lacamera 9565628e6e wolfSSL version updated to v4.1.0-stable 2019-09-26 18:02:07 +02:00
Chris Conlon 827720caf3 update README with USE_LOCAL_WOLFSSL 2019-09-25 16:14:08 -06:00
Chris Conlon 31fa60489e enable ECC, Ed25519, keygen by default 2019-09-25 16:07:01 -06:00
Chris Conlon c973943f53 allow native feature detection to disable default features 2019-09-25 16:06:29 -06:00
Chris Conlon 8aeb58df62 feature detection for RSA keygen, line length cleanup 2019-09-24 15:06:50 -06:00
Chris Conlon 918b29eb7f feature detection only when user is using local wolfssl lib 2019-09-24 14:38:42 -06:00
Chris Conlon 33239f6952 close options.h header after reading 2019-09-24 14:38:42 -06:00
Chris Conlon 606ead172a native feature detection for wolfSSL algorithms, cffi cleanup 2019-09-24 14:38:42 -06:00
David Garske dd14630e27
Merge pull request #7 from danielinux/rsa_key
[RSA] New methods:
2019-09-19 06:36:24 -07:00
Daniele Lacamera 44b5002dfe [RSA] New methods:
- .make_key()
- .encode_key()
2019-09-03 18:40:42 +02:00
David Garske fda3889766
Merge pull request #5 from danielinux/ecc-sign-verify-raw
[ECC] Added ecc_sign_raw and ecc_verify_raw + test cases
2019-04-16 12:43:58 -07:00
Daniele Lacamera effb3b621a Added ecc_sign_raw and ecc_verify_raw + test cases
ECC signature can be represented in its raw element R,S
2019-04-16 20:32:47 +02:00
David Garske 5e9d6d7bec
Merge pull request #3 from danielinux/ed25519-pubkey
Ed25519Private: change to handle public keys
2019-04-15 15:24:51 -07:00
David Garske cf03308173
Merge pull request #4 from danielinux/ecc-keys-raw
Added methods for ECC key handling via raw elements
2019-04-15 15:06:52 -07:00
Daniele Lacamera 80124da3c7 Added methods for ECC key handling via raw elements
* EccPrivate.decode_key_raw()
* EccPrivate.encode_key_raw()
* EccPublic.decode_key_raw()
* EccPublic.encode_key_raw()
2019-04-05 16:17:43 +02:00
Daniele Lacamera 2e4e2db493 Ed25519Private can now handle public keys 2019-04-04 14:57:31 +02:00
Chris Conlon 504dab90e2
Merge pull request #2 from danielinux/ed25519
Ed25519 support
2019-04-03 13:05:28 -07:00
Daniele Lacamera e0a153a9ca Removed unused argument from Ed25519Private.sign() 2019-03-28 11:02:04 +01:00
Daniele Lacamera c836b8c0d3 Workaround to pip9 TLS1 certificate: manually bootstrap pip in macos
build
2019-03-28 08:14:18 +01:00
Daniele Lacamera c688ab173e Fixes to travis automated tests: update pip 2019-03-28 08:00:50 +01:00
Daniele Lacamera 720ce37390 Added 'pip' to requirements 2019-03-28 07:48:55 +01:00