Skip to content

Commit

Permalink
Bump everything to sha256
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
  • Loading branch information
stgraber committed Jul 16, 2014
1 parent 61f4f2c commit b777ea0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/lxccmd/lxccmd/certs.py
Expand Up @@ -82,7 +82,7 @@ def get_fingerprint(cert_type):
return False

with open(os.path.join(cert_path, "%s.crt" % cert_type), "r") as fd:
return hashlib.sha1(ssl.PEM_cert_to_DER_cert(fd.read())).hexdigest()
return hashlib.sha256(ssl.PEM_cert_to_DER_cert(fd.read())).hexdigest()


def trust_cert_add(x509_cert, trust_store):
Expand All @@ -91,7 +91,7 @@ def trust_cert_add(x509_cert, trust_store):
"""

try:
fingerprint = hashlib.sha1(
fingerprint = hashlib.sha256(
ssl.PEM_cert_to_DER_cert(x509_cert)).hexdigest()
except:
logging.error("Invalid x509 certificate.")
Expand Down Expand Up @@ -129,7 +129,7 @@ def trust_cert_remove(x509_cert, trust_store):
"""

try:
fingerprint = hashlib.sha1(
fingerprint = hashlib.sha256(
ssl.PEM_cert_to_DER_cert(x509_cert)).hexdigest()
except:
fingerprint = x509_cert
Expand All @@ -155,7 +155,7 @@ def trust_cert_verify(x509_cert, trust_store):
"""

try:
fingerprint = hashlib.sha1(
fingerprint = hashlib.sha256(
ssl.PEM_cert_to_DER_cert(x509_cert)).hexdigest()
except:
fingerprint = x509_cert
Expand Down
2 changes: 1 addition & 1 deletion src/lxccmd/lxccmd/network/__init__.py
Expand Up @@ -58,7 +58,7 @@ def remote_get_fingerprint(host, port):
"""

try:
return hashlib.sha1(
return hashlib.sha256(
ssl.PEM_cert_to_DER_cert(
ssl.get_server_certificate(
(host, port)))).hexdigest()
Expand Down

0 comments on commit b777ea0

Please sign in to comment.