back to SWE-Agent summary
SWE-Agent: tlslite-ng
Failed to run pytests for test unit_tests
Patch diff
diff --git a/tlslite/dh.py b/tlslite/dh.py
index 91100e0..37cee64 100644
--- a/tlslite/dh.py
+++ b/tlslite/dh.py
@@ -10,7 +10,7 @@ def parseBinary(data):
:param bytes data: DH parameters
:rtype: tuple of int
"""
- pass
+ asn1 = ASN1Parser(data); prime = bytesToNumber(asn1.getChild(0).value); generator = bytesToNumber(asn1.getChild(1).value); return generator, prime
def parse(data):
"""
@@ -22,4 +22,4 @@ def parse(data):
:rtype: tuple of int
:returns: generator and prime
"""
- pass
\ No newline at end of file
+ return parseBinary(dePem(data, "DH PARAMETERS") if b"-----BEGIN" in data else data)