summaryrefslogtreecommitdiff
path: root/security/nss/lib/util
diff options
context:
space:
mode:
authorjpierre%netscape.com <devnull@localhost>2003-02-19 02:29:48 +0000
committerjpierre%netscape.com <devnull@localhost>2003-02-19 02:29:48 +0000
commit10ef1bcdc803eff4614617c39a0a933c31392d20 (patch)
treed48561d5574c4fa5b4e077f9636b0453c7b77120 /security/nss/lib/util
parent141af0a824fac1e781615887e0c66578f0c5cce1 (diff)
downloadnss-hg-10ef1bcdc803eff4614617c39a0a933c31392d20.tar.gz
Fix for bug 193691 . Make QuickDER return an error rather than assert if extraneous data is present in the buffer
Diffstat (limited to 'security/nss/lib/util')
-rw-r--r--security/nss/lib/util/quickder.c6
-rw-r--r--security/nss/lib/util/secerr.h4
2 files changed, 7 insertions, 3 deletions
diff --git a/security/nss/lib/util/quickder.c b/security/nss/lib/util/quickder.c
index 92d693971..1b4765812 100644
--- a/security/nss/lib/util/quickder.c
+++ b/security/nss/lib/util/quickder.c
@@ -901,7 +901,11 @@ SECStatus SEC_QuickDERDecodeItem(PRArenaPool* arena, void* dest,
else
{
PORT_ArenaUnmark(arena, savpos);
- PORT_Assert(0 == newsrc.len);
+ if (newsrc.len)
+ {
+ rv = SECFailure;
+ PORT_SetError(SEC_ERROR_BAD_DER_EXTRA_DATA);
+ }
}
}
diff --git a/security/nss/lib/util/secerr.h b/security/nss/lib/util/secerr.h
index 7e139cae1..ad7c5d8ff 100644
--- a/security/nss/lib/util/secerr.h
+++ b/security/nss/lib/util/secerr.h
@@ -184,8 +184,8 @@ SEC_ERROR_MODULE_STUCK = (SEC_ERROR_BASE + 135),
SEC_ERROR_BAD_TEMPLATE = (SEC_ERROR_BASE + 136),
SEC_ERROR_CRL_NOT_FOUND = (SEC_ERROR_BASE + 137),
SEC_ERROR_REUSED_ISSUER_AND_SERIAL = (SEC_ERROR_BASE + 138),
-SEC_ERROR_BUSY = (SEC_ERROR_BASE + 139)
-
+SEC_ERROR_BUSY = (SEC_ERROR_BASE + 139),
+SEC_ERROR_BAD_DER_EXTRA_DATA = (SEC_ERROR_BASE + 140)
} SECErrorCodes;
#endif /* NO_SECURITY_ERROR_ENUM */