forked from indymedia/epicyon
cryptodome fallback
parent
f6869f9308
commit
596d3a8747
16
httpsig.py
16
httpsig.py
|
@ -9,14 +9,16 @@ __status__ = "Production"
|
|||
|
||||
# see https://tools.ietf.org/html/draft-cavage-http-signatures-06
|
||||
|
||||
from Cryptodome.PublicKey import RSA
|
||||
from Cryptodome.Hash import SHA256
|
||||
from Cryptodome.Signature import pkcs1_15
|
||||
try:
|
||||
from Cryptodome.PublicKey import RSA
|
||||
from Cryptodome.Hash import SHA256
|
||||
from Cryptodome.Signature import pkcs1_15
|
||||
except ImportError:
|
||||
from Crypto.PublicKey import RSA
|
||||
from Crypto.Hash import SHA256
|
||||
#from Crypto.Signature import PKCS1_v1_5
|
||||
from Crypto.Signature import pkcs1_15
|
||||
|
||||
#from Crypto.PublicKey import RSA
|
||||
#from Crypto.Hash import SHA256
|
||||
##from Crypto.Signature import PKCS1_v1_5
|
||||
#from Crypto.Signature import pkcs1_15
|
||||
from requests.auth import AuthBase
|
||||
import base64
|
||||
import json
|
||||
|
|
|
@ -14,8 +14,10 @@ import subprocess
|
|||
import shutil
|
||||
from random import randint
|
||||
from pathlib import Path
|
||||
from Cryptodome.PublicKey import RSA
|
||||
#from Crypto.PublicKey import RSA
|
||||
try:
|
||||
from Cryptodome.PublicKey import RSA
|
||||
except ImportError:
|
||||
from Crypto.PublicKey import RSA
|
||||
from shutil import copyfile
|
||||
from webfinger import createWebfingerEndpoint
|
||||
from webfinger import storeWebfingerEndpoint
|
||||
|
|
6
tests.py
6
tests.py
|
@ -14,8 +14,10 @@ import json
|
|||
from time import gmtime, strftime
|
||||
from pprint import pprint
|
||||
from person import createPerson
|
||||
from Cryptodome.Hash import SHA256
|
||||
#from Crypto.Hash import SHA256
|
||||
try:
|
||||
from Cryptodome.Hash import SHA256
|
||||
except ImportError:
|
||||
from Crypto.Hash import SHA256
|
||||
from httpsig import signPostHeaders
|
||||
from httpsig import verifyPostHeaders
|
||||
from httpsig import messageContentDigest
|
||||
|
|
10
webfinger.py
10
webfinger.py
|
@ -7,10 +7,12 @@ __email__ = "bob@freedombone.net"
|
|||
__status__ = "Production"
|
||||
|
||||
import base64
|
||||
from Cryptodome.PublicKey import RSA
|
||||
from Cryptodome.Util import number
|
||||
#from Crypto.PublicKey import RSA
|
||||
#from Crypto.Util import number
|
||||
try:
|
||||
from Cryptodome.PublicKey import RSA
|
||||
from Cryptodome.Util import number
|
||||
except ImportError:
|
||||
from Crypto.PublicKey import RSA
|
||||
from Crypto.Util import number
|
||||
import requests
|
||||
import json
|
||||
import os
|
||||
|
|
Loading…
Reference in New Issue