]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Allow URL-safe base64 cephx keys to be decoded.
authorWido den Hollander <wido@widodh.nl>
Thu, 5 Jul 2012 13:29:54 +0000 (15:29 +0200)
committerSage Weil <sage@inktank.com>
Thu, 5 Jul 2012 14:32:28 +0000 (07:32 -0700)
In these cases + and / are replaced by - and _ to prevent problems when using
the base64 strings in URLs.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
Signed-off-by: Sage Weil <sage@inktank.com>
src/common/armor.c

index d1d566495327001b4d1b3f4461d7870d19219d39..e4b8b86928e5e7050e11d288358f7832428c441e 100644 (file)
@@ -24,9 +24,9 @@ static int decode_bits(char c)
                return c - 'a' + 26;
        if (c >= '0' && c <= '9')
                return c - '0' + 52;
-       if (c == '+')
+       if (c == '+' || c == '-')
                return 62;
-       if (c == '/')
+       if (c == '/' || c == '_')
                return 63;
        if (c == '=')
                return 0; /* just non-negative, please */