Skip to contentSkip to conversation

Allow URL-safe base64 cephx keys to be decoded.

PATCH New Wido den Hollander 1 participant 1 message Jul 5, 2012 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 Allow URL-safe base64 cephx keys to be decoded.

In reply to a message not in the archive

In these cases + and / are replaced by - and _ to prevent problems when using the base64 strings in URLs.

---
 src/common/armor.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/common/armor.c +2 -2
index d1d5664..e4b8b86 100644
@@ -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 */
Signature · 1 line
1.7.9.5