Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tplink_jetstream to support cryptography 3.1+ #2043

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions netmiko/tplink/tplink_jetstream.py
@@ -1,7 +1,6 @@
import re
import time

from cryptography import utils as crypto_utils
from cryptography.hazmat.primitives.asymmetric import dsa

from netmiko import log
Expand Down Expand Up @@ -142,7 +141,7 @@ def _override_check_dsa_parameters(parameters):

It's still not possible to remove this hack.
"""
if crypto_utils.bit_length(parameters.q) not in [160, 256]:
if parameters.q.bit_length() not in [160, 256]:
raise ValueError("q must be exactly 160 or 256 bits long")

if not (1 < parameters.g < parameters.p):
Expand Down