Allow multiple CERTHASH values in a module
Also fix typos and usage of reserved hash() function.
This commit is contained in:
parent
da655d84d1
commit
3eba9a809b
2 changed files with 6 additions and 4 deletions
|
|
@ -37,7 +37,7 @@ __all__ = ['BNPorc']
|
||||||
class BNPorc(BaseBrowser):
|
class BNPorc(BaseBrowser):
|
||||||
DOMAIN = 'www.secure.bnpparibas.net'
|
DOMAIN = 'www.secure.bnpparibas.net'
|
||||||
PROTOCOL = 'https'
|
PROTOCOL = 'https'
|
||||||
CERTHASH = 'f7dae8d9e0f2c63a1c35d8cf1a86fdd5441a897340538b045ba8197f40c28cad'
|
CERTHASH = ['f7dae8d9e0f2c63a1c35d8cf1a86fdd5441a897340538b045ba8197f40c28cad', '5511f0ff19c982b6351c17b901bfa7419f075edb13f2df41e446248beb7866bb']
|
||||||
ENCODING = None # refer to the HTML encoding
|
ENCODING = None # refer to the HTML encoding
|
||||||
PAGES = {'.*pageId=unedescomptes.*': AccountsList,
|
PAGES = {'.*pageId=unedescomptes.*': AccountsList,
|
||||||
'.*pageId=releveoperations.*': AccountHistory,
|
'.*pageId=releveoperations.*': AccountHistory,
|
||||||
|
|
|
||||||
|
|
@ -403,12 +403,14 @@ class StandardBrowser(mechanize.Browser):
|
||||||
except ControlNotFoundError:
|
except ControlNotFoundError:
|
||||||
return
|
return
|
||||||
|
|
||||||
def lowsslcheck(self, domain, hash):
|
def lowsslcheck(self, domain, hsh):
|
||||||
certs = ssl.get_server_certificate((domain, 443))
|
certs = ssl.get_server_certificate((domain, 443))
|
||||||
certhash = hashlib.sha256(certs).hexdigest()
|
certhash = hashlib.sha256(certs).hexdigest()
|
||||||
if self.logger:
|
if self.logger:
|
||||||
self.logger.debug('Found %s as certificat hash' % certhash)
|
self.logger.debug('Found %s as certificate hash' % certhash)
|
||||||
if certhash != hash:
|
if isinstance(hsh, basestring):
|
||||||
|
hsh = [hsh]
|
||||||
|
if certhash not in hsh:
|
||||||
raise ssl.SSLError()
|
raise ssl.SSLError()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue