From 6a63299667231ee93522951219bb8e9709a64eb6 Mon Sep 17 00:00:00 2001 From: "relyea%netscape.com" Date: Wed, 31 Dec 2003 23:19:26 +0000 Subject: [PATCH] Bug 229193 Patch by wtc revied by relyea & ian --- security/nss/lib/cryptohi/dsautil.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/security/nss/lib/cryptohi/dsautil.c b/security/nss/lib/cryptohi/dsautil.c index 39eb3191ba4e..9cd0b820ef91 100644 --- a/security/nss/lib/cryptohi/dsautil.c +++ b/security/nss/lib/cryptohi/dsautil.c @@ -34,6 +34,7 @@ * may use your version of this file under either the MPL or the * GPL. */ +#include "cryptohi.h" #include "secasn1.h" #include "secitem.h" #include "prerr.h" @@ -138,7 +139,7 @@ common_EncodeDerSig(SECItem *dest, SECItem *src) DSA_ASN1Signature sig; unsigned char *signedR; unsigned char *signedS; - int len; + unsigned int len; /* Allocate memory with room for an extra byte that * may be required if the top bit in the first byte @@ -191,7 +192,7 @@ common_EncodeDerSig(SECItem *dest, SECItem *src) ** For ECDSA, len depends on the key size used to create the signature. */ static SECItem * -common_DecodeDerSig(SECItem *item, int len) +common_DecodeDerSig(SECItem *item, unsigned int len) { SECItem * result = NULL; SECStatus status; @@ -264,7 +265,7 @@ DSAU_EncodeDerSig(SECItem *dest, SECItem *src) ** by len/2 bytes of s). dest is the signature DER encoded. */ SECStatus -DSAU_EncodeDerSigWithLen(SECItem *dest, SECItem *src, int len) +DSAU_EncodeDerSigWithLen(SECItem *dest, SECItem *src, unsigned int len) { PORT_Assert((src->len == len) && (len % 2 == 0)); @@ -293,7 +294,7 @@ DSAU_DecodeDerSig(SECItem *item) ** r followed by s (both padded to take up exactly len/2 bytes). */ SECItem * -DSAU_DecodeDerSigToLen(SECItem *item, int len) +DSAU_DecodeDerSigToLen(SECItem *item, unsigned int len) { return common_DecodeDerSig(item, len/2); }