comparison web/secure.py @ 191:8318d50d766d

gets current params
author Matt Johnston <matt@ucc.asn.au>
date Tue, 11 Feb 2014 22:10:32 +0800
parents 101c66da848d
children 4fa8cbf31065
comparison
equal deleted inserted replaced
189:101c66da848d 191:8318d50d766d
13 __all__ = ["get_csrf_blob", "check_csrf_blob", "setup_csrf", "get_user_hash"] 13 __all__ = ["get_csrf_blob", "check_csrf_blob", "setup_csrf", "get_user_hash"]
14 14
15 HASH=hashlib.sha1 15 HASH=hashlib.sha1
16 16
17 def get_user_hash(): 17 def get_user_hash():
18 if bottle.request.environ.get('SSL_CLIENT_VERIFY', '') != 'GENEROUS': 18 verify = bottle.request.environ.get('SSL_CLIENT_VERIFY', '')
19 if not (verify == 'GENEROUS' or verify == 'SUCCESS'):
19 return 'FAILVERIFY' 20 return 'FAILVERIFY'
20 blob = bottle.request.environ.get('SSL_CLIENT_CERT') 21 blob = bottle.request.environ.get('SSL_CLIENT_CERT')
21 if not blob: 22 if not blob:
22 return 'NOCERT' 23 return 'NOCERT'
23 24