Commit Graph

48 Commits (a59a4f8b965c8ad42c6af95c80fc3873e77cd0cc)

Author SHA1 Message Date
sebastian-carpenter a59a4f8b96 update license to GPLv3 2026-07-09 18:24:23 +02:00
Robert de Vries 397725336e Address more review comments. 2026-07-06 22:27:34 +02:00
Robert de Vries fda2869cce Add py.typed file to indicate that this library has typing annotations. 2026-07-06 22:02:48 +02:00
Robert de Vries 7edbd3e45c Enable more ruff rules requiring only minor or no fixes.
Extra rules:
All E pycodestyle error rules
C4   flake8-comprehensions
DTZ  flake8-datetimez
EXE  flake8-executable
FA   flake8-future-annotations
INT  flake8-gettext
ISC  flake8-implicit-str-concat
ICN  flake8-import-conventions
LOG  flake8-logging
G    flake8-logging-format
RSE  flake8-raise
SLOT flake8-slots
TID  flake8-tidy-imports
TC   flake8-type-checking
FLY  flynt
PERF Perflint
W    pycodestyle warnings
FURB refurb

Ignore E501:  line too long
2026-07-04 16:54:56 +02:00
sebastian-carpenter dbb21f3a99 modify version bounds for dependencies
* Remove bound for maximum version
 * Synchronize minimum version for cffi to 1.17
2026-06-24 12:07:02 -06:00
David Garske 3c911eeb29
Merge pull request #124 from roberthdevries/remove-redundant-open-modes
Remove redundant open modes.
2026-06-08 15:45:07 -07:00
Robert de Vries 92ca0e57af Remove redundant open modes.
Redundant `open` mode arguments are unnecessary and should be removed to
avoid confusion.
2026-05-18 20:30:39 +02:00
Robert de Vries 914a9b473a Remove unnecessary UTF-8 encoding declarations.
PEP 3120 makes UTF-8 the default encoding, so a UTF-8 encoding
declaration is unnecessary.
2026-05-18 20:25:36 +02:00
Robert de Vries 18701e3b62 Use format specifiers instead of percent format.
printf-style string formatting has a number of quirks, and leads to less
readable code than using str.format calls or f-strings.
In general, prefer the newer str.format and f-strings constructs over
printf-style string formatting.
2026-05-17 16:14:52 +02:00
Andrew Hutchings ef4195f99a Address Fenrir findings
F-3340: AesGcmStream.final decrypt path passed len(authTag) straight to
wc_AesGcmDecryptFinal, letting a caller truncate the verification window
(forgery probability ~2^-32 instead of 2^-128 for a 4-byte tag against a
16-byte configuration). Reject len(authTag) != self._tag_bytes and pass
self._tag_bytes to wolfSSL, mirroring ChaCha20Poly1305.decrypt. Added
test_decrypt_rejects_wrong_tag_length. Also fixed test_encrypt_short_tag
which was relying on the bug (decrypt side defaulted to tag_bytes=16
against a 12-byte tag).

F-3089: Declare label as const byte* in the wc_RsaPublicEncrypt_ex and
wc_RsaPrivateDecrypt_ex cdefs so CFFI can accept Python bytes without
exposing a writable pointer into immutable memory. wolfSSL does not
modify label.

F-3090: Declare nonce as const byte* in the wc_InitRngNonce and
wc_InitRngNonce_ex cdefs for the same reason.

F-1983, F-1984: Add minimum + upper bounds to requirements/{prod,test,
docs}.txt so a hijacked release of cffi, tox, pytest, types-cffi,
Sphinx, or sphinx_rtd_theme does not get pulled silently on the next
pip install. setup.txt resolves transitively via prod.txt.
2026-05-12 13:15:35 +01:00
Robert de Vries ddf707b9b8
Merge branch 'master' into add-pyproject-toml 2026-05-06 00:51:03 +02:00
Robert de Vries 4dbd4951ea Convert python project configuration to pyproject.toml.
Modern python projects standardize on pyproject.toml to reduce
the number of configuration files required for all tools.
2026-04-27 16:17:15 +02:00
Robert de Vries 61c7990be0 Addressed various review comments. 2026-04-20 22:37:07 +02:00
Robert de Vries 2f630a4353 Clean up import statements.
* Remove unused imports.
* Move import statements together at the top of the file.
2026-04-09 20:02:01 +02: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
Andrew Hutchings 82937f2f1b Fix other things found after PyPi push 2022-07-13 16:09:09 +02:00
Andrew Hutchings 969681a731 Fix issues causing tox not to run 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 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
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 e8e49f4cb9 Updated wolfcrypt, copyright notes. Add pwdbased on by default. 2022-01-10 21:23:12 +01:00
Chris Conlon e7601183c4 update copyright to 2020 2020-01-03 16:29:04 -08:00
Chris Conlon 606ead172a native feature detection for wolfSSL algorithms, cffi cleanup 2019-09-24 14:38:42 -06:00
Moisés Guimarães de Medeiros 9f70f72cb6 fix setup and update python versions 2018-07-23 23:14:36 +01:00
Moisés Guimarães de Medeiros 3009db3e05 fix pip install 2018-07-23 17:23:06 +01:00
Moisés Guimarães b4556ba294 updates copyright and fixes docs 2018-01-08 16:04:27 -03:00
Moisés Guimarães 69d21052f1 updates copyright year 2017-12-19 13:47:02 -03:00
Moisés Guimarães 4feb95659e implements post release in the package versioning 2017-12-18 13:25:24 -03:00
Moisés Guimarães 2421b15b1c bump version and updates setup 2017-12-12 18:13:38 -03:00
Moisés Guimarães 5283bdc4f9 moves 'lib' dir to root 2017-12-12 17:12:16 -03:00
Moisés Guimarães 71e205943f moving files to wolfcrypt-py 2017-12-11 17:27:41 -03: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 4cf4d195f7 removes -py sufix 2016-05-02 19:34:55 -03:00
Moisés Guimarães 0ea89208db updates requirements 2016-04-29 21:57:41 -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 564eb31292 fixes description 2016-04-29 17:09:48 -03:00
Moisés Guimarães 919cc67a9d fixes multiple ffi instances error 2016-04-24 20:49:07 -03:00
Moisés Guimarães 532586c503 Revert "fixes README extension"
This reverts commit 8d6c8d7b0f.
2016-04-18 20:43:17 -03:00
Moisés Guimarães 8d6c8d7b0f fixes README extension 2016-04-18 20:26:00 -03:00
Moisés Guimarães 691c59bd64 adds RNG wrappers 2016-04-14 21:32:39 -03:00
Moisés Guimarães 8c8f471486 adds Aes wrappers 2016-04-14 20:23:17 -03:00
Moisés Guimarães 1aeb5e90ec adds Des3 wrappers 2016-04-14 18:13:11 -03:00
Moisés Guimarães 949995c0cb implements Sha[1:256:384:512] wrappers; adds buiding scripts 2016-04-11 23:45:22 -03:00