cryptography
is in requirements.txt; we dont need to check for it
This commit is contained in:
parent
b260c80c31
commit
8a6270fc97
2 changed files with 6 additions and 14 deletions
|
@ -27,9 +27,6 @@ class Module(ModuleManager.BaseModule):
|
||||||
raise ValueError("`tls-key` not provided in bot config")
|
raise ValueError("`tls-key` not provided in bot config")
|
||||||
if not "tls-certificate" in self.bot.config:
|
if not "tls-certificate" in self.bot.config:
|
||||||
raise ValueError("`tls-certificate` not provided in 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)
|
server_username, instance = ap_utils.split_username(server_username)
|
||||||
self.server = ap_server.Server(self.bot, self.exports,
|
self.server = ap_server.Server(self.bot, self.exports,
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import base64, typing
|
import base64, typing
|
||||||
|
|
||||||
try:
|
|
||||||
from cryptography import x509
|
from cryptography import x509
|
||||||
from cryptography.hazmat.primitives import hashes, serialization
|
from cryptography.hazmat.primitives import hashes, serialization
|
||||||
from cryptography.hazmat.primitives.asymmetric import padding, rsa
|
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 Encoding
|
||||||
from cryptography.hazmat.primitives.serialization import PublicFormat
|
from cryptography.hazmat.primitives.serialization import PublicFormat
|
||||||
|
|
||||||
has_crypto = True
|
|
||||||
except ModuleNotFoundError:
|
|
||||||
has_crypto = False
|
|
||||||
|
|
||||||
SIGNATURE_FORMAT = (
|
SIGNATURE_FORMAT = (
|
||||||
"keyId=\"%s\",headers=\"%s\",signature=\"%s\",algorithm=\"rsa-sha256\"")
|
"keyId=\"%s\",headers=\"%s\",signature=\"%s\",algorithm=\"rsa-sha256\"")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue