openresty / encrypted-session-nginx-module

encrypt and decrypt nginx variable values
http://openresty.org
195 stars 52 forks source link

Add support for changing IV and reading key / IV from nginx variables. #24

Open rcosnita opened 4 years ago

rcosnita commented 4 years ago

This PR closes two outstanding issues:

2, #22 and #25 .

With these two issues resolved it is trivial to implement rotating IVs if necessary.

artembokhan commented 4 years ago

Hello! Could you please also add configurable with var encrypted_session_expires?

rcosnita commented 4 years ago

@artembokhan Of course. I will do this in the next two days and I'll push another commit.

rcosnita commented 3 years ago

@artembokhan Sorry for this delay. I've just managed to commit the fix for making session_expires configurable using nginx variables. Can you please review the latest change?

artembokhan commented 3 years ago

@artembokhan Sorry for this delay. I've just managed to commit the fix for making session_expires configurable using nginx variables. Can you please review the latest change?

Great thank. It seems to be working for me.

Unfortunately I'm just a project user so can't help with the PR review :(

rcosnita commented 3 years ago

@artembokhan thank you. I'm glad it works for you. I am also using the codebase in some other projects and it works without memory leaks or segfaults :).

kim0 commented 1 year ago

Any hope to get this merged soon?

rcosnita commented 1 year ago

@kim0 Not sure honestly. It has been lingering here for over 2 years now so I lost any hope.

zhuizhuhaomeng commented 1 year ago

This PR is in conflicted state.

zhuizhuhaomeng commented 1 year ago

There are more serious problem exist in the PR.

==88657== 
==88657== Process terminating with default action of signal 11 (SIGSEGV)
==88657==  Bad permissions for mapped region at address 0x5184C4
==88657==    at 0x4201F5: ngx_hash_strlow (ngx_hash.c:672)
==88657==    by 0x4F358D: ngx_http_get_variable_by_name (ngx_http_encrypted_session_module.c:192)
==88657==    by 0x4F3C62: ngx_http_set_encode_encrypted_session (ngx_http_encrypted_session_module.c:377)
==88657==    by 0x4AA6AD: ndk_set_var_value_code (ndk_set_var.c:148)
==88657==    by 0x4935B7: ngx_http_rewrite_handler (ngx_http_rewrite_module.c:180)
==88657==    by 0x45BFF4: ngx_http_core_rewrite_phase (ngx_http_core_module.c:939)
==88657==    by 0x457781: ngx_http_core_run_phases (ngx_http_core_module.c:885)
==88657==    by 0x457821: ngx_http_handler (ngx_http_core_module.c:868)
==88657==    by 0x463316: ngx_http_process_request (ngx_http_request.c:2120)
==88657==    by 0x46394D: ngx_http_process_request_headers (ngx_http_request.c:1498)
==88657==    by 0x463D17: ngx_http_process_request_line (ngx_http_request.c:1165)
==88657==    by 0x463EC6: ngx_http_wait_request_handler (ngx_http_request.c:503)
==88657==    by 0x448CB3: ngx_epoll_process_events (ngx_epoll_module.c:901)
==88657==    by 0x43DB74: ngx_process_events_and_timers (ngx_event.c:257)
==88657==    by 0x447D18: ngx_single_process_cycle (ngx_process_cycle.c:323)
==88657==    by 0x41D5C5: main (nginx.c:383)