Backed out changeset 58abe7a403aa (bug 1577353) for failures on Windows. a=backout DONTBUILD

This commit is contained in:
Jorg K 2019-09-24 11:08:45 +02:00
Родитель 0073bc839c
Коммит 26afcebfc7
11 изменённых файлов: 6 добавлений и 300 удалений

Просмотреть файл

@ -40,7 +40,6 @@ TEST_HARNESS_FILES.mozmill.resources += mailnews_files([
'test/resources/messageGenerator.js',
'test/resources/messageInjection.js',
'test/resources/messageModifier.js',
'test/resources/smimeUtils.jsm',
])
DIRS += [

Просмотреть файл

@ -26,7 +26,6 @@ pref-window
quick-filter-bar
search-window
session-store
smime
startup-firstrun
subscribe
tabmail

Просмотреть файл

@ -221,7 +221,6 @@ function setupModule() {
load_via_src_path("resources/messageModifier.js", testHelperModule);
load_via_src_path("resources/messageInjection.js", testHelperModule);
load_via_src_path("resources/viewWrapperTestUtils.js", testHelperModule);
load_via_src_path("resources/smimeUtils.jsm", testHelperModule);
// provide super helpful folder event info (when logHelper cares)
load_via_src_path("resources/folderEventLogHelper.js", testHelperModule);
@ -273,18 +272,6 @@ function setupModule() {
} catch (ex) {}
}
function smimeUtils_ensureNSS() {
testHelperModule.SmimeUtils.ensureNSS();
}
function smimeUtils_loadPEMCertificate(file, certType, loadKey = false) {
testHelperModule.SmimeUtils.loadPEMCertificate(file, certType, loadKey);
}
function smimeUtils_loadCertificateAndKey(file) {
testHelperModule.SmimeUtils.loadCertificateAndKey(file);
}
/**
* Install this module into the provided module.
*/

Двоичные данные
mail/test/mozmill/smime/Bob.p12

Двоичный файл не отображается.

Просмотреть файл

@ -1,5 +0,0 @@
S/MIME Mozmill test certificates and messages
=============================================
The test data in this directory can be refreshed by executing script
local-gen.sh found in comm/mailnews/test/data/smime

Просмотреть файл

@ -1,21 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIDdTCCAl2gAwIBAgIBATANBgkqhkiG9w0BAQsFADBkMQswCQYDVQQGEwJVUzET
MBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4g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w==
-----END CERTIFICATE-----

Просмотреть файл

@ -1,41 +0,0 @@
MIME-Version: 1.0
From: Alice <alice@example.com>
To: Bob <bob@example.com>
Subject: a message
Content-Type: multipart/alternative; boundary="--------BOUNDARY"
----------BOUNDARY
Content-Type: application/pkcs7-mime; smime-type=enveloped-data
Content-Transfer-Encoding: base64
MIAGCSqGSIb3DQEHA6CAMIACAQAxggGFMIIBgQIBADBpMGQxCzAJBgNVBAYTAlVT
MRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRIw
EAYDVQQKEwlCT0dVUyBOU1MxFDASBgNVBAMTC05TUyBUZXN0IENBAgEoMA0GCSqG
SIb3DQEBAQUABIIBAJUcHjxrchh05IJiFogCoKOAWpwuUGnnpyxbu6sA489VJeWB
TIgC5AtmScBpFCRb+OFnFnqYZzRy8gjx5WOXPS/XUw6AK1z3mSJ0ZakMgUv4fYBH
ZMHcQp4wh9hbQBjzfIXSdy7M04/H8UlRgNle/QcldKPB6sk367ht+aDadTPahEhi
/q7AC8mxaUINRmSIiPAA3PeE4HdLnoebdAyjXJQocLkshuMPPe9xJc0ZrhxStOSZ
hntgLH63BevYBlHhnoqzlDy1NW5xt8ckJPqKa9LkmRwUe779ezP7era0t1hpx0Vx
6AVjN71aoNCuADPb8A7kvI200rZZ1jARButd/ukwgAYJKoZIhvcNAQcBMB0GCWCG
SAFlAwQBAgQQZo12DT01yTXtxZ2/+fjc1aCABIGQruHZ53yEsf5U2co6ksduFP/j
Db28zsZ6fAe+QR7/Z8mM9EMWZ/c7FnnEj/7sG5MQO6WwmzZPuB9KwX2uUvE2oMyo
ZvRCK5IRjxm2CQPxnwJfiITyFh7szjeS71HBKSI+mIY5FJTvCnlztc2q3d2vsKqk
Ow3PLNpw8QtMTsDnO8R0XUh99bMkbdmHAtaQZ7hDBBBmo9Fim4/xlH4rP/wvybWg
AAAAAAAAAAAAAA==
----------BOUNDARY
Content-Type: application/pkcs7-mime; smime-type=enveloped-data
Content-Transfer-Encoding: base64
MIAGCSqGSIb3DQEHA6CAMIACAQAxggGFMIIBgQIBADBpMGQxCzAJBgNVBAYTAlVT
MRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRIw
EAYDVQQKEwlCT0dVUyBOU1MxFDASBgNVBAMTC05TUyBUZXN0IENBAgEoMA0GCSqG
SIb3DQEBAQUABIIBAD7d8RoWBfVyg7ETewBx6l1c3VK7mqIhKRcNx0UuwPwOfgxo
8TrC8cEM15rHpB5TNexekmOfxhXOJ0d72JMIAbWc4Hjv6OtHm9tjt5YLDmNWb/W4
07PdifAaOFEI8t3qersm2HCmyalPQVxURr4fJK5MXscK6fO3c8HR2VmdjNb+6UoY
sVpQ3/xoD/pW3/FbvHB6x4zdnBFujHodgfomplEsWeBoK61qI3NUY2m8CgelzRAW
YxbkZzkHhcaG4BrqisowK/BCSz7r2uBRMsH3PEegV7LGt2gvLxpZb42VyriDXV2k
0tnU5oawZ3ks5M1p488tUeGWuRh/HfAYdoQJ0hEwgAYJKoZIhvcNAQcBMB0GCWCG
SAFlAwQBAgQQSetjLFcVadme5s5iIksNT6CABEBis4nUbp0jvtFhfHfZ6j4wbp3R
3zbZZyPFdsUktzkF88LEwAGTouYBu7Arcz/eTWOKomWk7s35VBDmCGNNMYAVBBCx
dJCvX4o6dZ2krYZx7OAjAAAAAAAAAAAAAA==
----------BOUNDARY

Просмотреть файл

@ -1,86 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/**
* Test that a reply to a multipart/alternative message with two
* encrypted parts doesn't leak the secret plaintext from the second
* part.
*/
"use strict";
/* import-globals-from ../shared-modules/test-compose-helpers.js */
/* import-globals-from ../shared-modules/test-folder-display-helpers.js */
/* import-globals-from ../shared-modules/test-window-helpers.js */
var MODULE_NAME = "test-smime-multipart-alternative";
var RELATIVE_ROOT = "../shared-modules";
var MODULE_REQUIRES = [
"folder-display-helpers",
"compose-helpers",
"window-helpers",
];
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
var { MailServices } = ChromeUtils.import(
"resource:///modules/MailServices.jsm"
);
var os = ChromeUtils.import("chrome://mozmill/content/stdlib/os.jsm");
var gDrafts;
function setupModule(module) {
for (let lib of MODULE_REQUIRES) {
collector.getModule(lib).installInto(module);
}
gDrafts = get_special_folder(Ci.nsMsgFolderFlags.Drafts, true);
Services.prefs.setBoolPref("mail.identity.id1.compose_html", true);
}
function get_file_for_path(path) {
return os.getFileForPath(os.abspath(path, os.getFileForPath(__file__)));
}
function test_multipart_alternative() {
smimeUtils_ensureNSS();
smimeUtils_loadPEMCertificate(
get_file_for_path("./TestCA.pem"),
Ci.nsIX509Cert.CA_CERT
);
smimeUtils_loadCertificateAndKey(get_file_for_path("./Bob.p12"));
let msgc = open_message_from_file(
get_file_for_path("./multipart-alternative.eml")
);
let cwc = open_compose_with_reply(msgc);
close_window(msgc);
// Now save the message as a draft.
cwc.keypress(null, "s", { shiftKey: false, accelKey: true });
close_compose_window(cwc);
// Now check the message content in the drafts folder.
be_in_folder(gDrafts);
let message = select_click_row(0);
let messageContent = get_msg_source(message);
// Check for a single line that contains text and make sure there is a
// space at the end for a flowed reply.
assert_false(
messageContent.includes("SECRET-TEXT"),
"Secret text was found, but shouldn't be there."
);
// Delete the outgoing message.
press_delete();
}
function teardownModule() {
Services.prefs.clearUserPref("mail.identity.id1.compose_html");
}

Просмотреть файл

@ -15,9 +15,3 @@ of this directory:
tests_results/security/localhost.1/sharedb/smime/tb/
(You only need the files having extensions .eml or .p12 or .pem .)
The generate.sh script will automatically call local-gen.sh script,
which generates additional test data, based on the updated NSS data.
You may call local-gen.sh independently, if necessary, e.g. when adding
new local tests.

Просмотреть файл

@ -1,17 +1,7 @@
#!/bin/bash
# This script creates updated data for automated S/MIME tests.
# It will do a local build of NSS, execute parts of the NSS test suite,
# and copy data created by it to the local source tree.
if ! test -e generate.sh || ! test -e local-gen.sh
then
echo "you must run this script from inside the directory that contains generate.sh and local-gen.sh"
exit
fi
mkdir nssbuild
pushd nssbuild
cd nssbuild
cp -riv ../../../../../../security/nss nss
cp -riv ../../../../../../nsprpub nspr
@ -25,7 +15,7 @@ export NSS_TESTS=smime
cd tests
HOST=localhost DOMSUF=localdomain ./all.sh
popd
cd ../../..
cp -v nssbuild/tests_results/security/localhost.1/sharedb/smime/tb/*.eml .
cp -v nssbuild/tests_results/security/localhost.1/sharedb/smime/tb/*.p12 .
cp -v nssbuild/tests_results/security/localhost.1/sharedb/smime/tb/*.pem .
@ -33,41 +23,14 @@ cp -v nssbuild/tests_results/security/localhost.1/sharedb/smime/tb/*.pem .
EXPIRATION_INFO_FILE="`pwd`/expiration.txt"
ALICE_DIR="`pwd`/nssbuild/tests_results/security/localhost.1/sharedb/alicedir"
export DIST="`pwd`/nssbuild/dist/"
pushd nssbuild/nss/tests/common
export OBJDIR=`make objdir_name`
OBJ=`make objdir_name`
popd
# PATH logic copied from nss/tests/common/init.sh
if [ "${OS_ARCH}" = "WINNT" -a "$OS_NAME" != "CYGWIN_NT" -a "$OS_NAME" != "MINGW32_NT" ]; then
PATH=.\;${DIST}/${OBJDIR}/bin\;${DIST}/${OBJDIR}/lib\;$PATH
PATH=`perl ../path_uniq -d ';' "$PATH"`
elif [ "${OS_ARCH}" = "Android" ]; then
# android doesn't have perl, skip the uniq step
PATH=.:${DIST}/${OBJDIR}/bin:${DIST}/${OBJDIR}/lib:$PATH
else
PATH=.:${DIST}/${OBJDIR}/bin:${DIST}/${OBJDIR}/lib:/bin:/usr/bin:$PATH
# added /bin and /usr/bin in the beginning so a local perl will
# be used
PATH=`perl nssbuild/nss/tests/path_uniq -d ':' "$PATH"`
fi
export PATH
export LD_LIBRARY_PATH=${DIST}/${OBJDIR}/lib:$LD_LIBRARY_PATH
export SHLIB_PATH=${DIST}/${OBJDIR}/lib:$SHLIB_PATH
export LIBPATH=${DIST}/${OBJDIR}/lib:$LIBPATH
export DYLD_LIBRARY_PATH=${DIST}/${OBJDIR}/lib:$DYLD_LIBRARY_PATH
certutil -d ${ALICE_DIR} -L -n Alice |grep -i "Not After" | \
pushd nssbuild/dist/${OBJ}/bin
./certutil -d ${ALICE_DIR} -L -n Alice |grep -i "Not After" | \
sed 's/^.*: //' > ${EXPIRATION_INFO_FILE}
# exporting DYLD_LIBRARY_PATH to a subprocess doesn't work on recent OSX
export NSS_LIB_PATH=${DIST}/${OBJDIR}/lib
# Now refresh Thunderbird's local test data that is based on the NSS
# test suite data.
./local-gen.sh
popd
echo "Done. Will remove the NSS build/test tree in 20 seconds."
sleep 20

Просмотреть файл

@ -1,83 +0,0 @@
#!/bin/bash
# This script creates additional S/MIME test files.
# It's called automatically by generate.sh.
# However, it can also be called directly, if the test data from NSS
# is still sufficiently fresh, and only the local test files need to
# be updated, e.g. when adding new tests.
if [ -n "$NSS_LIB_PATH" ]
then
export LD_LIBRARY_PATH=${NSS_LIB_PATH}:$LD_LIBRARY_PATH
export SHLIB_PATH=${NSS_LIB_PATH}:$SHLIB_PATH
export LIBPATH=${NSS_LIB_PATH}:$LIBPATH
export DYLD_LIBRARY_PATH=${NSS_LIB_PATH}:$DYLD_LIBRARY_PATH
fi
if ! test -e generate.sh || ! test -e local-gen.sh
then
echo "you must run this script from inside the directory that contains local-gen.sh and generate.sh"
exit
fi
if ! hash certutil || ! hash pk12util || ! hash atob || ! hash btoa
then
echo "Required NSS utilities cannot be executed. Add \$OBJDIR/dist/bin of a local Thunderbird build to both the PATH and (platform specific) library path environment variable (e.g. LD_LIBRARY_PATH or DYLD_LIBRARY_PATH)."
exit
fi
MILLDIR="`pwd`/../../../../mail/test/mozmill/smime"
# When executing mozmill in the CI environment, the files from this
# directory aren't available. Copy all files that mozmill requires to
# the mozmill directory.
cp -rv Bob.p12 TestCA.pem $MILLDIR
TMPDIR="./tmp-local"
mkdir $TMPDIR
BOUNDARY="--------BOUNDARY"
MSGHEADER="MIME-Version: 1.0
From: Alice <alice@example.com>
To: Bob <bob@example.com>
Subject: a message
Content-Type: multipart/alternative; boundary=\"${BOUNDARY}\"
"
ENVHEADER="Content-Type: application/pkcs7-mime; smime-type=enveloped-data
Content-Transfer-Encoding: base64
"
certutil -d $TMPDIR -N --empty-password
pk12util -d $TMPDIR -i Alice.p12 -W ''
pk12util -d $TMPDIR -i Bob.p12 -W ''
certutil -d $TMPDIR -M -n TestCA -t C,C,
INPUT="Content-type: text/plain
SECRET-TEXT the attacker wants to steal
"
echo "$INPUT" | cmsutil -d $TMPDIR -E -r bob@example.com | btoa > $TMPDIR/prey.b64
INPUT="Content-type: text/html
<pre>Please reply to this harmless looking message</pre><style>.moz-text-plain, .moz-quote-pre, fieldset {display: none;}</style>"
echo "$INPUT" | cmsutil -d $TMPDIR -E -r bob@example.com | btoa > $TMPDIR/bait.b64
MSG=$TMPDIR/msg.eml
echo -n "$MSGHEADER" > $MSG
echo "--$BOUNDARY" >> $MSG
echo -n "$ENVHEADER" >> $MSG
cat $TMPDIR/bait.b64 >> $MSG
echo "--$BOUNDARY" >> $MSG
echo -n "$ENVHEADER" >> $MSG
cat $TMPDIR/prey.b64 >> $MSG
echo "--$BOUNDARY" >> $MSG
mv $MSG $MILLDIR/multipart-alternative.eml
rm -rf $TMPDIR