From: Joe Orton Date: Mon, 30 Nov 2020 09:22:22 +0000 (+0000) Subject: * modules/metadata/mod_unique_id.c: Use base64url encoding for X-Git-Tag: 2.5.0-alpha2-ci-test-only~1119 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=85e14bcafa722014546035722ab4743f0f5db577;p=thirdparty%2Fapache%2Fhttpd.git * modules/metadata/mod_unique_id.c: Use base64url encoding for uuencoder table. PR: 57044 Submitted by: Michael Kaufmann git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1883947 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/changes-entries/pr57044.txt b/changes-entries/pr57044.txt new file mode 100644 index 00000000000..3d2d32c171b --- /dev/null +++ b/changes-entries/pr57044.txt @@ -0,0 +1,3 @@ + *) mod_unique_id: Use base64url encoding for UNIQUE_ID variable, + avoiding the use of '@'. PR 57044. + [Michael Kaufmann ] diff --git a/modules/metadata/mod_unique_id.c b/modules/metadata/mod_unique_id.c index 173cbf52d8e..4a92beaefb8 100644 --- a/modules/metadata/mod_unique_id.c +++ b/modules/metadata/mod_unique_id.c @@ -172,17 +172,14 @@ static void unique_id_child_init(apr_pool_t *p, server_rec *s) sizeof(cur_unique_id.counter)); } -/* NOTE: This is *NOT* the same encoding used by base64encode ... the last two - * characters should be + and /. But those two characters have very special - * meanings in URLs, and we want to make it easy to use identifiers in - * URLs. So we replace them with @ and -. - */ +/* Use the base64url encoding per RFC 4648, avoiding characters which + * are not safe in URLs. ### TODO: can switch to apr_encode_*. */ static const char uuencoder[64] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '@', '-', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '_', }; static const char *gen_unique_id(const request_rec *r)