Skip to content

Commit a82343b

Browse files
committed
fix: cryptography warning on int_to_bytes
1 parent 5b36ff0 commit a82343b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/cryptojwt/jws/dsa.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import sys
2+
13
from cryptography.exceptions import InvalidSignature
24
from cryptography.hazmat.primitives import hashes
35
from cryptography.hazmat.primitives.asymmetric import ec
46
from cryptography.hazmat.primitives.asymmetric.utils import decode_dss_signature
57
from cryptography.hazmat.primitives.asymmetric.utils import encode_dss_signature
6-
from cryptography.utils import int_to_bytes
78

89
from ..exception import BadSignature
910
from ..exception import Unsupported
@@ -46,7 +47,7 @@ def sign(self, msg, key):
4647
# Cryptography returns ASN.1-encoded signature data; decode as JWS
4748
# uses raw signatures (r||s)
4849
(r, s) = decode_dss_signature(asn1sig)
49-
return int_to_bytes(r, num_bytes) + int_to_bytes(s, num_bytes)
50+
return int.to_bytes(r, num_bytes, "big") + int.to_bytes(s, num_bytes, "big")
5051

5152
def verify(self, msg, sig, key):
5253
"""

0 commit comments

Comments
 (0)