summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTa-wei Yen <twyen@google.com>2016-05-13 11:33:12 -0700
committerTa-wei Yen <twyen@google.com>2016-05-16 20:37:19 +0000
commit61b586413d869212920e586a717148ef0b997d1d (patch)
tree7c210d4f336316f6dcb37b7d9795d1277d288405 /tests
parent87c49844374decc60a4c0397c2b33e63b7d5548d (diff)
downloadandroid_packages_services_Telephony-61b586413d869212920e586a717148ef0b997d1d.tar.gz
android_packages_services_Telephony-61b586413d869212920e586a717148ef0b997d1d.tar.bz2
android_packages_services_Telephony-61b586413d869212920e586a717148ef0b997d1d.zip
Support AUTHENTICATE DIGEST-MD5 for OMTP visual voicemail
As specified in https://www.ietf.org/rfc/rfc2831.txt + use the SSL port in the carrier config for IMAP SSL connection + avoid server capabilities that is disabled in carrier config. + Additional config for T-Mobile Fixes:27816895 Change-Id: Ic3d29f3ea388242d37646e9c9c76f14ee54e41c2 (cherry picked from commit 44cabbb246ed3ce7830a4730d941c4355d569ed0)
Diffstat (limited to 'tests')
-rw-r--r--tests/src/com/android/phone/common/mail/store/imap/DigestMd5UtilsTest.java53
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/src/com/android/phone/common/mail/store/imap/DigestMd5UtilsTest.java b/tests/src/com/android/phone/common/mail/store/imap/DigestMd5UtilsTest.java
new file mode 100644
index 000000000..553463246
--- /dev/null
+++ b/tests/src/com/android/phone/common/mail/store/imap/DigestMd5UtilsTest.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.phone.common.mail.store.imap;
+
+import junit.framework.TestCase;
+
+public class DigestMd5UtilsTest extends TestCase {
+
+ public void testGetResponse() {
+ // Example data from RFC 2831.4
+ DigestMd5Utils.Data data = new DigestMd5Utils.Data();
+ data.username = "chris";
+ data.password = "secret";
+ data.realm = "elwood.innosoft.com";
+ data.nonce = "OA6MG9tEQGm2hh";
+ data.cnonce = "OA6MHXh6VqTrRk";
+ data.nc = "00000001";
+ data.qop = "auth";
+ data.digestUri = "imap/elwood.innosoft.com";
+ String response = DigestMd5Utils.getResponse(data, false);
+ assertEquals("d388dad90d4bbd760a152321f2143af7", response);
+ }
+
+ public void testGetResponse_ResponseAuth() {
+ // Example data from RFC 2831.4
+ DigestMd5Utils.Data data = new DigestMd5Utils.Data();
+ data.username = "chris";
+ data.password = "secret";
+ data.realm = "elwood.innosoft.com";
+ data.nonce = "OA6MG9tEQGm2hh";
+ data.cnonce = "OA6MHXh6VqTrRk";
+ data.nc = "00000001";
+ data.qop = "auth";
+ data.digestUri = "imap/elwood.innosoft.com";
+ String response = DigestMd5Utils.getResponse(data, true);
+ assertEquals("ea40f60335c427b5527b84dbabcdfffd", response);
+ }
+
+}