Commit Graph

226 Commits (822e5654fd0ca8cfdddb374a9b7d1c7945ced2bb)

Author SHA1 Message Date
Reda Chouk 822e5654fd update submodule 2024-09-12 10:35:46 +02:00
Reda Chouk 86e827f2ba prepare for v5.7.2 2024-09-12 10:35:46 +02:00
Lealem Amedie b74b0687a8 Update to version 5.6.6 2024-01-23 18:38:19 +01:00
Eric Blankenhorn e65ce4288a Exclude AES CTR from block size check 2023-12-27 17:12:20 +01:00
lealem47 1c242652a7
Merge pull request #58 from danielinux/prepare-5.6.0-0
Updated ChangeLog.rst
2023-05-02 09:31:01 -06:00
Daniele Lacamera 1c85c674ca Updated ChangeLog.rst 2023-05-02 11:12:20 +02:00
lealem47 8287e7974d
Merge pull request #57 from danielinux/prepare-5.6.0-0
Update to wolfSSL 5.6.0
2023-04-19 09:50:10 -06:00
Daniele Lacamera 27e896eb8e Updated to wolfSSL 5.6.0 2023-04-19 12:55:43 +02:00
Lealem Amedie dc3a326d64 Add user settings path for scripts/user_settings_asm.sh during cmake 2023-04-19 12:52:59 +02:00
David Garske 99759a518b
Merge pull request #54 from danielinux/v5.5.4-rc
Preparing release 5.5.4
2022-12-30 09:06:39 -08:00
Daniele Lacamera a693f6988d Preparing release 5.5.4 2022-12-30 17:26:20 +01:00
Marco Oliverio f016d07a9d
Merge pull request #53 from danielinux/build_improvements
Make several improvements to the CFFI build process.
2022-11-07 11:51:50 +01:00
JacobBarthelmeh cdc56e4f5c
Merge pull request #52 from danielinux/update-v5.5.3
Update to version 5.5.3
2022-11-03 15:53:37 -06:00
Hayden Roche 352219fc87 Make several improvements to the CFFI build process.
- Move _build_ffi.py to scripts/build_ffi.py. Do as little in the global
namespace of the script as possible by putting functionality into functions,
including a new main function.
- Improve feature detection by allowing user_settings.h in addition to
options.h. This is particularly useful on Windows.
- Add the windows directory. This contains subdirectories non_fips and
fips_ready, which each have a user_settings.h. The non_fips user_settings.h is
used by the build script to build on Windows with CMake, when not using
USE_LOCAL_WOLFSSL. The fips_ready user_settings.h is an example user_settings.h
that works with our FIPS Ready code and wolfcrypt-py.
- Improve Windows support. This commit modifies the way we build wolfSSL for
wolfcrypt-py on Windows. Instead of using CMake directly, we use it with
user_settings.h. This is typically how Windows users are building wolfSSL, and
it gets around some shortcoming of wolfSSL's CMake support (e.g. not all
required features are supported). Additionally, USE_LOCAL_WOLFSSL now works
properly on Windows. When using USE_LOCAL_WOLFSSL, it should point to a wolfSSL
source code directory. This works for FIPS bundles, too. Finally, for FIPS on
Windows, we only support DLL builds. The CFFI library (.pyd extension) requires
this DLL to work. build_ffi.py detects this scenario and copies the .dll into
the wolfcrypt package directory. I've modified setup.py to distribute the
.dll with the package.
- Add some missing FIPS gates. Testing against FIPS v2 triggered some errors.
Those are fixed in this commit.
2022-11-03 14:56:04 +01:00
Daniele Lacamera 54cf6ce26f Update to version 5.5.3 2022-11-03 14:32:50 +01:00
Hayden Roche 7fe6eed87f Gate inclusion of wc_GenerateSeed in C wrapper on WC_RNG_SEED_CB_ENABLED.
This function is only needed when WC_RNG_SEED_CB_ENABLED is defined. Resolves
ZD #15035.
2022-10-24 12:28:15 +02:00
Hayden Roche 5c28f695e1 Improve the RSA PSS code.
- sign_pss and verify_pss need to digest the data before calling into their
respective wolfCrypt functions. Those wolfCrypt functions expect digests, not
plaintext.
- RsaPrivate make_key should take an optional hash_type parameter for the case
where the key will be used to create PSS signatures.
- test_rsa_pss_sign_verify appears to have been deliberately coded to have the
input plaintext length line up with the digest size, which masked the problem
where we weren't digesting the plaintext. I modified the plaintext so that this
is no longer the case.
2022-10-12 19:10:40 +02:00
Hayden Roche bf0a4c2425 Add optional hash_type parameter to RSA from_pem functions. 2022-09-30 18:01:01 +02:00
Chris Conlon 3569bb74e3
Merge pull request #47 from LinuxJedi/add-changelog 2022-07-26 09:50:18 -06:00
Andrew Hutchings 015076d2bf Add ChangeLog file 2022-07-25 16:38:34 +01:00
Andrew Hutchings cdb28a314b Bump to version 5.4.0
Also move out some things that are now in wolfSSL CMake.
2022-07-13 16:21:32 +02:00
Andrew Hutchings 9a5852b48f Remove Travis CI 2022-07-13 16:10:06 +02:00
Andrew Hutchings 6b02e7e5a8 Create python-app.yml 2022-07-13 16:10:06 +02:00
Andrew Hutchings 82937f2f1b Fix other things found after PyPi push 2022-07-13 16:09:09 +02:00
Andrew Hutchings 99486e6441 Twine rejects the readme, this fixes that 2022-07-13 16:09:09 +02:00
Andrew Hutchings a142619dd5 Port missing things from wolfSSL Python wrapper
wolfSSL's source tree had a stale version of the Python wolfCrypt
wrapper. There were a couple of bits in it that weren't here, so this
ports them accross.

Mostly notably a minor issue where `Random.__del__` can throw a race
condition exception during shutdown.
2022-07-13 16:08:25 +02:00
Andrew Hutchings 1b6d6d76a1 Update to 5.3.0 2022-05-06 13:40:50 +02:00
Andrew Hutchings b9072e60c6 Add get_aad() function 2022-05-06 13:34:57 +02:00
Andrew Hutchings fbefe7e7e5 Simplify OAEP and PSS
Makes things a little bit more like similar APIs.

* Hash type is now set in constructor.
* MGF is set automtically or manually with `set_mgf()`
* Label defaults to empty
2022-05-06 13:34:57 +02:00
Andrew Hutchings e34a0ece53 Completely refactor AES GCM
Some bad assumptions were made during the creation of our Python AES GCM
code. This is now modified to be more in-line with other libraries. This
is an API breaking change on unreleased code.

This now allows for aad data to be used, varying length of
authentication tags and fixes a bug for multipart.

1. Now unified to a single class AesGcmStream()
2. Used `encrypt()` and `decrypt()` instead of `update()` to avoid
   confusion over encryption and aad semantics
3. final tag_bytes is configurable in the constructor
4. `set_aad()` added to add the aad data
5. aad data is cleared after first `encrypt()` or `decrypt()` call due
   to quirk in the C API.
6. More tests added
2022-03-07 23:24:23 -08:00
Andrew Hutchings 969681a731 Fix issues causing tox not to run 2022-02-18 00:01:31 -08:00
Andrew Hutchings 7482e9d20f Don't use submodule if env var is set 2022-02-18 00:01:31 -08:00
Andrew Hutchings b602083429 Fix build recursion issue
Windows had an issue where it was trying to build the CFFI module after
it had already imported the CFFI module. Which caused permissions
errors during builds.

This fix does several things to make the Windows build work properly and
improve the Linux build too:

* The CFFI module is only build when needed, not as part of an sdist
  package
* Version numbering spilt out into separate file so __init__.py import
  is not required
* Merged _build_ffi.py and _build_wolfssl.py into one file
* Made CFFI only build when called as an executable (which happens
  during binary build time)
* Make tox use bdist-wheel instead of sdist
2022-02-18 00:01:31 -08:00
Hayden Roche 744a49e5a7
Merge pull request #36 from LinuxJedi/rsa-padding 2022-02-09 12:00:47 -08:00
Andrew Hutchings 013c1e6987 Gate RSA variables in ciphers.py 2022-02-09 17:51:43 +00:00
Andrew Hutchings e58d81533c Ungate constants and gate tests 2022-02-09 14:18:23 +00:00
Hayden Roche cdba0c7847
Merge pull request #38 from LinuxJedi/docs-members 2022-02-08 11:11:05 -08:00
Andrew Hutchings 3327d9ae39 Cleanup PSS constants and build
* Use constants from wolfSSL instead of copying them
* Add build gate for PSS
* Fix indentation
2022-02-08 17:56:48 +00:00
Andrew Hutchings c28704f22c Fix missing class members from docs
Inherited class members were missing from class documentation. Most
classes rely on these so this makes them visible in the docs.
2022-02-08 16:26:30 +00:00
Andrew Hutchings 501c269979 Fix AES_CTR breaking Windows builds
5.1.1 doesn't have a CMake option for this, so we do it the hard way for
  now.
2022-02-03 16:13:39 +00:00
Andrew Hutchings 863e6836a9 Add RSA OAEP and PSS padding
Functions added:
* `encrypt_oaep(self, plaintext, hash_type, mgf, label)`
* `decrypt_oaep(self, ciphertext, hash_type, mgf, label)`
* `sign_pss(self, plaintext, hash_type, mgf)`
* `verify_pss(self, plaintext, signature, hash_type, mgf)`

Constants added:
* MGF1SHA224
* MGF1SHA256
* MGF1SHA384
* MGF1SHA512
* HASH_TYPE_NONE
* HASH_TYPE_MD2
* HASH_TYPE_MD4
* HASH_TYPE_MD5
* HASH_TYPE_SHA
* HASH_TYPE_SHA224
* HASH_TYPE_SHA256
* HASH_TYPE_SHA384
* HASH_TYPE_SHA512
* HASH_TYPE_MD5_SHA
* HASH_TYPE_SHA3_224
* HASH_TYPE_SHA3_256
* HASH_TYPE_SHA3_384
* HASH_TYPE_SHA3_512
* HASH_TYPE_BLAKE2B
* HASH_TYPE_BLAKE2S
2022-02-03 15:43:04 +00:00
Hayden Roche 726c37e9e7
Merge pull request #33 from danielinux/aes-ctr 2022-02-01 15:43:12 -08:00
Andrew Hutchings 16334bf5e6 Add support for AES GCM streaming 2022-02-01 07:45:21 -08:00
Andrew Hutchings cbbe08b256 Minor fixups to tox
1. sdist based build/test works now. Better to use that.
2. switch to py3 instead of py39 to better suit older versions.
3. remove pep8 testing for now, some more work needed for that.
2022-01-31 23:42:45 -08:00
Daniele Lacamera 59a1d5c825 Removed stale comment 2022-02-01 08:37:03 +01:00
Andrew Hutchings c7125b04b1 Fix sdist and packaging
wolfcrypt was not being packaged in the sdist and the build system did
not work if the source wasn't a git checkout. Both fixed.
2022-01-31 04:34:03 -08:00
Daniele Lacamera 8a514e0f8e Added support for AES-CTR 2022-01-31 13:32:14 +01:00
Andrew Hutchings bd4432b7be Refactor build for better platform support
* Fix some path and compiler things for Windows
* Move source code to align better with Python standards
* Have setup.py build wolfSSL and FFI
* Update Python versions in tox
* Add CMake building for Windows build
* Add missing __init__.py for tox
* Make wolfSSL a git submodule
2022-01-31 00:51:45 -08:00
Daniele Lacamera 40a6da2b1b
Merge pull request #30 from haydenroche5/fipsv5
Call wolfCrypt_SetPrivateKeyReadEnable_fips at init, if necessary.
2022-01-25 01:44:19 -08:00
Hayden Roche 4c59f4fb72 Call wolfCrypt_SetPrivateKeyReadEnable_fips at init, if necessary.
This is another FIPS v5 change. This function needs to be called before we can
do private key ops with the new FIPS module.
2022-01-24 13:38:30 -08:00