Bug 1399867, tests: Add test for reading PKCS #12 files created with old NSS, r=rrelyea
authorDaiki Ueno <dueno@redhat.com>
Thu, 14 Sep 2017 16:12:33 +0200
changeset 13600 835f791a0918bea762acdb606fff8b50c9aadac7
parent 13599 222ed4d2deb63f5977aef6da3e37d8a24bff35b4
child 13601 3c7359ad3ce609ca7c4189c05cc05cf0fdac0db3
push id2383
push userkaie@kuix.de
push dateWed, 20 Sep 2017 10:06:29 +0000
reviewersrrelyea
bugs1399867
Bug 1399867, tests: Add test for reading PKCS #12 files created with old NSS, r=rrelyea
tests/tools/TestOldCA.p12
tests/tools/tools.sh
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..40d5671b9dbc2df8a701df091ef5dbc568c10399
GIT binary patch
literal 2588
zc$~eKcTkhr8pglxODLh&P%hOVpl-+)5)^`f2vLd%N>ijGB^U|PQE8DTprBHeq7)S=
ziYP@oSSX?kDhLFnCQB0)j0!?vVRlD%XYQYO?)m4;^E=NubLKf`-g)6@2t>fq+^FsG
zCh^||K^`zaS|u7uN43Dw{|)EEbW|=(N33)6|Ggx@2O{$6h?^TQpPTP*h(d!KEDcFV
zq-^j+m=5{pBOnlhAfdgm;Ll@0el7s^!Sll?ZiFq8TO6{r#*4$En}S!I&&Z8R@uCIz
zQQYuoSYi|MhznZKg8hQrD1J(I6wgq+7%Z~M`NUCsE%)16D;>19#!JKKO@<H`-cU+5
zo`FG1mek`)MuxD0lpuZ=tb-@wi7-J^(_vHMHGj(g<4x$`mVd?oasdcBC=6_HK8Oy2
zK+jZ`#pzg|iJs<*o%%WzEZ3VSLaa*Xyz^^Di?8eneBVkO5xRLbMU?oxTJKTCz5c#I
z95oBm!R&PrkREES!0Fz1FH_?xK7aab2g@<GFf2{3b@|yV(%reTQEO2Jy?{qYIvrDR
z8Nbs;Qcp0GmcmWHw{gqwm8jOVR7lb#%&83ezMJA-Q!%)Z$dcJQZBkxlSLy!MB}TRR
z!6J*2nXi{z5ALVY1ee#a7GbxHq*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^+R%+j*58l|x??z%hVE6jIF<Kpt#C3`DKBfp+7WHO-#5N)9
zGZ8mQ4@4&P^=&KyfY<7g6AkG(_SvpS?X_eg5QXyinm0CAbhh>;Ea~GHyC-MrG#1!h
zv7>ML;~ZwQMV|~F&rO!oZ_XOm5v%NRG(2yr*n4ZF;<?nPSbj`!F(ZXKi|*d&7C1)E
zi;{`{LU`+H(zcFCeW&>@w;fvvXRuG7{qG7h@UH>uz{(pf4c87K1SHD^ASGNI7OW+f
pR78?2toM{Up|N<{Z)Bv%V1DDdet*~Cvy9urY-uZ@&7uqde*(pUL-GIs
--- a/tests/tools/tools.sh
+++ b/tests/tools/tools.sh
@@ -97,16 +97,18 @@ tools_init()
   fi
 
   mkdir -p ${TOOLSDIR}
   mkdir -p ${COPYDIR}
   mkdir -p ${SIGNDIR}
   cp ${ALICEDIR}/* ${SIGNDIR}/
   mkdir -p ${TOOLSDIR}/html
   cp ${QADIR}/tools/sign*.html ${TOOLSDIR}/html
+  mkdir -p ${TOOLSDIR}/data
+  cp ${QADIR}/tools/TestOldCA.p12 ${TOOLSDIR}/data
 
   cd ${TOOLSDIR}
 }
 
 ########################## list_p12_file ###############################
 # List the key and cert in the specified p12 file
 ########################################################################
 list_p12_file()
@@ -412,27 +414,38 @@ tools_p12_export_list_import_with_defaul
   echo "$SCRIPTNAME: Listing Alice's pk12 EC file -----------------"
   echo "pk12util -l Alice-ec.p12 -w ${R_PWFILE}"
   ${BINDIR}/pk12util -l Alice-ec.p12 -w ${R_PWFILE} 2>&1
   ret=$?
   html_msg $ret 0 "Listing Alice's pk12 EC file (pk12util -l)"
   check_tmpfile
 }
 
+tools_p12_import_old_files()
+{
+  echo "$SCRIPTNAME: Importing CA cert & key created with NSS 3.21 --------------"
+  echo "pk12util -i TestOldCA.p12 -d ${P_R_COPYDIR} -k ${R_PWFILE} -w ${R_PWFILE}"
+  ${BINDIR}/pk12util -i ${TOOLSDIR}/data/TestOldCA.p12 -d ${P_R_COPYDIR} -k ${R_PWFILE} -w ${R_PWFILE} 2>&1
+  ret=$?
+  html_msg $ret 0 "Importing CA cert & key created with NSS 3.21"
+  check_tmpfile
+}
+
 ############################## tools_p12 ###############################
 # local shell function to test basic functionality of pk12util
 ########################################################################
 tools_p12()
 {
   tools_p12_export_list_import_with_default_ciphers
   tools_p12_export_list_import_all_pkcs5v2_ciphers
   tools_p12_export_list_import_all_pkcs5pbe_ciphers
   tools_p12_export_list_import_all_pkcs12v2pbe_ciphers
   tools_p12_export_with_none_ciphers
   tools_p12_export_with_invalid_ciphers
+  tools_p12_import_old_files
 }
 
 ############################## tools_sign ##############################
 # local shell function pk12util uses a hardcoded tmp file, if this exists
 # and is owned by another user we don't get reasonable errormessages 
 ########################################################################
 check_tmpfile()
 {