mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-30 05:02:26 -05:00
Fix class name
This commit is contained in:
parent
d678ccc160
commit
0a07250417
@ -19,13 +19,13 @@ import static junit.framework.Assert.assertSame;
|
||||
|
||||
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class MessageDecryptVerifyerTest {
|
||||
public class MessageDecryptVerifierTest {
|
||||
|
||||
@Test
|
||||
public void findEncryptedPartsShouldReturnEmptyListForEmptyMessage() throws Exception {
|
||||
MimeMessage emptyMessage = new MimeMessage();
|
||||
|
||||
List<Part> encryptedParts = MessageDecryptVerifyer.findEncryptedParts(emptyMessage);
|
||||
List<Part> encryptedParts = MessageDecryptVerifier.findEncryptedParts(emptyMessage);
|
||||
assertEquals(0, encryptedParts.size());
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ public class MessageDecryptVerifyerTest {
|
||||
MimeMessage message = new MimeMessage();
|
||||
message.setBody(new TextBody("message text"));
|
||||
|
||||
List<Part> encryptedParts = MessageDecryptVerifyer.findEncryptedParts(message);
|
||||
List<Part> encryptedParts = MessageDecryptVerifier.findEncryptedParts(message);
|
||||
assertEquals(0, encryptedParts.size());
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ public class MessageDecryptVerifyerTest {
|
||||
mulitpartEncrypted.setSubType("encrypted");
|
||||
MimeMessageHelper.setBody(message, mulitpartEncrypted);
|
||||
|
||||
List<Part> encryptedParts = MessageDecryptVerifyer.findEncryptedParts(message);
|
||||
List<Part> encryptedParts = MessageDecryptVerifier.findEncryptedParts(message);
|
||||
assertEquals(1, encryptedParts.size());
|
||||
assertSame(message, encryptedParts.get(0));
|
||||
}
|
||||
@ -70,7 +70,7 @@ public class MessageDecryptVerifyerTest {
|
||||
MimeBodyPart bodyPartThree = new MimeBodyPart(mulitpartEncryptedThree);
|
||||
multipartMixed.addBodyPart(bodyPartThree);
|
||||
|
||||
List<Part> encryptedParts = MessageDecryptVerifyer.findEncryptedParts(message);
|
||||
List<Part> encryptedParts = MessageDecryptVerifier.findEncryptedParts(message);
|
||||
assertEquals(2, encryptedParts.size());
|
||||
assertSame(bodyPartOne, encryptedParts.get(0));
|
||||
assertSame(bodyPartThree, encryptedParts.get(1));
|
@ -14,7 +14,7 @@ import com.fsck.k9.mail.Multipart;
|
||||
import com.fsck.k9.mail.Part;
|
||||
|
||||
|
||||
public class MessageDecryptVerifyer {
|
||||
public class MessageDecryptVerifier {
|
||||
private static final String MULTIPART_ENCRYPTED = "multipart/encrypted";
|
||||
private static final String MULTIPART_SIGNED = "multipart/signed";
|
||||
private static final String PROTOCOL_PARAMETER = "protocol";
|
@ -5,7 +5,7 @@ import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.fsck.k9.R;
|
||||
import com.fsck.k9.crypto.MessageDecryptVerifyer;
|
||||
import com.fsck.k9.crypto.MessageDecryptVerifier;
|
||||
import com.fsck.k9.mail.Address;
|
||||
import com.fsck.k9.mail.Body;
|
||||
import com.fsck.k9.mail.BodyPart;
|
||||
@ -478,7 +478,7 @@ public class LocalMessageExtractor {
|
||||
parts.add(part);
|
||||
return true;
|
||||
}
|
||||
} else if (MessageDecryptVerifyer.isPgpMimeSignedPart(part)) {
|
||||
} else if (MessageDecryptVerifier.isPgpMimeSignedPart(part)) {
|
||||
parts.add(part);
|
||||
return true;
|
||||
} else if (isPgpMimeDecryptedPart(part)) {
|
||||
@ -492,7 +492,7 @@ public class LocalMessageExtractor {
|
||||
public static boolean isPgpMimeDecryptedPart (Part part) {
|
||||
Body body = part.getBody();
|
||||
return (body instanceof Multipart)
|
||||
&& MessageDecryptVerifyer.isPgpMimeEncryptedPart(part)
|
||||
&& MessageDecryptVerifier.isPgpMimeEncryptedPart(part)
|
||||
&& ((Multipart) part.getBody()).getCount() == 3;
|
||||
}
|
||||
|
||||
@ -501,7 +501,7 @@ public class LocalMessageExtractor {
|
||||
OpenPgpResultBodyPart openPgpResultBodyPart = (OpenPgpResultBodyPart) part;
|
||||
return openPgpResultBodyPart;
|
||||
}
|
||||
if (MessageDecryptVerifyer.isPgpMimeSignedPart(part)) {
|
||||
if (MessageDecryptVerifier.isPgpMimeSignedPart(part)) {
|
||||
Multipart multi = (Multipart) part.getBody();
|
||||
if (multi.getCount() == 3 && multi.getBodyPart(2) instanceof OpenPgpResultBodyPart) {
|
||||
OpenPgpResultBodyPart openPgpResultBodyPart = (OpenPgpResultBodyPart) multi.getBodyPart(2);
|
||||
|
@ -20,7 +20,7 @@ import com.fsck.k9.Account;
|
||||
import com.fsck.k9.Identity;
|
||||
import com.fsck.k9.K9;
|
||||
import com.fsck.k9.activity.MessageList;
|
||||
import com.fsck.k9.crypto.MessageDecryptVerifyer;
|
||||
import com.fsck.k9.crypto.MessageDecryptVerifier;
|
||||
import com.fsck.k9.crypto.OpenPgpApiHelper;
|
||||
import com.fsck.k9.helper.IdentityHelper;
|
||||
import com.fsck.k9.mail.Body;
|
||||
@ -61,8 +61,8 @@ public class MessageCryptoHelper {
|
||||
void decryptOrVerifyMessagePartsIfNecessary(LocalMessage message) {
|
||||
this.message = message;
|
||||
|
||||
List<Part> encryptedParts = MessageDecryptVerifyer.findEncryptedParts(message);
|
||||
List<Part> signedParts = MessageDecryptVerifyer.findSignedParts(message);
|
||||
List<Part> encryptedParts = MessageDecryptVerifier.findEncryptedParts(message);
|
||||
List<Part> signedParts = MessageDecryptVerifier.findSignedParts(message);
|
||||
if (!encryptedParts.isEmpty() || !signedParts.isEmpty()) {
|
||||
partsToDecryptOrVerify = new ArrayDeque<Part>();
|
||||
partsToDecryptOrVerify.addAll(encryptedParts);
|
||||
@ -77,7 +77,7 @@ public class MessageCryptoHelper {
|
||||
if (!partsToDecryptOrVerify.isEmpty()) {
|
||||
|
||||
Part part = partsToDecryptOrVerify.peekFirst();
|
||||
if (MessageDecryptVerifyer.isPgpMimePart(part)) {
|
||||
if (MessageDecryptVerifier.isPgpMimePart(part)) {
|
||||
startDecryptingOrVerifyingPart(part);
|
||||
} else {
|
||||
partsToDecryptOrVerify.removeFirst();
|
||||
@ -139,7 +139,7 @@ public class MessageCryptoHelper {
|
||||
intent.putExtra(OpenPgpApi.EXTRA_ACCOUNT_NAME, accountName);
|
||||
|
||||
try {
|
||||
if (MessageDecryptVerifyer.isPgpMimeSignedPart(currentlyDecrypringOrVerifyingPart)) {
|
||||
if (MessageDecryptVerifier.isPgpMimeSignedPart(currentlyDecrypringOrVerifyingPart)) {
|
||||
callAsyncDetachedVerify(intent);
|
||||
} else {
|
||||
callAsyncDecrypt(intent);
|
||||
@ -168,7 +168,7 @@ public class MessageCryptoHelper {
|
||||
private void callAsyncDetachedVerify(Intent intent) throws IOException, MessagingException {
|
||||
PipedInputStream pipedInputStream = getPipedInputStreamForSignedData();
|
||||
|
||||
byte[] signatureData = MessageDecryptVerifyer.getSignatureData(currentlyDecrypringOrVerifyingPart);
|
||||
byte[] signatureData = MessageDecryptVerifier.getSignatureData(currentlyDecrypringOrVerifyingPart);
|
||||
intent.putExtra(OpenPgpApi.EXTRA_DETACHED_SIGNATURE, signatureData);
|
||||
|
||||
openPgpApi.executeApiAsync(intent, pipedInputStream, null, new IOpenPgpCallback() {
|
||||
|
Loading…
Reference in New Issue
Block a user