diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-10-09 09:42:26 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-10-09 09:42:26 +0200 |
| commit | 197b8c52b74322cd2289fd365e4cb65074682870 (patch) | |
| tree | f35456c3d6122746858e93be3656cd6029c02210 | |
| parent | 8d8179d3b412cdd2c1af60539b9aec89631f3fe6 (diff) | |
jwt.c: Use original base64 variant
Otherwise, cookies set by previous, OpenSSL-based versions of slcl would
be now invalidated because URL-safe base64 transforms some characters,
thus breaking backwards compatiblity.
For example, '/' is transformed into '_' on the example cookies below:
- Original base64 encoding:
a=eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJuYW1lIjogImEifQ==.jgp/SsraDR/3zlAnDLyj05VHulUNbDNHaPowvUkLto4=
- URL-safe base64 encoding:
a=eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJuYW1lIjogImEifQ==.jgp_SsraDR_3zlAnDLyj05VHulUNbDNHaPowvUkLto4=
| -rw-r--r-- | jwt.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -7,7 +7,7 @@ #include <stdio.h> #include <string.h> -#define VARIANT sodium_base64_VARIANT_URLSAFE +#define VARIANT sodium_base64_VARIANT_ORIGINAL static char *get_payload(const char *const name) { |
