mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
Report correct error code when input cert file contains extra stuff.
bug 289819. r=julien.pierre
This commit is contained in:
parent
f454364692
commit
0187d36e9b
@ -42,6 +42,7 @@
|
||||
#include "secder.h"
|
||||
#include "secasn1.h"
|
||||
#include "secoid.h"
|
||||
#include "secerr.h"
|
||||
|
||||
SEC_ASN1_MKSUB(SEC_AnyTemplate)
|
||||
|
||||
@ -348,6 +349,10 @@ CERT_DecodeCertPackage(char *certbuf,
|
||||
/* check entire length if definite length */
|
||||
if ( seqLen || seqLenLen ) {
|
||||
if ( certlen != ( seqLen + seqLenLen + 2 ) ) {
|
||||
if (certlen > ( seqLen + seqLenLen + 2 ))
|
||||
PORT_SetError(SEC_ERROR_EXTRA_INPUT);
|
||||
else
|
||||
PORT_SetError(SEC_ERROR_INPUT_LEN);
|
||||
goto notder;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user