From ea11c7f9d8fd9795e127cfd7e8a1f28d4f5472e9 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Thu, 5 Jul 2012 15:29:54 +0200 Subject: [PATCH] Allow URL-safe base64 cephx keys to be decoded. In these cases + and / are replaced by - and _ to prevent problems when using the base64 strings in URLs. Signed-off-by: Wido den Hollander Signed-off-by: Sage Weil --- src/common/armor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/armor.c b/src/common/armor.c index d1d5664953270..e4b8b86928e5e 100644 --- a/src/common/armor.c +++ b/src/common/armor.c @@ -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 */ -- 2.39.5