Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ repos:
- id: mypy
exclude: ^setup.py|build/
additional_dependencies:
- ruamel.yaml
- types-cryptography
- ruamel.yaml
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.11.1 - TBD

* Import `ARC4` cipher from the new `decrepits` module sub-package, this removes the warning issued in newer versions of the `cryptography` library

## 0.11.0 - 2024-06-12

* Support input password string encoded with the `surrogatepass` error option
Expand Down
1 change: 0 additions & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ pytest-cov
pytest-mock
pywin32 ; sys_platform == 'win32'
ruamel.yaml
types-cryptography
10 changes: 9 additions & 1 deletion src/spnego/_ntlm_raw/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import typing

from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms
from cryptography.hazmat.primitives.ciphers import Cipher

from spnego._ntlm_raw.des import DES
from spnego._ntlm_raw.md4 import md4
Expand All @@ -31,6 +31,14 @@
TargetInfo,
)

try:
# cryptography 43.0.0 and later moved ARC4 to decrepit
from cryptography.hazmat.decrepit.ciphers import algorithms
except ImportError:
from cryptography.hazmat.primitives.ciphers import ( # type: ignore[no-redef]
algorithms,
)

# A user does not need to specify their actual plaintext password they can specify the LM and NT hash (from lmowfv1 and
# ntowfv2) in the form 'lm_hash_hex:nt_hash_hex'. This is still considered a plaintext pass as we can use it to build
# the LM and NT response but it's only usable for NTLM.
Expand Down
2 changes: 1 addition & 1 deletion src/spnego/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright: (c) 2020, Jordan Borean (@jborean93) <jborean93@gmail.com>
# MIT License (see LICENSE or https://opensource.org/licenses/MIT)

__version__ = "0.11.0"
__version__ = "0.11.1"