Skip to content
Snippets Groups Projects
Commit 700cbeb1 authored by fedor.brunner's avatar fedor.brunner
Browse files

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

signature algorithm for old pyOpenSSL.

Fixes #7641
parent 82265425
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment