Skip to content

Commit c3484f3

Browse files
LinuxJedidanielinux
authored andcommitted
Update to wolfSSL 5.3.0
Also fix issue where tox wasn't grabbing wolfSSL from git.
1 parent 696b55b commit c3484f3

File tree

5 files changed

+35
-30
lines changed

5 files changed

+35
-30
lines changed

lib/wolfssl

Submodule wolfssl updated 829 files

setup.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,6 @@
5050
long_description = long_description.replace(".. include:: LICENSING.rst\n",
5151
licensing_file.read())
5252

53-
def verify_wolfssl_config():
54-
# verify wolfSSL library has been configured correctly, so that cffi
55-
# binding work correctly.
56-
57-
# open <wolfssl/options.h> header to parse for #define's
58-
# This will throw a FileNotFoundError if not able to find options.h
59-
optionsHeaderPath = wolfssl_inc_path() + "/wolfssl/options.h"
60-
optionsHeader = open(optionsHeaderPath, 'r')
61-
optionsHeaderStr = optionsHeader.read()
62-
optionsHeader.close()
63-
64-
# require HAVE_SNI (--enable-sni) in native lib
65-
if '#define HAVE_SNI' not in optionsHeaderStr:
66-
raise RuntimeError("wolfSSL needs to be compiled with --enable-sni")
67-
68-
# require OPENSSL_EXTRA (--enable-opensslextra) in native lib
69-
if '#define OPENSSL_EXTRA' not in optionsHeaderStr:
70-
raise RuntimeError("wolfSSL needs to be compiled with "
71-
"--enable-opensslextra")
72-
73-
7453
setup(
7554
name="wolfssl",
7655
version=verstr,

tox.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ envlist = py3
33

44
[testenv]
55
wheel = true
6-
setenv =
7-
PYTHONPATH = {toxinidir}:{toxinidir}/wolfssl-py
86

97
deps = -rrequirements/test.txt
108
commands = py.test tests/

wolfssl/_build_ffi.py

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import subprocess
3232
import shlex
3333
import os
34+
import sys
3435
from ctypes import cdll
3536
from collections import namedtuple
3637

@@ -249,11 +250,38 @@ def generate_libwolfssl():
249250
get_platform(), version))
250251
make(make_flags(prefix, False))
251252

252-
253+
# detect features if user has built against local wolfSSL library
254+
# if they are not, we are controlling build options above
253255
local_wolfssl = os.environ.get("USE_LOCAL_WOLFSSL")
254-
if local_wolfssl and get_libwolfssl() == 0:
255-
generate_libwolfssl()
256-
get_libwolfssl()
256+
if local_wolfssl:
257+
# Try to do native wolfSSL/wolfCrypt feature detection.
258+
# Open <wolfssl/options.h> header to parse for #define's
259+
# This will throw a FileNotFoundError if not able to find options.h
260+
optionsHeaderPath = wolfssl_inc_path() + "/wolfssl/options.h"
261+
optionsHeader = open(optionsHeaderPath, 'r')
262+
optionsHeaderStr = optionsHeader.read()
263+
optionsHeader.close()
264+
# require HAVE_SNI (--enable-sni) in native lib
265+
if '#define HAVE_SNI' not in optionsHeaderStr:
266+
raise RuntimeError("wolfSSL needs to be compiled with --enable-sni")
267+
268+
# require OPENSSL_EXTRA (--enable-opensslextra) in native lib
269+
if '#define OPENSSL_EXTRA' not in optionsHeaderStr:
270+
raise RuntimeError("wolfSSL needs to be compiled with "
271+
"--enable-opensslextra")
272+
featureDetection = 1
273+
sys.stderr.write("\nDEBUG: Found <wolfssl/options.h>, attempting native "
274+
"feature detection\n")
275+
276+
else:
277+
optionsHeaderStr = ""
278+
featureDetection = 0
279+
sys.stderr.write("\nDEBUG: Skipping native feature detection, build not "
280+
"using USE_LOCAL_WOLFSSL\n")
281+
if get_libwolfssl() == 0:
282+
generate_libwolfssl()
283+
get_libwolfssl()
284+
257285

258286
WolfFunction = namedtuple("WolfFunction", ["name", "native_sig", "ossl_sig"])
259287
# Depending on how wolfSSL was configured, the functions below may or may not be

wolfssl/_version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# When bumping the C library version, reset the POST count to 0
22

3-
__wolfssl_version__ = "v5.1.1-stable"
3+
__wolfssl_version__ = "v5.3.0-stable"
44

55
# We're using implicit post releases [PEP 440] to bump package version
66
# while maintaining the C library version intact for better reference.
77
# https://www.python.org/dev/peps/pep-0440/#implicit-post-releases
88
#
99
# MAJOR.MINOR.BUILD-POST
1010

11-
__version__ = "5.1.1-0"
11+
__version__ = "5.3.0-0"

0 commit comments

Comments
 (0)