cryptography is in requirements.txt; we dont need to check for it

This commit is contained in:
jesopo 2020-02-20 15:12:00 +00:00
parent b260c80c31
commit 8a6270fc97
2 changed files with 6 additions and 14 deletions

View file

@ -27,9 +27,6 @@ class Module(ModuleManager.BaseModule):
raise ValueError("`tls-key` not provided in bot config")
if not "tls-certificate" in self.bot.config:
raise ValueError("`tls-certificate` not provided in bot config")
if not ap_security.has_crypto:
raise ValueError("cyprography library is not installed "
"(https://pypi.org/project/cryptography/)")
server_username, instance = ap_utils.split_username(server_username)
self.server = ap_server.Server(self.bot, self.exports,

View file

@ -1,6 +1,5 @@
import base64, typing
try:
from cryptography import x509
from cryptography.hazmat.primitives import hashes, serialization
from cryptography.hazmat.primitives.asymmetric import padding, rsa
@ -9,10 +8,6 @@ try:
from cryptography.hazmat.primitives.serialization import Encoding
from cryptography.hazmat.primitives.serialization import PublicFormat
has_crypto = True
except ModuleNotFoundError:
has_crypto = False
SIGNATURE_FORMAT = (
"keyId=\"%s\",headers=\"%s\",signature=\"%s\",algorithm=\"rsa-sha256\"")