mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Create SafeComparisonOfSensitiveInfo.py
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
"""
|
||||
@Desc :preventing timing attack sensitive info
|
||||
"""
|
||||
import hmac
|
||||
from flask import Flask
|
||||
from flask import request
|
||||
|
||||
@app.route('/good')
|
||||
def check_credentials(password):
|
||||
return hmac.compare_digest(password, "token")
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.debug = True
|
||||
app.run()
|
||||
Reference in New Issue
Block a user