Commit f2582905 authored by fedor.brunner's avatar fedor.brunner

Old pyOpenSSL is missing get_signature_algorithm. Use the default "sha256"

signature algorithm for old pyOpenSSL.

Fixes #7641
parent 0a7176e8
......@@ -220,7 +220,11 @@ class JingleContent(object):
+ '.cert'
cert = load_cert_file(certpath)
if cert:
digest_algo = cert.get_signature_algorithm().split('With')[0]
try:
digest_algo = cert.get_signature_algorithm().split('With')[0]
except AttributeError, e:
# Old py-OpenSSL is missing get_signature_algorithm
digest_algo = "sha256"
security.addChild('fingerprint').addData(cert.digest(
digest_algo))
for m in ('x509', ): # supported authentication methods
......
......@@ -192,7 +192,11 @@ def check_cert(jid, fingerprint):
if os.path.exists(certpath):
cert = load_cert_file(certpath)
if cert:
digest_algo = cert.get_signature_algorithm().split('With')[0]
try:
digest_algo = cert.get_signature_algorithm().split('With')[0]
except AttributeError, e:
# Old py-OpenSSL is missing get_signature_algorithm
digest_algo = "sha256"
if cert.digest(digest_algo) == fingerprint:
return True
return False
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment