From 6bff5e5cfbaa94d19f98edba76fe27a61c19eff5 Mon Sep 17 00:00:00 2001 From: lloyd Date: Thu, 22 Mar 2012 01:45:15 +0000 Subject: Off by one in decode_constrained_integer, broke Session DER decoding --- src/asn1/ber_dec.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/asn1/ber_dec.cpp b/src/asn1/ber_dec.cpp index 4d800d471..164226e69 100644 --- a/src/asn1/ber_dec.cpp +++ b/src/asn1/ber_dec.cpp @@ -421,7 +421,8 @@ u64bit BER_Decoder::decode_constrained_integer(ASN1_Tag type_tag, u64bit out = 0; for(size_t i = 0; i != 8; ++i) - out = (out << 8) | integer.byte_at(8-i); + out = (out << 8) | integer.byte_at(7-i); + return out; } -- cgit v1.2.3