Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions kmip/pie/sqltypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class EnumType(types.TypeDecorator):
"""

impl = types.Integer
cache_ok = False

def __init__(self, cls):
"""
Expand Down
13 changes: 7 additions & 6 deletions kmip/services/kmip_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,14 @@ def open(self):
six.reraise(*last_error)

def _create_socket(self, sock):
self.socket = ssl.wrap_socket(
sock,
context = ssl.SSLContext(self.ssl_version)
context.load_cert_chain(
keyfile=self.keyfile,
certfile=self.certfile,
cert_reqs=self.cert_reqs,
ssl_version=self.ssl_version,
ca_certs=self.ca_certs,
certfile=self.certfile)
context.verify_mode = self.cert_reqs
context.load_verify_locations(cafile=self.ca_certs)
self.socket = context.wrap_socket(
sock,
do_handshake_on_connect=self.do_handshake_on_connect,
suppress_ragged_eofs=self.suppress_ragged_eofs)
self.socket.settimeout(self.timeout)
Expand Down
11 changes: 6 additions & 5 deletions kmip/services/server/crypto/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

from cryptography import exceptions as errors
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.decrepit.ciphers import algorithms as new_algorithms
from cryptography.hazmat.primitives import serialization, hashes, hmac, cmac
from cryptography.hazmat.primitives import padding as symmetric_padding
from cryptography.hazmat.primitives.asymmetric import rsa
Expand Down Expand Up @@ -49,13 +50,13 @@ def __init__(self):
# The IDEA algorithm is supported by cryptography but may not be
# supported by certain backends, like OpenSSL.
self._symmetric_key_algorithms = {
enums.CryptographicAlgorithm.TRIPLE_DES: algorithms.TripleDES,
enums.CryptographicAlgorithm.TRIPLE_DES: new_algorithms.TripleDES,
enums.CryptographicAlgorithm.AES: algorithms.AES,
enums.CryptographicAlgorithm.BLOWFISH: algorithms.Blowfish,
enums.CryptographicAlgorithm.BLOWFISH: new_algorithms.Blowfish,
enums.CryptographicAlgorithm.CAMELLIA: algorithms.Camellia,
enums.CryptographicAlgorithm.CAST5: algorithms.CAST5,
enums.CryptographicAlgorithm.IDEA: algorithms.IDEA,
enums.CryptographicAlgorithm.RC4: algorithms.ARC4
enums.CryptographicAlgorithm.CAST5: new_algorithms.CAST5,
enums.CryptographicAlgorithm.IDEA: new_algorithms.IDEA,
enums.CryptographicAlgorithm.RC4: new_algorithms.ARC4
}
self._asymmetric_key_algorithms = {
enums.CryptographicAlgorithm.RSA: self._create_rsa_key_pair
Expand Down
Loading