summaryrefslogtreecommitdiff
path: root/src/sp_cookie_encryption.c
diff options
context:
space:
mode:
authorkkadosh2018-05-29 19:34:16 +0000
committerjvoisin2018-05-29 19:34:16 +0000
commit7832438b7abedf567ce6376f99949f419abcdff1 (patch)
tree560e43918d1dc36ce4cf760a5b27aed0c563bc1c /src/sp_cookie_encryption.c
parent9eebe8c67e03e3041d454ea28e93996f7a67740b (diff)
Support session encryption
Implement session encryption.
Diffstat (limited to 'src/sp_cookie_encryption.c')
-rw-r--r--src/sp_cookie_encryption.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/sp_cookie_encryption.c b/src/sp_cookie_encryption.c
index 9030112..72223ad 100644
--- a/src/sp_cookie_encryption.c
+++ b/src/sp_cookie_encryption.c
@@ -21,7 +21,6 @@ static inline const sp_cookie *sp_lookup_cookie_config(const char *key) {
21int decrypt_cookie(zval *pDest, int num_args, va_list args, 21int decrypt_cookie(zval *pDest, int num_args, va_list args,
22 zend_hash_key *hash_key) { 22 zend_hash_key *hash_key) {
23 const sp_cookie *cookie = sp_lookup_cookie_config(ZSTR_VAL(hash_key->key)); 23 const sp_cookie *cookie = sp_lookup_cookie_config(ZSTR_VAL(hash_key->key));
24 int ret = 0;
25 24
26 /* If the cookie isn't in the conf, it shouldn't be encrypted. */ 25 /* If the cookie isn't in the conf, it shouldn't be encrypted. */
27 if (!cookie || !cookie->encrypt) { 26 if (!cookie || !cookie->encrypt) {
@@ -36,11 +35,6 @@ int decrypt_cookie(zval *pDest, int num_args, va_list args,
36 return decrypt_zval(pDest, cookie->simulation, hash_key); 35 return decrypt_zval(pDest, cookie->simulation, hash_key);
37} 36}
38 37
39/*
40** This function will return the `data` of length `data_len` encrypted in the
41** form `base64(nonce | encrypted_data)` (with `|` being the concatenation
42** operation).
43*/
44static zend_string *encrypt_data(char *data, unsigned long long data_len) { 38static zend_string *encrypt_data(char *data, unsigned long long data_len) {
45 zend_string *z = encrypt_zval(data, data_len); 39 zend_string *z = encrypt_zval(data, data_len);
46 sp_log_debug("cookie_encryption", "Cookie value:%s:", z->val); 40 sp_log_debug("cookie_encryption", "Cookie value:%s:", z->val);