Skip to content

Commit 9a031df

Browse files
committed
Fix error handling gaps
1 parent 79f85f4 commit 9a031df

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

scripts/build_ffi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def get_features(local_wolfssl, features):
332332

333333
for d in include_dirs:
334334
if not os.path.exists(d):
335-
e = "Invalid wolfSSL include dir: .".format(d)
335+
e = "Invalid wolfSSL include dir: {}.".format(d)
336336
raise FileNotFoundError(e)
337337

338338
options = os.path.join(d, "wolfssl", "options.h")

wolfcrypt/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
if top_level_py not in ["setup.py", "build_ffi.py"]:
4747
from wolfcrypt._ffi import ffi as _ffi
4848
from wolfcrypt._ffi import lib as _lib
49+
from wolfcrypt.exceptions import WolfCryptError
4950

5051
if hasattr(_lib, 'WC_RNG_SEED_CB_ENABLED'):
5152
if _lib.WC_RNG_SEED_CB_ENABLED:

wolfcrypt/hkdf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def HKDF(hash_cls, in_key, salt=None, info=None, out_len=None):
3434
Perform HKDF Extract-and-Expand in one call (wraps wc_HKDF).
3535
3636
Parameters:
37-
- hash_cls: hash class, see `wolfcrypt.hashes`.
37+
- hash_cls: HMAC class, e.g. HmacSha256, see `wolfcrypt.hashes`.
3838
- in_key: input key material (IKM) as bytes or str.
3939
- salt: optional salt value (bytes or str). If None, treated as empty.
4040
- info: optional context/application info (bytes or str). If None,
@@ -79,7 +79,7 @@ def HKDF_Extract(hash_cls, salt, in_key):
7979
Wraps wc_HKDF_Extract.
8080
8181
Parameters:
82-
- hash_cls: hash class, see `wolfcrypt.hashes`.
82+
- hash_cls: HMAC class, e.g. HmacSha256, see `wolfcrypt.hashes`.
8383
- salt: bytes/str (can be None -> treated as empty).
8484
- in_key: input key material (IKM) as bytes/str.
8585
@@ -106,7 +106,7 @@ def HKDF_Expand(hash_cls, prk, info, out_len):
106106
Wraps wc_HKDF_Expand.
107107
108108
Parameters:
109-
- hash_cls: hash class, see `wolfcrypt.hashes`.
109+
- hash_cls: HMAC class, e.g. HmacSha256, see `wolfcrypt.hashes`.
110110
- prk: pseudorandom key (output from HKDF-Extract) as bytes/str.
111111
- info: optional context/application info (bytes/str). If None, treated as empty.
112112
- out_len: length of output keying material in bytes.

0 commit comments

Comments
 (0)