提交 139cd16c 编写于 作者: D Dr. Stephen Henson

add -badsig option to corrupt CRL signatures for testing too

上级 fdb78f3d
...@@ -102,7 +102,7 @@ int MAIN(int argc, char **argv) ...@@ -102,7 +102,7 @@ int MAIN(int argc, char **argv)
unsigned long nmflag = 0; unsigned long nmflag = 0;
X509_CRL *x=NULL; X509_CRL *x=NULL;
char *CAfile = NULL, *CApath = NULL; char *CAfile = NULL, *CApath = NULL;
int ret=1,i,num,badops=0; int ret=1,i,num,badops=0,badsig=0;
BIO *out=NULL; BIO *out=NULL;
int informat,outformat; int informat,outformat;
char *infile=NULL,*outfile=NULL; char *infile=NULL,*outfile=NULL;
...@@ -208,6 +208,8 @@ int MAIN(int argc, char **argv) ...@@ -208,6 +208,8 @@ int MAIN(int argc, char **argv)
fingerprint= ++num; fingerprint= ++num;
else if (strcmp(*argv,"-crlnumber") == 0) else if (strcmp(*argv,"-crlnumber") == 0)
crlnumber= ++num; crlnumber= ++num;
else if (strcmp(*argv,"-badsig") == 0)
badsig = 1;
else if ((md_alg=EVP_get_digestbyname(*argv + 1))) else if ((md_alg=EVP_get_digestbyname(*argv + 1)))
{ {
/* ok */ /* ok */
...@@ -377,6 +379,9 @@ bad: ...@@ -377,6 +379,9 @@ bad:
goto end; goto end;
} }
if (badsig)
x->signature->data[x->signature->length - 1] ^= 0x1;
if (outformat == FORMAT_ASN1) if (outformat == FORMAT_ASN1)
i=(int)i2d_X509_CRL_bio(out,x); i=(int)i2d_X509_CRL_bio(out,x);
else if (outformat == FORMAT_PEM) else if (outformat == FORMAT_PEM)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册