Commit Graph

56 Commits (822e5654fd0ca8cfdddb374a9b7d1c7945ced2bb)

Author SHA1 Message Date
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
Daniele Lacamera 27e896eb8e Updated to wolfSSL 5.6.0 2023-04-19 12:55:43 +02: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
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
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 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 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
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
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 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 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
Moisés Guimarães bf298548ab move files to wolfssl/wrappers/python 2016-05-15 15:23:21 -03:00
Moisés Guimarães 3c6aaff373 updates readme 2016-05-09 18:51:30 -03:00
Moisés Guimarães 6574ee4a5f fixes requirements install 2016-05-05 12:42:30 -03:00
Moisés Guimarães b12d287e16 fixes about 2016-05-05 11:41:17 -03:00
Moisés Guimarães f84d395d69 finished docs for v0.1.0 rc1 2016-05-03 00:01:18 -03:00
Moisés Guimarães 6f202cdfe3 updates docs with hashes and random 2016-05-02 22:37:10 -03:00
Moisés Guimarães 4cf4d195f7 removes -py sufix 2016-05-02 19:34:55 -03:00
Moisés Guimarães 8014a9e211 minor fixes on __about__.py 2016-05-02 16:21:08 -03:00
Moisés Guimarães b50afa900c adds ciphers docstrings 2016-05-01 12:11:58 -03:00
Moisés Guimarães 0f3b36d55c updates docs. 2016-05-01 11:37:04 -03:00
Moisés Guimarães 9af1f0d034 adds random and hashes docstrings. 2016-05-01 11:17:37 -03:00
Moisés Guimarães 2287ebad58 renames utils functions 2016-05-01 10:14:56 -03:00
Moisés Guimarães 7297310498 fixes random tests 2016-05-01 09:15:44 -03:00
Moisés Guimarães 7cab8863d6 adds error handling with Exceptions. 2016-05-01 09:13:57 -03:00
Moisés Guimarães 647f65c0cc fixes python3 issues 2016-04-30 23:14:51 -03:00
Moisés Guimarães 765a8f8aff removes constructor restrictions in hashes and ciphers 2016-04-29 17:50:36 -03:00
Moisés Guimarães 525b29bb01 adds RSA cipher 2016-04-24 22:02:14 -03:00
Moisés Guimarães 919cc67a9d fixes multiple ffi instances error 2016-04-24 20:49:07 -03:00
Moisés Guimarães 7e5efb125f adds tests; simplifies hashes and fixes ciphers to retain state. 2016-04-18 20:20:50 -03:00
Moisés Guimarães 6a78b4f41d fixes import * making some variables 'private' 2016-04-16 19:32:39 -03:00
Moisés Guimarães 691c59bd64 adds RNG wrappers 2016-04-14 21:32:39 -03:00