Skip to content

Commit 3c928b1

Browse files
authored
Merge pull request #24 from LinuxJedi/update-wolfssl
Update wolfSSL to 5.1.1 and fix any issues
2 parents ace63e9 + f349d08 commit 3c928b1

19 files changed

+105
-77
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ dist/
1616
downloads/
1717
eggs/
1818
.eggs/
19-
lib/
2019
lib64/
2120
parts/
2221
sdist/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "lib/wolfssl"]
2+
path = lib/wolfssl
3+
url = https://github.com/wolfssl/wolfssl

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ clean-build: ## remove build artifacts
3333
rm -fr build/
3434
rm -fr dist/
3535
rm -fr .eggs/
36+
rm -fr wolfssl/_ffi*
3637
find . -name '*.egg-info' -exec rm -fr {} +
3738
find . -name '*.egg' -exec rm -f {} +
39+
-cd lib/wolfssl && make clean
3840

3941
clean-pyc: ## remove Python file artifacts
4042
find . -name '*.pyc' -exec rm -f {} +
@@ -81,7 +83,7 @@ servedocs: docs ## compile the docs watching for changes
8183

8284
dist: clean ## builds source and wheel package
8385
python setup.py sdist
84-
86+
8587
./make/osx/build_wheels.sh
8688

8789
./make/manylinux1/build_wheels.sh

README.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ library targeted at IoT, embedded, and RTOS environments primarily because of
1313
its size, speed, and feature set. It works seamlessly in desktop, enterprise,
1414
and cloud environments as well.
1515

16+
Compiling
17+
=========
18+
19+
The `setup.py` file covers most things you will need to do to build and install from source. As pre-requisites you will need to install either from your OS repository or pip. You'll also need the Python development package for your Python version:
20+
21+
* `cffi`
22+
* `tox`
23+
* `pytest`
24+
25+
To build a source package run `python setup.py sdist`, to build a wheel package run `python setup.py bdist_wheel`. To test the build run `tox`. The `tox` tests rely on Python 3.9 being installed, if you do not have this version we recommend using `pyenv` to install it.
1626

1727
Installation
1828
============
@@ -35,7 +45,7 @@ The default pip install clones wolfSSL from GitHub. To build wolfssl-py using a
3545
local installation of the native wolfSSL C library, the USE_LOCAL_WOLFSSL
3646
environment variable should be set. USE_LOCAL_WOLFSSL can be set to "1" to use
3747
the default library installation location (/usr/local/lib, /usr/local/include),
38-
or to use a custom location it can be set to the install locaiton of your native
48+
or to use a custom location it can be set to the install location of your native
3949
wolfSSL library. For example:
4050

4151
.. code-block:: bash

certs/ca-digicert-ev.pem

Lines changed: 0 additions & 23 deletions
This file was deleted.

certs/ca-globalsign-r3.pem

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
3+
A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
4+
Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
5+
MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG
6+
A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
7+
hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8
8+
RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT
9+
gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm
10+
KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd
11+
QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ
12+
XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw
13+
DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o
14+
LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU
15+
RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp
16+
jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK
17+
6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX
18+
mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
19+
Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
20+
WD9f
21+
-----END CERTIFICATE-----

docs/usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Note 1:
1616
time and resources.
1717

1818
Note 2:
19-
Each path provides its own options for fine-tuning the securint parameters.
19+
Each path provides its own options for fine-tuning the security parameters.
2020
Check them out in the API documentation.
2121

2222

lib/wolfssl

Submodule wolfssl added at c3513bf

setup.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@
2727
from setuptools.command.build_ext import build_ext
2828

2929

30-
# Adding src folder to the include path in order to import from wolfssl
31-
package_dir = os.path.join(os.path.dirname(__file__), "src")
32-
sys.path.insert(0, package_dir)
33-
3430
import wolfssl
3531
from wolfssl._build_wolfssl import build_wolfssl
3632
from wolfssl._build_wolfssl import wolfssl_inc_path, wolfssl_lib_path
@@ -90,10 +86,9 @@ def build_extension(self, ext):
9086
license=wolfssl.__license__,
9187

9288
packages=["wolfssl"],
93-
package_dir={"":package_dir},
9489

9590
zip_safe=False,
96-
cffi_modules=["./src/wolfssl/_build_ffi.py:ffi"],
91+
cffi_modules=["./wolfssl/_build_ffi.py:ffi"],
9792

9893
keywords="wolfssl, wolfcrypt, security, cryptography",
9994
classifiers=[

tests/test_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@
2727

2828
HOST = "www.python.org"
2929
PORT = 443
30-
CA_CERTS = "certs/ca-digicert-ev.pem"
30+
CA_CERTS = "certs/ca-globalsign-r3.pem"
3131

3232

3333
@pytest.fixture(
3434
params=["wrap_socket", "wrap_socket_with_ca",
3535
"wrap_socket_from_context", "ssl_socket"])
36+
3637
def secure_socket(request, ssl_provider, tcp_socket):
3738
sock = None
3839

@@ -64,7 +65,6 @@ def secure_socket(request, ssl_provider, tcp_socket):
6465
yield sock
6566
sock.close()
6667

67-
6868
def test_secure_connection(secure_socket):
6969
secure_socket.connect((HOST, PORT))
7070

0 commit comments

Comments
 (0)