MCPcopy Create free account
hub / github.com/sqlmapproject/sqlmap / cookie_decode

Function cookie_decode

thirdparty/bottle/bottle.py:3468–3479  ·  view source on GitHub ↗

Verify and decode an encoded string. Return an object or None.

(data, key, digestmod=None)

Source from the content-addressed store, hash-verified

3466
3467
3468def cookie_decode(data, key, digestmod=None):
3469 """ Verify and decode an encoded string. Return an object or None."""
3470 depr(0, 13, "cookie_decode() will be removed soon.",
3471 "Do not use this API directly.")
3472 data = tob(data)
3473 if cookie_is_encoded(data):
3474 sig, msg = data.split(tob('?'), 1)
3475 digestmod = digestmod or hashlib.sha256
3476 hashed = hmac.new(tob(key), msg, digestmod=digestmod).digest()
3477 if _lscmp(sig[1:], base64.b64encode(hashed)):
3478 return pickle.loads(base64.b64decode(msg))
3479 return None
3480
3481
3482def cookie_is_encoded(data):

Callers

nothing calls this directly

Calls 4

deprFunction · 0.85
tobFunction · 0.85
cookie_is_encodedFunction · 0.85
_lscmpFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…