openresty / openresty/encrypted-session-nginx-module

"set_decrypt_session" not working, got empty string. openresty bundle 1.15.8.1

Open
#20 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
203
Forks
50
Avg merge
1h 25m
Merged PRs (30d)
2

Description

good day,

when running demo encrypt/decrypt shown in project home, "set_decrypt_session" could not decrypt session, always got empty string.

location /encrypt {
    set $raw 'text to encrypted'; # from the ngx_rewrite module
    set_encrypt_session $session $raw;
    set_encode_base32 $session; # from the ngx_set_misc module

    add_header Set-Cookie 'my_login=$session';  # from the ngx_headers module

    # your content handler goes here...
}
location /decrypt {
    set_decode_base32 $session $cookie_my_login; # from the ngx_set_misc module
    set_decrypt_session **_$raw_** $session;

    if ($raw = '') {
        # bad session
    }

    # your content handler goes here...
}

the "$raw" is always empty string.

centos 7.4
openresty 1.15.8.1

thank you for the help.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the encrypt/decrypt configuration from the issue with OpenResty 1.15.8.1 on CentOS 7.4, then trace the set_decrypt_session implementation and its handling of the decoded cookie value. Done means the /decrypt location populates $raw with the original “text to encrypted” value instead of an empty string.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, nginx
Domain
infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.