fix autocrypt tests (they were still INBOME)

This commit is contained in:
Vincent Breitmoser 2017-06-28 16:17:52 +02:00
parent 515fc21c77
commit a7aaefe404
8 changed files with 13 additions and 13 deletions

View file

@ -44,7 +44,7 @@ public class AutocryptOperations {
}
String messageFromAddress = currentMessage.getFrom()[0].getAddress();
if (!autocryptHeader.to.equalsIgnoreCase(messageFromAddress)) {
if (!autocryptHeader.addr.equalsIgnoreCase(messageFromAddress)) {
return false;
}
@ -146,13 +146,13 @@ public class AutocryptOperations {
@VisibleForTesting
class AutocryptHeader {
final byte[] keyData;
final String to;
final String addr;
final Map<String,String> parameters;
final boolean isPreferEncryptMutual;
private AutocryptHeader(Map<String, String> parameters, String to, byte[] keyData, boolean isPreferEncryptMutual) {
private AutocryptHeader(Map<String, String> parameters, String addr, byte[] keyData, boolean isPreferEncryptMutual) {
this.parameters = parameters;
this.to = to;
this.addr = addr;
this.keyData = keyData;
this.isPreferEncryptMutual = isPreferEncryptMutual;
}

View file

@ -59,7 +59,7 @@ public class AutocryptOperationsTest {
AutocryptHeader autocryptHeader = autocryptOperations.getValidAutocryptHeader(message);
assertNotNull(autocryptHeader);
assertEquals("alice@testsuite.autocrypt.org", autocryptHeader.to);
assertEquals("alice@testsuite.autocrypt.org", autocryptHeader.addr);
assertEquals(0, autocryptHeader.parameters.size());
assertEquals(1225, autocryptHeader.keyData.length);
}
@ -71,7 +71,7 @@ public class AutocryptOperationsTest {
AutocryptHeader autocryptHeader = autocryptOperations.getValidAutocryptHeader(message);
assertNotNull(autocryptHeader);
assertEquals("alice@testsuite.autocrypt.org", autocryptHeader.to);
assertEquals("alice@testsuite.autocrypt.org", autocryptHeader.addr);
assertEquals(0, autocryptHeader.parameters.size());
}
@ -100,7 +100,7 @@ public class AutocryptOperationsTest {
AutocryptHeader autocryptHeader = autocryptOperations.getValidAutocryptHeader(message);
assertNotNull(autocryptHeader);
assertEquals("alice@testsuite.autocrypt.org", autocryptHeader.to);
assertEquals("alice@testsuite.autocrypt.org", autocryptHeader.addr);
assertEquals(1, autocryptHeader.parameters.size());
assertEquals("ignore", autocryptHeader.parameters.get("_monkey"));
}

View file

@ -1,7 +1,7 @@
From: Alice <alice@testsuite.autocrypt.org>
To: Bob <bob@testsuite.autocrypt.org>
Subject: an INBOME RSA test
INBOME: to=alice@testsuite.autocrypt.org; key=
Autocrypt: addr=alice@testsuite.autocrypt.org; key=
m!@#$%hVF+ABCADu17FBUgA3mCemeKbNaBTyWe3VGxjbu7fUyHgdLK7i3tnd7IRtxQy/AEN2t6Vq
0/xeZEAKYRInsHI/HjvmhqPeWFzipk71jRQ02WUY1pZytFjYNIrTdMk4eLYdC1N0go83PU33V4R8
fc2fWHD8N5JPsDH2xOB6WNWkMPxgMbtGIa0QTx7TINhDif4/1/VcrX3wz1gZ6xYI+sujbC54iBZo

View file

@ -1,7 +1,7 @@
From: Alice <alice@testsuite.autocrypt.org>
To: Bob <bob@testsuite.autocrypt.org>
Subject: inbome rsa2048 with correct type
INBOME: to=alice@testsuite.autocrypt.org; type=p; key=
Autocrypt: addr=alice@testsuite.autocrypt.org; type=1; key=
mQENBFhVF+ABCADu17FBUgA3mCemeKbNaBTyWe3VGxjbu7fUyHgdLK7i3tnd7IRtxQy/AEN2t6Vq
0/xeZEAKYRInsHI/HjvmhqPeWFzipk71jRQ02WUY1pZytFjYNIrTdMk4eLYdC1N0go83PU33V4R8
fc2fWHD8N5JPsDH2xOB6WNWkMPxgMbtGIa0QTx7TINhDif4/1/VcrX3wz1gZ6xYI+sujbC54iBZo

View file

@ -1,7 +1,7 @@
From: Alice <alice@testsuite.autocrypt.org>
To: Bob <bob@testsuite.autocrypt.org>
Subject: an INBOME RSA test
INBOME: to=alice@testsuite.autocrypt.org; key=
Autocrypt: addr=alice@testsuite.autocrypt.org; key=
mQENBFhVF+ABCADu17FBUgA3mCemeKbNaBTyWe3VGxjbu7fUyHgdLK7i3tnd7IRtxQy/AEN2t6Vq
0/xeZEAKYRInsHI/HjvmhqPeWFzipk71jRQ02WUY1pZytFjYNIrTdMk4eLYdC1N0go83PU33V4R8
fc2fWHD8N5JPsDH2xOB6WNWkMPxgMbtGIa0QTx7TINhDif4/1/VcrX3wz1gZ6xYI+sujbC54iBZo

View file

@ -1,7 +1,7 @@
From: Alice <alice@testsuite.autocrypt.org>
To: Bob <bob@testsuite.autocrypt.org>
Subject: another inbome with rsa2048 but with an unknown critical attribute
INBOME: to=alice@testsuite.autocrypt.org; danger=do-not-use; key=
Autocrypt: addr=alice@testsuite.autocrypt.org; danger=do-not-use; key=
mQENBFhVGA8BCADK+qTRkAfax0LtJ6RiyxzuAFyIohBTwvtcOM2sd/tRmWq1eyNif5AGDnc1+b6X
zJ6l3BXiYM/8qXU/F04UA5BP05SgIqXjqT5I13blrydjKtUbZFchK7lJU7cyDbar+TH70DZURSQm
MusCj0+fdx6hx8y4LSOM68rjwVeq7JXAPU78QQsYgMrbtkf5mZWUquDdb7tEoxU+PcNifvtvuHF2

View file

@ -1,7 +1,7 @@
From: Alice <alice@testsuite.autocrypt.org>
To: Bob <bob@testsuite.autocrypt.org>
Subject: inbome: rsa 2048 with unknown non-critical attribute
INBOME: to=alice@testsuite.autocrypt.org; _monkey=ignore; key=
Autocrypt: addr=alice@testsuite.autocrypt.org; _monkey=ignore; key=
mQENBFhVF+ABCADu17FBUgA3mCemeKbNaBTyWe3VGxjbu7fUyHgdLK7i3tnd7IRtxQy/AEN2t6Vq
0/xeZEAKYRInsHI/HjvmhqPeWFzipk71jRQ02WUY1pZytFjYNIrTdMk4eLYdC1N0go83PU33V4R8
fc2fWHD8N5JPsDH2xOB6WNWkMPxgMbtGIa0QTx7TINhDif4/1/VcrX3wz1gZ6xYI+sujbC54iBZo

View file

@ -1,7 +1,7 @@
From: Alice <alice@testsuite.autocrypt.org>
To: Bob <bob@testsuite.autocrypt.org>
Subject: INBOME with invalid type attribute
INBOME: to=alice@testsuite.autocrypt.org; type=x; key=
Autocrypt: addr=alice@testsuite.autocrypt.org; type=x; key=
mQENBFhVGA8BCADK+qTRkAfax0LtJ6RiyxzuAFyIohBTwvtcOM2sd/tRmWq1eyNif5AGDnc1+b6X
zJ6l3BXiYM/8qXU/F04UA5BP05SgIqXjqT5I13blrydjKtUbZFchK7lJU7cyDbar+TH70DZURSQm
MusCj0+fdx6hx8y4LSOM68rjwVeq7JXAPU78QQsYgMrbtkf5mZWUquDdb7tEoxU+PcNifvtvuHF2