From 75787fd833a11798e09b027991aabc5b7dafa335 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Fri, 2 Aug 2013 15:51:46 +0100 Subject: [PATCH] Add X9.42 DH certificate to S/MIME test --- test/smime-certs/mksmime-certs.sh | 15 +++++++++++++- test/smime-certs/smdh.pem | 33 +++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 test/smime-certs/smdh.pem diff --git a/test/smime-certs/mksmime-certs.sh b/test/smime-certs/mksmime-certs.sh index 37c5633dc0..f01f66427c 100644 --- a/test/smime-certs/mksmime-certs.sh +++ b/test/smime-certs/mksmime-certs.sh @@ -57,5 +57,18 @@ CN="Test S/MIME EE EC #2" $OPENSSL req -config ca.cnf -nodes \ -keyout smec2.pem -out req.pem -newkey ec:ecp2.pem $OPENSSL x509 -req -in req.pem -CA smroot.pem -days 3600 \ -extfile ca.cnf -extensions usr_cert -CAcreateserial >>smec2.pem +# Create X9.42 DH parameters. +$OPENSSL genpkey -genparam -algorithm DH -pkeyopt dh_paramgen_type:2 \ + -out dhp.pem +# Generate X9.42 DH key. +$OPENSSL genpkey -paramfile dhp.pem -out smdh.pem +$OPENSSL pkey -pubout -in smdh.pem -out dhpub.pem +# Generate dummy request. +CN="Test S/MIME EE DH #1" $OPENSSL req -config ca.cnf -nodes \ + -keyout smtmp.pem -out req.pem -newkey rsa:2048 +# Sign request but force public key to DH +$OPENSSL x509 -req -in req.pem -CA smroot.pem -days 3600 \ + -force_pubkey dhpub.pem \ + -extfile ca.cnf -extensions usr_cert -CAcreateserial >>smdh.pem # Remove temp files. -rm -f req.pem ecp.pem ecp2.pem dsap.pem smroot.srl +rm -f req.pem ecp.pem ecp2.pem dsap.pem dhp.pem dhpub.pem smtmp.pem smroot.srl diff --git a/test/smime-certs/smdh.pem b/test/smime-certs/smdh.pem new file mode 100644 index 0000000000..f831b0713b --- /dev/null +++ b/test/smime-certs/smdh.pem @@ -0,0 +1,33 @@ +-----BEGIN PRI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