From 27371263b78bd75878a89b7d5186b0553b229d03 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 30 Jul 2015 14:47:52 -0700 Subject: [PATCH] move variable declaration to beginning of block --- wolfcrypt/src/asn.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wolfcrypt/src/asn.c b/wolfcrypt/src/asn.c index 53562e943..0faea7dcb 100644 --- a/wolfcrypt/src/asn.c +++ b/wolfcrypt/src/asn.c @@ -4914,11 +4914,13 @@ int wc_RsaKeyToDer(RsaKey* key, byte* output, word32 inLen) sizes[i] = SetLength(rawLen, tmps[i] + 1) + 1 + lbit; /* tag & lbit */ if (sizes[i] <= MAX_SEQ_SZ) { + int err; + /* leading zero */ if (lbit) tmps[i][sizes[i]-1] = 0x00; - int err = mp_to_unsigned_bin(keyInt, tmps[i] + sizes[i]); + err = mp_to_unsigned_bin(keyInt, tmps[i] + sizes[i]); if (err == MP_OKAY) { sizes[i] += (rawLen-lbit); /* lbit included in rawLen */ intTotalLen += sizes[i];