From 7ddb5a0a21d2796105aa5516417585dc8fd51ae1 Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sat, 2 Nov 1996 15:29:48 +0000 Subject: [PATCH] Add support for parsing extended responses (draft-ietf-otp-ext-01). git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@924 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/otp/otp_parse.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/otp/otp_parse.c b/lib/otp/otp_parse.c index 6db5841c6..0df030b2c 100644 --- a/lib/otp/otp_parse.c +++ b/lib/otp/otp_parse.c @@ -2239,11 +2239,19 @@ int otp_parse (OtpKey key, char *s, OtpAlgorithm *alg) { int ret; + int dohex = 1; + + if (strncmp (s, OTP_HEXPREFIX, strlen(OTP_HEXPREFIX)) == 0) + return otp_parse_hex (key, s + strlen(OTP_HEXPREFIX)); + if (strncmp (s, OTP_WORDPREFIX, strlen(OTP_WORDPREFIX)) == 0) { + s += strlen(OTP_WORDPREFIX); + dohex = 0; + } ret = otp_parse_stddict (key, s); if (ret) ret = otp_parse_altdict (key, s, alg); - if (ret) + if (ret && dohex) ret = otp_parse_hex (key, s); return ret; }