From 80f86b81ede6bab0cbf0f1f3cdac6563fc5506d4 Mon Sep 17 00:00:00 2001 From: Frank Morgner Date: Wed, 10 Oct 2012 20:58:06 +0200 Subject: [PATCH] fixed wrong encoding of protected Le --- npa/src/sm.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/npa/src/sm.c b/npa/src/sm.c index 9fd9b3d..a7947c9 100644 --- a/npa/src/sm.c +++ b/npa/src/sm.c @@ -18,11 +18,6 @@ */ #include "scutil.h" #include "sm.h" -#ifdef _WIN32 -#include -#else -#include -#endif #include #include #include @@ -150,13 +145,13 @@ static int format_le(size_t le, struct sc_asn1_entry *le_entry, p[0] = le; break; case 2: - p[0] = htons(le) >> 8; - p[1] = htons(le) & 0xff; + p[0] = le >> 8; + p[1] = le & 0xff; break; case 3: p[0] = 0x00; - p[1] = htons(le) >> 8; - p[2] = htons(le) & 0xff; + p[1] = le >> 8; + p[2] = le & 0xff; break; default: return SC_ERROR_INVALID_ARGUMENTS;