author | hgs |
Mon, 04 Oct 2010 11:29:25 +0300 | |
changeset 78 | 71ad690e91f5 |
parent 21 | 2a9601315dfc |
permissions | -rw-r--r-- |
21
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
package com.nokia.mj.impl.security.midp.authentication; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
import java.util.Hashtable; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
import java.util.Vector; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
import com.nokia.mj.impl.installer.utils.InstallerMain; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
import com.nokia.mj.impl.security.midp.authentication.AuthenticationModule; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
import com.nokia.mj.impl.security.midp.authentication.OcspUserPreferences; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
import com.nokia.mj.impl.security.common.InstallerSecurityException; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
import com.nokia.mj.impl.security.midp.common.SecurityAttributes; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
import com.nokia.mj.impl.security.midp.common.AuthenticationAttribute; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
import com.nokia.mj.impl.utils.Uid; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
30 |
import com.nokia.mj.impl.storage.*; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
import com.nokia.mj.impl.security.midp.storage.SecurityStorage; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
import com.nokia.mj.impl.utils.OtaStatusCode; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
33 |
import com.nokia.mj.impl.utils.Attribute; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
import com.nokia.mj.impl.security.utils.SecurityErrorMessage; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
35 |
import com.nokia.mj.impl.security.utils.SecurityDetailedErrorMessage; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
36 |
import com.nokia.mj.impl.rt.ui.RuntimeUiFactory; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
37 |
import com.nokia.mj.impl.rt.ui.RuntimeUi; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
import com.nokia.mj.impl.rt.ui.ConfirmData; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
39 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
40 |
import j2meunit.framework.Test; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
41 |
import j2meunit.framework.TestCase; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
42 |
import j2meunit.framework.TestMethod; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
43 |
import j2meunit.framework.TestSuite; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
45 |
/** |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
46 |
* InteractiveAuthenticationModule unit tests. |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
*/ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
48 |
public class InteractiveAuthenticationModuleTests extends AuthenticationModuleTests |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
51 |
private static String TEST_DATA_DIR; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
private static String OCSP_URL = "http://" + System.getProperty("com.nokia.mj.impl.installer.test.server") + ":8888"; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
54 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
static |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
String platform = System.getProperty("os.name"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
58 |
if (platform != null && platform.equalsIgnoreCase("linux")) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
TEST_DATA_DIR = System.getProperty("JAVA_BIN_ROOT") + "/securitytestdata/"; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
else |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
63 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
64 |
TEST_DATA_DIR = "C:\\java\\securitytestdata\\"; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
65 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
66 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
67 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
68 |
// class to be tested |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
69 |
AuthenticationModule authenticationModule; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
71 |
/** |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
72 |
* Hashtable holding all the attributes. Tests populate this hashtable |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
* prior to being executed |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
*/ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
75 |
protected Hashtable allAttributes; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
77 |
// general-purpose constants |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
protected static final String MIDP_PROFILE_ATTRIBUTE_NAME = "MicroEdition-Profile"; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
79 |
protected static final String MIDP3 = "MIDP-3.0"; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
80 |
protected static final String MIDP2 = "MIDP-2.0"; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
81 |
private static final String COMMA = ","; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
82 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
// references to error messages |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
84 |
protected SecurityErrorMessage securityErrorMessage = new SecurityErrorMessage(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
85 |
protected SecurityDetailedErrorMessage securityDetailedErrorMessage = new SecurityDetailedErrorMessage(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
86 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
87 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
88 |
// Begin j2meunit test framework setup |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
89 |
public void installerMain(String[] args) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
90 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
91 |
TestSuite suite = new TestSuite(this.getClass().getName()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
92 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
93 |
suite.addTest(new InteractiveAuthenticationModuleTests("testOcsp", new TestMethod() |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
94 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
95 |
public void run(TestCase tc) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
96 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
97 |
((InteractiveAuthenticationModuleTests)tc).testOcsp(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
98 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
99 |
})); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
100 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
101 |
com.nokia.mj.impl.utils.OmjTestRunner.run(suite); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
102 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
104 |
public InteractiveAuthenticationModuleTests() |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
105 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
106 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
107 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
108 |
public InteractiveAuthenticationModuleTests(String aTestName, TestMethod aTestMethod) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
109 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
super(aTestName, aTestMethod); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
111 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
public void assertFalse(String aMsg, boolean aCondition) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
114 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
115 |
assertTrue(aMsg, !aCondition); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
116 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
117 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
118 |
// End j2meunit test framework setup |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
119 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
protected void setUp() |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
122 |
authenticationModule = authenticationModule.getInstance(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
123 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
protected void tearDown() |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
126 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
128 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
129 |
private void testOcsp() |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
130 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
131 |
MyOcspEventListener oscpEventListener = new MyOcspEventListener(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
132 |
OcspEvent ocspEvent = null; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
133 |
InstallerSecurityException ocspError = null; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
134 |
OcspChecker ocspChecker = null; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
135 |
boolean sucess = false; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
136 |
allAttributes = new Hashtable(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
137 |
SecurityAttributes securityAttributes; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
138 |
StorageSession session = StorageFactory.createSession(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
139 |
session.open(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
140 |
Uid appUID = Uid.createUid("myUID"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
141 |
OcspSettings ocspSettings = null; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
142 |
OcspUserPreferences ocspUserPreferences = new OcspUserPreferences(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
143 |
SecurityStorage storage = new SecurityStorage(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
144 |
// cancel ocsp when the ocsp is off |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
145 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_UNDEFINED, OcspSettings.OCSP_WARNING_UNDEFINED, false, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
146 |
ocspUserPreferences.setOcspMode(OcspUserPreferences.OCSP_MODE_OFF); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
147 |
ocspUserPreferences.setOcspUrl(null); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
148 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
149 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
150 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
151 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
152 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICyjCCAjOgAwIBAgIJALGqj4FMKNfXMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDIwNTEzMzAyMloXDTE1MDIwNDEzMzAyMlowVzELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk15IENvbW1vbiBOYW1lMR0wGwYDVQQKExRNeSBPcmdhbml6YXRpb24gTmFtZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMGxLn8s08e8/JFPO1nHf26Qdm8cUdMtTaEhhXCPT5T5nB2KSB3RiP8s5GfSRoTwEeL7/nwC3djM1MA/08RlX+FnwPT/8F7xiIiIw+Lx8jQWSgZcboUyVjYtAebCIpMQx86+4jGmzn3ujRz/2bBhxXPwNx2SgAPRanKeZbCtJtx8TYyms4ZNyV4+e59gG7aEmO6UbYs1t2K/aqpNkwpKJ+KXN5tquUYMBvjFFIWBvzLHWHM5zMHmj3wjxxjQjLqJPNgX3cnxKCiCJ3hcDcx0/gKR+DgckiNBq2pkw0p1hp8z8mvxt6uqB7kqM8xkjPnu0axwkJ60UyM6k6nq6PeEq60CAwEAATANBgkqhkiG9w0BAQUFAAOBgQA7OTu36H/9RDPzJM1CE6bgwkjheydGz/5ftu/jJquDz6u2d+5ceg2SQ8jxkBsBBQfQmGZYKoVnM9nJnT6mQwF124vb2bn3PteUIC0ImcUUp4mGeSFyC2ljs05irsDVEAq2gt/q+fo4kDHh5SYB+UE21au96hYz/+xJy4HV5tBcFQ==")); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
153 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "p5HbQtH9bV/3imK6rfFRVILj1BzefOP7ebXItNcKeWzSOfeYmebFSJha++GyKY/SM9Zuwrkh4rvFyFc39QdOel3vpUM2FmgnGPwEDbBfVy0TViTYK6SoUCLrBWviKIadbg4N8vVZI/wdrjox+wPUWNVzk+Wflo1rubpJtmIQf29D2F8I+picirvjSj6xSqekr+889P7bNVjyI+OUowZYWftuPi1y81Mo+kRIuaqTzBMCQw7AxMoBAA7BurAiFGtasr8GocuXnNRHb5vKKzA1msY4FJ/k4d9kDjq+OTAfME2nY1Y1qwRrK3WwSaep0+BfIPMb9knwU0ph6OPCMjskUA==")); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
154 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
155 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
156 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
157 |
cancelOcsp(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
158 |
assertTrue(true); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
159 |
// UserInstallation: ocsp undefined, warning undefined, not silent mode, user prefs must, ocsp url not set |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
160 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_UNDEFINED, OcspSettings.OCSP_WARNING_UNDEFINED, false, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
161 |
ocspUserPreferences.setOcspMode(OcspUserPreferences.OCSP_MODE_MUST); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
162 |
ocspUserPreferences.setOcspUrl(null); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
163 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
164 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
165 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
166 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
167 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
168 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
169 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICyjCCAjOgAwIBAgIJALGqj4FMKNfXMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDIwNTEzMzAyMloXDTE1MDIwNDEzMzAyMlowVzELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk15IENvbW1vbiBOYW1lMR0wGwYDVQQKExRNeSBPcmdhbml6YXRpb24gTmFtZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMGxLn8s08e8/JFPO1nHf26Qdm8cUdMtTaEhhXCPT5T5nB2KSB3RiP8s5GfSRoTwEeL7/nwC3djM1MA/08RlX+FnwPT/8F7xiIiIw+Lx8jQWSgZcboUyVjYtAebCIpMQx86+4jGmzn3ujRz/2bBhxXPwNx2SgAPRanKeZbCtJtx8TYyms4ZNyV4+e59gG7aEmO6UbYs1t2K/aqpNkwpKJ+KXN5tquUYMBvjFFIWBvzLHWHM5zMHmj3wjxxjQjLqJPNgX3cnxKCiCJ3hcDcx0/gKR+DgckiNBq2pkw0p1hp8z8mvxt6uqB7kqM8xkjPnu0axwkJ60UyM6k6nq6PeEq60CAwEAATANBgkqhkiG9w0BAQUFAAOBgQA7OTu36H/9RDPzJM1CE6bgwkjheydGz/5ftu/jJquDz6u2d+5ceg2SQ8jxkBsBBQfQmGZYKoVnM9nJnT6mQwF124vb2bn3PteUIC0ImcUUp4mGeSFyC2ljs05irsDVEAq2gt/q+fo4kDHh5SYB+UE21au96hYz/+xJy4HV5tBcFQ==")); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
170 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "p5HbQtH9bV/3imK6rfFRVILj1BzefOP7ebXItNcKeWzSOfeYmebFSJha++GyKY/SM9Zuwrkh4rvFyFc39QdOel3vpUM2FmgnGPwEDbBfVy0TViTYK6SoUCLrBWviKIadbg4N8vVZI/wdrjox+wPUWNVzk+Wflo1rubpJtmIQf29D2F8I+picirvjSj6xSqekr+889P7bNVjyI+OUowZYWftuPi1y81Mo+kRIuaqTzBMCQw7AxMoBAA7BurAiFGtasr8GocuXnNRHb5vKKzA1msY4FJ/k4d9kDjq+OTAfME2nY1Y1qwRrK3WwSaep0+BfIPMb9knwU0ph6OPCMjskUA==")); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
171 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
172 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
173 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
174 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
175 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
176 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
177 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
178 |
assertTrue(sucess == true && (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT && (ocspEvent.eventError instanceof InstallerSecurityException))); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
179 |
ocspError = (InstallerSecurityException)ocspEvent.eventError; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
180 |
assertTrue(ocspError.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHENTICATION_FAILURE |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
181 |
&& ocspError.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.OCSP_GENERAL_ERR, null)) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
182 |
&& ocspError.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.OCSP_SETTINGS_ERR, |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
183 |
null))); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
184 |
// UserInstallation: ocsp undefined, warning undefined, not silent mode, user prefs on, ocsp url not set -> show warning (choose yes) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
185 |
showGuidelines("At the next prompt, choose YES"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
186 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_UNDEFINED, OcspSettings.OCSP_WARNING_UNDEFINED, false, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
187 |
ocspUserPreferences.setOcspMode(OcspUserPreferences.OCSP_MODE_ON); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
188 |
ocspUserPreferences.setOcspUrl(null); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
189 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
190 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
191 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
192 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
193 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
194 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
195 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICyjCCAjOgAwIBAgIJALGqj4FMKNfXMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDIwNTEzMzAyMloXDTE1MDIwNDEzMzAyMlowVzELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk15IENvbW1vbiBOYW1lMR0wGwYDVQQKExRNeSBPcmdhbml6YXRpb24gTmFtZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMGxLn8s08e8/JFPO1nHf26Qdm8cUdMtTaEhhXCPT5T5nB2KSB3RiP8s5GfSRoTwEeL7/nwC3djM1MA/08RlX+FnwPT/8F7xiIiIw+Lx8jQWSgZcboUyVjYtAebCIpMQx86+4jGmzn3ujRz/2bBhxXPwNx2SgAPRanKeZbCtJtx8TYyms4ZNyV4+e59gG7aEmO6UbYs1t2K/aqpNkwpKJ+KXN5tquUYMBvjFFIWBvzLHWHM5zMHmj3wjxxjQjLqJPNgX3cnxKCiCJ3hcDcx0/gKR+DgckiNBq2pkw0p1hp8z8mvxt6uqB7kqM8xkjPnu0axwkJ60UyM6k6nq6PeEq60CAwEAATANBgkqhkiG9w0BAQUFAAOBgQA7OTu36H/9RDPzJM1CE6bgwkjheydGz/5ftu/jJquDz6u2d+5ceg2SQ8jxkBsBBQfQmGZYKoVnM9nJnT6mQwF124vb2bn3PteUIC0ImcUUp4mGeSFyC2ljs05irsDVEAq2gt/q+fo4kDHh5SYB+UE21au96hYz/+xJy4HV5tBcFQ==")); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
196 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "p5HbQtH9bV/3imK6rfFRVILj1BzefOP7ebXItNcKeWzSOfeYmebFSJha++GyKY/SM9Zuwrkh4rvFyFc39QdOel3vpUM2FmgnGPwEDbBfVy0TViTYK6SoUCLrBWviKIadbg4N8vVZI/wdrjox+wPUWNVzk+Wflo1rubpJtmIQf29D2F8I+picirvjSj6xSqekr+889P7bNVjyI+OUowZYWftuPi1y81Mo+kRIuaqTzBMCQw7AxMoBAA7BurAiFGtasr8GocuXnNRHb5vKKzA1msY4FJ/k4d9kDjq+OTAfME2nY1Y1qwRrK3WwSaep0+BfIPMb9knwU0ph6OPCMjskUA==")); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
197 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
198 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
199 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
200 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
201 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
202 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
203 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
204 |
assertTrue(sucess == true && (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT)); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
205 |
// UserInstallation: ocsp undefined, warning undefined, not silent mode, user prefs on, ocsp url not set -> show warning (choose no) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
206 |
showGuidelines("At the next prompt, choose NO"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
207 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_UNDEFINED, OcspSettings.OCSP_WARNING_UNDEFINED, false, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
208 |
ocspUserPreferences.setOcspMode(OcspUserPreferences.OCSP_MODE_ON); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
209 |
ocspUserPreferences.setOcspUrl(null); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
210 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
211 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
212 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
213 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
214 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
215 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
216 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICyjCCAjOgAwIBAgIJALGqj4FMKNfXMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDIwNTEzMzAyMloXDTE1MDIwNDEzMzAyMlowVzELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk15IENvbW1vbiBOYW1lMR0wGwYDVQQKExRNeSBPcmdhbml6YXRpb24gTmFtZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMGxLn8s08e8/JFPO1nHf26Qdm8cUdMtTaEhhXCPT5T5nB2KSB3RiP8s5GfSRoTwEeL7/nwC3djM1MA/08RlX+FnwPT/8F7xiIiIw+Lx8jQWSgZcboUyVjYtAebCIpMQx86+4jGmzn3ujRz/2bBhxXPwNx2SgAPRanKeZbCtJtx8TYyms4ZNyV4+e59gG7aEmO6UbYs1t2K/aqpNkwpKJ+KXN5tquUYMBvjFFIWBvzLHWHM5zMHmj3wjxxjQjLqJPNgX3cnxKCiCJ3hcDcx0/gKR+DgckiNBq2pkw0p1hp8z8mvxt6uqB7kqM8xkjPnu0axwkJ60UyM6k6nq6PeEq60CAwEAATANBgkqhkiG9w0BAQUFAAOBgQA7OTu36H/9RDPzJM1CE6bgwkjheydGz/5ftu/jJquDz6u2d+5ceg2SQ8jxkBsBBQfQmGZYKoVnM9nJnT6mQwF124vb2bn3PteUIC0ImcUUp4mGeSFyC2ljs05irsDVEAq2gt/q+fo4kDHh5SYB+UE21au96hYz/+xJy4HV5tBcFQ==")); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
217 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "p5HbQtH9bV/3imK6rfFRVILj1BzefOP7ebXItNcKeWzSOfeYmebFSJha++GyKY/SM9Zuwrkh4rvFyFc39QdOel3vpUM2FmgnGPwEDbBfVy0TViTYK6SoUCLrBWviKIadbg4N8vVZI/wdrjox+wPUWNVzk+Wflo1rubpJtmIQf29D2F8I+picirvjSj6xSqekr+889P7bNVjyI+OUowZYWftuPi1y81Mo+kRIuaqTzBMCQw7AxMoBAA7BurAiFGtasr8GocuXnNRHb5vKKzA1msY4FJ/k4d9kDjq+OTAfME2nY1Y1qwRrK3WwSaep0+BfIPMb9knwU0ph6OPCMjskUA==")); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
218 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
219 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
220 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
221 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
222 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
223 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
224 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
225 |
assertTrue(ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT && (ocspEvent.eventError instanceof InstallerSecurityException)); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
226 |
ocspError = (InstallerSecurityException)ocspEvent.eventError; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
227 |
assertTrue(ocspError.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHENTICATION_FAILURE |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
228 |
&& ocspError.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.OCSP_GENERAL_ERR, null)) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
229 |
&& ocspError.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.OCSP_SETTINGS_ERR, |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
230 |
null))); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
231 |
// cancel ocsp when the ocsp is on |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
232 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_UNDEFINED, OcspSettings.OCSP_WARNING_UNDEFINED, false, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
233 |
ocspUserPreferences.setOcspMode(OcspUserPreferences.OCSP_MODE_ON); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
234 |
ocspUserPreferences.setOcspUrl(OCSP_URL); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
235 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
236 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
237 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
238 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
239 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
240 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
78 | 241 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICuTCCAiKgAwIBAgIJAKdHK8lkGvSqMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3Mzk0M1oXDTE1MDkxOTA3Mzk0M1owRjELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk9DU1AgR09PRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRHWZYToWVP8is/TWKzRQaRc0SmPNOKdFqkjJYF2NjPmz/EABJLKps4m2BZzN2kMIBRkTuirLKjnsdSelI8itekzZBJJMPgtBvsXn+wa3fPaHa3Lqhp9oa8rr/DaCCnp/B4Id/x6HV53uA8e4qs3PeDnagvomBCQsVApWpL1tcnIow1vMEHIA5uqTOVhCKgwXnnoWfl7AWmh6Tu+SbMYALj8fGzvDhPmxIhVte9NaF462Cxf0B6EuCEEdh0xEWw4qLakWpH9QlwZnshfYFaoSYLqLp83E84Md8SkcraLZed8nDS93Gh++rEjgQSldzkf0MIvZyrmKwf+vgNU+WpvzJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEACgN//8SRGqi50c5gmqZdH0YVC7ABUpBNMP1mP9z3+qadtHOOqIKn3q34rvKzyiZEndufZAt3vUQ1s+wlaJKQTUgAm7G8K8cYYCkexJoQVdfVTyJn2ZKTOkCdfoY9k/uxu3DmHhHteU7j0mmp1LVXrvrSGLtXmpzy+kHvVeH/UMw=")); |
242 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "NL+t9rmzVP7MFfYomU0pb/daz27COxIJ4qMxToYs4oHOn8hk4vwvdm//ORJZnLmk84gfnJRufassInIkwCszsxVoPx47jTi+tqSxFF398kT8MJdFNhr/F1CDQR6vPwMdW5CsRefPGBpr2IaL8oZRfzBDgEZL0bu8PPOOrFZCJbw69SACucYvsReQ1vHJf9XPu4eGEkIZHd9If2Bj/G8rxqUGzQ/ltVhUhhLj8rqrDghRF3+UeB1UPcCd6slKHQ+EyxKU/o2iuMe3B5rmcjDaoj52KsB+gk0puizvEgKn3F15a430u4/feKpqszDvFCWd8qxbWwBDDbLC92P2rc3T8g==")); |
|
21
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
243 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
244 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
245 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
246 |
cancelOcsp(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
247 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
248 |
if (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
249 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
250 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
251 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
252 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
253 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
254 |
assertTrue(sucess); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
255 |
// UserInstallation: ocsp undefined, warning undefined, not silent mode, user prefs on, unknown -> fail |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
256 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_UNDEFINED, OcspSettings.OCSP_WARNING_UNDEFINED, false, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
257 |
ocspUserPreferences.setOcspMode(OcspUserPreferences.OCSP_MODE_ON); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
258 |
ocspUserPreferences.setOcspUrl(OCSP_URL); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
259 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
260 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
261 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
262 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
263 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
264 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
78 | 265 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICvDCCAiWgAwIBAgIJAKrSZo9qYhM/MA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTMzNVoXDTE1MDkxOTA3NTMzNVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgVU5LTk9XTiBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCaZ4VDJjntiOeNKbRd8BIkEjW/Z6k/fLzbiM5hQL/xHQC1PM1spLgnr4pf7Nf+F/bJbDq2eE1jDar6wmtJPcXFFkChl1eS5yJAyY/bhswyzbqNwTcwo1Lu64TSfC4gTdthEmUPNEhzxMcdCj6myrv8hNyhv6dhkcHvZgBwFgS4Pf1DXRmr/PPjCZxyMaoLoKzjezBXVgTC9rViN7moL715HrpO1jkIB2LRY93fzBmPa1leNdiqUqachFtkzYQuuO1MLlmHXKlNmNLOGqlreB/58q5PTPbIGOIzNiN+n0RYMkVSBVImLBQeepO2ICi/DSFW0yi70LpZvebx736P0yF1AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAGBzUyF4Cb/DN4lWY5yxd1/EI/6osAHySIgMEu5ClzyIqULc3QIvjhLrbLV/JKsVYT3h/gFZxwxoTGWdE1dApWj+Hja23TlLmo0uDDL/L3NOB/n041/gI2MQYw1Z9ME2sFzzWIli1P02JciykUQba/b0fRjPsY3ctzDS7QU2EFFs=")); |
266 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "UknTEEInZKDV9RCXnhv8W9KrXYppmRCUL/kSYXtdiiD3OmiwK0/4Nu0N8ix/Olo/IuWNLyPR+YZt6GLUQhw/AlWGd1mq8odlpiulFdB+e8ClkPvOW+3/KMvBO74ajyD2/PreEzCPYouM8YBqdpb49+TffnNQmEdaIpZ659ODppSNzMPmFpCcO6J2SoaU+KOp9uYdNab+JQfkGwrhF4F3FPYsQdPJAgS8Wt//khjQzAGFyOFIWmZ1ZwTbLxyf2QMHPrvtDWWH6h9qaR+2O9A90tF0PM2VUjznEOvBNigKwYTqBAW2j5oF6ZOQ4zyujqpQsm0pF6aPzaVjtZmfnpaCfA==")); |
|
21
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
267 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
268 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
269 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
270 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
271 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
272 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
273 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
274 |
assertTrue(ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT && (ocspEvent.eventError instanceof InstallerSecurityException)); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
275 |
ocspError = (InstallerSecurityException)ocspEvent.eventError; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
276 |
assertTrue(ocspError.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHENTICATION_FAILURE |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
277 |
&& ocspError.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.OCSP_GENERAL_ERR, null)) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
278 |
&& ocspError.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.OCSP_GENERAL_ERR, |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
279 |
null))); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
280 |
// UserInstallation: ocsp undefined, warning undefined, not silent mode, user prefs on, revoked |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
281 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_UNDEFINED, OcspSettings.OCSP_WARNING_UNDEFINED, false, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
282 |
ocspUserPreferences.setOcspMode(OcspUserPreferences.OCSP_MODE_ON); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
283 |
ocspUserPreferences.setOcspUrl(OCSP_URL); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
284 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
285 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
286 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
287 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
288 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
289 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
78 | 290 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICvDCCAiWgAwIBAgIJAM/3P7mVjkjRMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTcxMVoXDTE1MDkxOTA3NTcxMVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgUkVWT0tFRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGIt32Ki+UkQYc/rswY4Bho/ygLyqV8UTVob4yH4k9AQTegIkdjw+AqgfU0LcqMdXguok2PS0sdkgEDPqCMawSMsQRQMsFYcab/LL/i7haWULQL33VI8Wt9grgzFZSpeuhFgr3YgWV0iyMHpKwb4ORiJvWhhvseCK+iI4sAOIhmQZ12HLhvBla5KXTyslLUoXA7V0CuRYqkB3SXn/RARk7GHcoVM+PIk6MtPUkHlyZzqXbHeNOAxGhSEbIp6WJTG2Bg/5OmdSg/kJ44ZSKMk0K2djNTgx70s83B+/vOU81Zxo+SUGiaOC/uw9Irh51WlZl8joq3A+gefO+fPSKCJZDAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAnk5fcldVed5INUs3djxRF9BZ1+ZFdgIjclysYB6B2mSvIdnxnT9H66oKnPeyDqbwcWYfdyDwyeBgsLIk4oOF85lWs5ItjKKcViLbZDPi9J3B+Av/qCWkrkWQokJ5Tkyw8K/sBQrNTM5kH1WrapcKsplcv8FgorE7FC57Ozpli48=")); |
291 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "KXg8rbURv+eZ75Cg0+8KPgaxhhrHqyf26nLFweLWKE7rgkX6aHHfmHirpt/LGzFqQt+516bbkVhG7DLJIshb3qoZBlgzKOqjvJoYwMnVw0CaIMoYjcevortyKk8jbeFnrYU34pp8v0pz3NEKzVgnYAdEnTtl88X+TBgcVDteVUOaz2IGB4JtPKWWRhG7kaOJdYXmCRuNeExv1gHqLYNq0Mr6rmECoMpV1ksrTJK7bJeWwOHRgtVo55rb6bI2MmzE5/Eo4LWg9MKjzmHnCbBWKvFyy5RuEZu5XHAzCJlLO52rfh6dJOq5yuPyB+L87bsgehWFyj1ptq+2jESw0KXuHQ==")); |
|
21
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
292 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
293 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
294 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
295 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
296 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
297 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
298 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
299 |
assertTrue(ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT && (ocspEvent.eventError instanceof InstallerSecurityException)); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
300 |
ocspError = (InstallerSecurityException)ocspEvent.eventError; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
301 |
assertTrue(ocspError.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHENTICATION_FAILURE |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
302 |
&& ocspError.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.OCSP_GENERAL_ERR, null)) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
303 |
&& ocspError.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.OCSP_REVOKED_ERR, |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
304 |
null))); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
305 |
// UserInstallation: ocsp undefined, warning undefined, not silent mode, user prefs on, good |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
306 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_UNDEFINED, OcspSettings.OCSP_WARNING_UNDEFINED, false, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
307 |
ocspUserPreferences.setOcspMode(OcspUserPreferences.OCSP_MODE_ON); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
308 |
ocspUserPreferences.setOcspUrl(OCSP_URL); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
309 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
310 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
311 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
312 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
313 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
314 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
78 | 315 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICuTCCAiKgAwIBAgIJAKdHK8lkGvSqMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3Mzk0M1oXDTE1MDkxOTA3Mzk0M1owRjELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk9DU1AgR09PRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRHWZYToWVP8is/TWKzRQaRc0SmPNOKdFqkjJYF2NjPmz/EABJLKps4m2BZzN2kMIBRkTuirLKjnsdSelI8itekzZBJJMPgtBvsXn+wa3fPaHa3Lqhp9oa8rr/DaCCnp/B4Id/x6HV53uA8e4qs3PeDnagvomBCQsVApWpL1tcnIow1vMEHIA5uqTOVhCKgwXnnoWfl7AWmh6Tu+SbMYALj8fGzvDhPmxIhVte9NaF462Cxf0B6EuCEEdh0xEWw4qLakWpH9QlwZnshfYFaoSYLqLp83E84Md8SkcraLZed8nDS93Gh++rEjgQSldzkf0MIvZyrmKwf+vgNU+WpvzJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEACgN//8SRGqi50c5gmqZdH0YVC7ABUpBNMP1mP9z3+qadtHOOqIKn3q34rvKzyiZEndufZAt3vUQ1s+wlaJKQTUgAm7G8K8cYYCkexJoQVdfVTyJn2ZKTOkCdfoY9k/uxu3DmHhHteU7j0mmp1LVXrvrSGLtXmpzy+kHvVeH/UMw=")); |
316 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "NL+t9rmzVP7MFfYomU0pb/daz27COxIJ4qMxToYs4oHOn8hk4vwvdm//ORJZnLmk84gfnJRufassInIkwCszsxVoPx47jTi+tqSxFF398kT8MJdFNhr/F1CDQR6vPwMdW5CsRefPGBpr2IaL8oZRfzBDgEZL0bu8PPOOrFZCJbw69SACucYvsReQ1vHJf9XPu4eGEkIZHd9If2Bj/G8rxqUGzQ/ltVhUhhLj8rqrDghRF3+UeB1UPcCd6slKHQ+EyxKU/o2iuMe3B5rmcjDaoj52KsB+gk0puizvEgKn3F15a430u4/feKpqszDvFCWd8qxbWwBDDbLC92P2rc3T8g==")); |
|
21
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
317 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
318 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
319 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
320 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
321 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
322 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
323 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
324 |
assertTrue(ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT && ocspEvent.eventError == null); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
325 |
// UserInstallation: ocsp undefined, warning undefined, not silent mode, user prefs must, revoked |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
326 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_UNDEFINED, OcspSettings.OCSP_WARNING_UNDEFINED, false, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
327 |
ocspUserPreferences.setOcspMode(OcspUserPreferences.OCSP_MODE_MUST); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
328 |
ocspUserPreferences.setOcspUrl(OCSP_URL); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
329 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
330 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
331 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
332 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
333 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
334 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
78 | 335 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICvDCCAiWgAwIBAgIJAM/3P7mVjkjRMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTcxMVoXDTE1MDkxOTA3NTcxMVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgUkVWT0tFRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGIt32Ki+UkQYc/rswY4Bho/ygLyqV8UTVob4yH4k9AQTegIkdjw+AqgfU0LcqMdXguok2PS0sdkgEDPqCMawSMsQRQMsFYcab/LL/i7haWULQL33VI8Wt9grgzFZSpeuhFgr3YgWV0iyMHpKwb4ORiJvWhhvseCK+iI4sAOIhmQZ12HLhvBla5KXTyslLUoXA7V0CuRYqkB3SXn/RARk7GHcoVM+PIk6MtPUkHlyZzqXbHeNOAxGhSEbIp6WJTG2Bg/5OmdSg/kJ44ZSKMk0K2djNTgx70s83B+/vOU81Zxo+SUGiaOC/uw9Irh51WlZl8joq3A+gefO+fPSKCJZDAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAnk5fcldVed5INUs3djxRF9BZ1+ZFdgIjclysYB6B2mSvIdnxnT9H66oKnPeyDqbwcWYfdyDwyeBgsLIk4oOF85lWs5ItjKKcViLbZDPi9J3B+Av/qCWkrkWQokJ5Tkyw8K/sBQrNTM5kH1WrapcKsplcv8FgorE7FC57Ozpli48=")); |
336 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "KXg8rbURv+eZ75Cg0+8KPgaxhhrHqyf26nLFweLWKE7rgkX6aHHfmHirpt/LGzFqQt+516bbkVhG7DLJIshb3qoZBlgzKOqjvJoYwMnVw0CaIMoYjcevortyKk8jbeFnrYU34pp8v0pz3NEKzVgnYAdEnTtl88X+TBgcVDteVUOaz2IGB4JtPKWWRhG7kaOJdYXmCRuNeExv1gHqLYNq0Mr6rmECoMpV1ksrTJK7bJeWwOHRgtVo55rb6bI2MmzE5/Eo4LWg9MKjzmHnCbBWKvFyy5RuEZu5XHAzCJlLO52rfh6dJOq5yuPyB+L87bsgehWFyj1ptq+2jESw0KXuHQ==")); |
|
21
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
337 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
338 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
339 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
340 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
341 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
342 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
343 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
344 |
assertTrue(ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT && (ocspEvent.eventError instanceof InstallerSecurityException)); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
345 |
ocspError = (InstallerSecurityException)ocspEvent.eventError; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
346 |
assertTrue(ocspError.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHENTICATION_FAILURE |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
347 |
&& ocspError.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.OCSP_GENERAL_ERR, null)) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
348 |
&& ocspError.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.OCSP_REVOKED_ERR, |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
349 |
null))); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
350 |
// UserInstallation: ocsp undefined, warning undefined, not silent mode, user prefs must, good |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
351 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_UNDEFINED, OcspSettings.OCSP_WARNING_UNDEFINED, false, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
352 |
ocspUserPreferences.setOcspMode(OcspUserPreferences.OCSP_MODE_MUST); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
353 |
ocspUserPreferences.setOcspUrl(OCSP_URL); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
354 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
355 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
356 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
357 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
358 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
359 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
78 | 360 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICuTCCAiKgAwIBAgIJAKdHK8lkGvSqMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3Mzk0M1oXDTE1MDkxOTA3Mzk0M1owRjELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk9DU1AgR09PRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRHWZYToWVP8is/TWKzRQaRc0SmPNOKdFqkjJYF2NjPmz/EABJLKps4m2BZzN2kMIBRkTuirLKjnsdSelI8itekzZBJJMPgtBvsXn+wa3fPaHa3Lqhp9oa8rr/DaCCnp/B4Id/x6HV53uA8e4qs3PeDnagvomBCQsVApWpL1tcnIow1vMEHIA5uqTOVhCKgwXnnoWfl7AWmh6Tu+SbMYALj8fGzvDhPmxIhVte9NaF462Cxf0B6EuCEEdh0xEWw4qLakWpH9QlwZnshfYFaoSYLqLp83E84Md8SkcraLZed8nDS93Gh++rEjgQSldzkf0MIvZyrmKwf+vgNU+WpvzJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEACgN//8SRGqi50c5gmqZdH0YVC7ABUpBNMP1mP9z3+qadtHOOqIKn3q34rvKzyiZEndufZAt3vUQ1s+wlaJKQTUgAm7G8K8cYYCkexJoQVdfVTyJn2ZKTOkCdfoY9k/uxu3DmHhHteU7j0mmp1LVXrvrSGLtXmpzy+kHvVeH/UMw=")); |
361 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "NL+t9rmzVP7MFfYomU0pb/daz27COxIJ4qMxToYs4oHOn8hk4vwvdm//ORJZnLmk84gfnJRufassInIkwCszsxVoPx47jTi+tqSxFF398kT8MJdFNhr/F1CDQR6vPwMdW5CsRefPGBpr2IaL8oZRfzBDgEZL0bu8PPOOrFZCJbw69SACucYvsReQ1vHJf9XPu4eGEkIZHd9If2Bj/G8rxqUGzQ/ltVhUhhLj8rqrDghRF3+UeB1UPcCd6slKHQ+EyxKU/o2iuMe3B5rmcjDaoj52KsB+gk0puizvEgKn3F15a430u4/feKpqszDvFCWd8qxbWwBDDbLC92P2rc3T8g==")); |
|
21
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
362 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
363 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
364 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
365 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
366 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
367 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
368 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
369 |
assertTrue(ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT && ocspEvent.eventError == null); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
370 |
// UserInstallation: ocsp undefined, warning undefined, not silent mode, user prefs must, unknown |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
371 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_UNDEFINED, OcspSettings.OCSP_WARNING_UNDEFINED, false, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
372 |
ocspUserPreferences.setOcspMode(OcspUserPreferences.OCSP_MODE_MUST); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
373 |
ocspUserPreferences.setOcspUrl(OCSP_URL); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
374 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
375 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
376 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
377 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
378 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
379 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
78 | 380 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICvDCCAiWgAwIBAgIJAKrSZo9qYhM/MA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTMzNVoXDTE1MDkxOTA3NTMzNVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgVU5LTk9XTiBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCaZ4VDJjntiOeNKbRd8BIkEjW/Z6k/fLzbiM5hQL/xHQC1PM1spLgnr4pf7Nf+F/bJbDq2eE1jDar6wmtJPcXFFkChl1eS5yJAyY/bhswyzbqNwTcwo1Lu64TSfC4gTdthEmUPNEhzxMcdCj6myrv8hNyhv6dhkcHvZgBwFgS4Pf1DXRmr/PPjCZxyMaoLoKzjezBXVgTC9rViN7moL715HrpO1jkIB2LRY93fzBmPa1leNdiqUqachFtkzYQuuO1MLlmHXKlNmNLOGqlreB/58q5PTPbIGOIzNiN+n0RYMkVSBVImLBQeepO2ICi/DSFW0yi70LpZvebx736P0yF1AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAGBzUyF4Cb/DN4lWY5yxd1/EI/6osAHySIgMEu5ClzyIqULc3QIvjhLrbLV/JKsVYT3h/gFZxwxoTGWdE1dApWj+Hja23TlLmo0uDDL/L3NOB/n041/gI2MQYw1Z9ME2sFzzWIli1P02JciykUQba/b0fRjPsY3ctzDS7QU2EFFs=")); |
381 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "UknTEEInZKDV9RCXnhv8W9KrXYppmRCUL/kSYXtdiiD3OmiwK0/4Nu0N8ix/Olo/IuWNLyPR+YZt6GLUQhw/AlWGd1mq8odlpiulFdB+e8ClkPvOW+3/KMvBO74ajyD2/PreEzCPYouM8YBqdpb49+TffnNQmEdaIpZ659ODppSNzMPmFpCcO6J2SoaU+KOp9uYdNab+JQfkGwrhF4F3FPYsQdPJAgS8Wt//khjQzAGFyOFIWmZ1ZwTbLxyf2QMHPrvtDWWH6h9qaR+2O9A90tF0PM2VUjznEOvBNigKwYTqBAW2j5oF6ZOQ4zyujqpQsm0pF6aPzaVjtZmfnpaCfA==")); |
|
21
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
382 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
383 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
384 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
385 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
386 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
387 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
388 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
389 |
assertTrue(ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT && (ocspEvent.eventError instanceof InstallerSecurityException)); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
390 |
ocspError = (InstallerSecurityException)ocspEvent.eventError; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
391 |
assertTrue(ocspError.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHENTICATION_FAILURE |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
392 |
&& ocspError.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.OCSP_GENERAL_ERR, null)) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
393 |
&& ocspError.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.OCSP_GENERAL_ERR, |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
394 |
null))); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
395 |
// PreInstallation: ocsp enabled, warning ignore, silent mode, revoked |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
396 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_ENABLED, OcspSettings.OCSP_WARNING_IGNORE, true, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
397 |
ocspUserPreferences.setOcspMode(-1); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
398 |
ocspUserPreferences.setOcspUrl(OCSP_URL); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
399 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
400 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
401 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
402 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
403 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
404 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
78 | 405 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICvDCCAiWgAwIBAgIJAM/3P7mVjkjRMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTcxMVoXDTE1MDkxOTA3NTcxMVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgUkVWT0tFRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGIt32Ki+UkQYc/rswY4Bho/ygLyqV8UTVob4yH4k9AQTegIkdjw+AqgfU0LcqMdXguok2PS0sdkgEDPqCMawSMsQRQMsFYcab/LL/i7haWULQL33VI8Wt9grgzFZSpeuhFgr3YgWV0iyMHpKwb4ORiJvWhhvseCK+iI4sAOIhmQZ12HLhvBla5KXTyslLUoXA7V0CuRYqkB3SXn/RARk7GHcoVM+PIk6MtPUkHlyZzqXbHeNOAxGhSEbIp6WJTG2Bg/5OmdSg/kJ44ZSKMk0K2djNTgx70s83B+/vOU81Zxo+SUGiaOC/uw9Irh51WlZl8joq3A+gefO+fPSKCJZDAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAnk5fcldVed5INUs3djxRF9BZ1+ZFdgIjclysYB6B2mSvIdnxnT9H66oKnPeyDqbwcWYfdyDwyeBgsLIk4oOF85lWs5ItjKKcViLbZDPi9J3B+Av/qCWkrkWQokJ5Tkyw8K/sBQrNTM5kH1WrapcKsplcv8FgorE7FC57Ozpli48=")); |
406 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "KXg8rbURv+eZ75Cg0+8KPgaxhhrHqyf26nLFweLWKE7rgkX6aHHfmHirpt/LGzFqQt+516bbkVhG7DLJIshb3qoZBlgzKOqjvJoYwMnVw0CaIMoYjcevortyKk8jbeFnrYU34pp8v0pz3NEKzVgnYAdEnTtl88X+TBgcVDteVUOaz2IGB4JtPKWWRhG7kaOJdYXmCRuNeExv1gHqLYNq0Mr6rmECoMpV1ksrTJK7bJeWwOHRgtVo55rb6bI2MmzE5/Eo4LWg9MKjzmHnCbBWKvFyy5RuEZu5XHAzCJlLO52rfh6dJOq5yuPyB+L87bsgehWFyj1ptq+2jESw0KXuHQ==")); |
|
21
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
407 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
408 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
409 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
410 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
411 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
412 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
413 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
414 |
assertTrue(ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT && (ocspEvent.eventError instanceof InstallerSecurityException)); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
415 |
ocspError = (InstallerSecurityException)ocspEvent.eventError; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
416 |
assertTrue(ocspError.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHENTICATION_FAILURE |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
417 |
&& ocspError.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.OCSP_GENERAL_ERR, null)) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
418 |
&& ocspError.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.OCSP_REVOKED_ERR, |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
419 |
null))); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
420 |
// PreInstallation: ocsp enabled, warning ignore, silent mode, good |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
421 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_ENABLED, OcspSettings.OCSP_WARNING_IGNORE, true, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
422 |
ocspUserPreferences.setOcspMode(-1); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
423 |
ocspUserPreferences.setOcspUrl(OCSP_URL); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
424 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
425 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
426 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
427 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
428 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
429 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
78 | 430 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICuTCCAiKgAwIBAgIJAKdHK8lkGvSqMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3Mzk0M1oXDTE1MDkxOTA3Mzk0M1owRjELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk9DU1AgR09PRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRHWZYToWVP8is/TWKzRQaRc0SmPNOKdFqkjJYF2NjPmz/EABJLKps4m2BZzN2kMIBRkTuirLKjnsdSelI8itekzZBJJMPgtBvsXn+wa3fPaHa3Lqhp9oa8rr/DaCCnp/B4Id/x6HV53uA8e4qs3PeDnagvomBCQsVApWpL1tcnIow1vMEHIA5uqTOVhCKgwXnnoWfl7AWmh6Tu+SbMYALj8fGzvDhPmxIhVte9NaF462Cxf0B6EuCEEdh0xEWw4qLakWpH9QlwZnshfYFaoSYLqLp83E84Md8SkcraLZed8nDS93Gh++rEjgQSldzkf0MIvZyrmKwf+vgNU+WpvzJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEACgN//8SRGqi50c5gmqZdH0YVC7ABUpBNMP1mP9z3+qadtHOOqIKn3q34rvKzyiZEndufZAt3vUQ1s+wlaJKQTUgAm7G8K8cYYCkexJoQVdfVTyJn2ZKTOkCdfoY9k/uxu3DmHhHteU7j0mmp1LVXrvrSGLtXmpzy+kHvVeH/UMw=")); |
431 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "NL+t9rmzVP7MFfYomU0pb/daz27COxIJ4qMxToYs4oHOn8hk4vwvdm//ORJZnLmk84gfnJRufassInIkwCszsxVoPx47jTi+tqSxFF398kT8MJdFNhr/F1CDQR6vPwMdW5CsRefPGBpr2IaL8oZRfzBDgEZL0bu8PPOOrFZCJbw69SACucYvsReQ1vHJf9XPu4eGEkIZHd9If2Bj/G8rxqUGzQ/ltVhUhhLj8rqrDghRF3+UeB1UPcCd6slKHQ+EyxKU/o2iuMe3B5rmcjDaoj52KsB+gk0puizvEgKn3F15a430u4/feKpqszDvFCWd8qxbWwBDDbLC92P2rc3T8g==")); |
|
21
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
432 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
433 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
434 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
435 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
436 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
437 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
438 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
439 |
assertTrue(ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT && ocspEvent.eventError == null); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
440 |
// PreInstallation: ocsp enabled, warning ignore, silent mode, unknown |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
441 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_ENABLED, OcspSettings.OCSP_WARNING_IGNORE, true, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
442 |
ocspUserPreferences.setOcspMode(-1); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
443 |
ocspUserPreferences.setOcspUrl(OCSP_URL); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
444 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
445 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
446 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
447 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
448 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
449 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
78 | 450 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICvDCCAiWgAwIBAgIJAKrSZo9qYhM/MA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTMzNVoXDTE1MDkxOTA3NTMzNVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgVU5LTk9XTiBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCaZ4VDJjntiOeNKbRd8BIkEjW/Z6k/fLzbiM5hQL/xHQC1PM1spLgnr4pf7Nf+F/bJbDq2eE1jDar6wmtJPcXFFkChl1eS5yJAyY/bhswyzbqNwTcwo1Lu64TSfC4gTdthEmUPNEhzxMcdCj6myrv8hNyhv6dhkcHvZgBwFgS4Pf1DXRmr/PPjCZxyMaoLoKzjezBXVgTC9rViN7moL715HrpO1jkIB2LRY93fzBmPa1leNdiqUqachFtkzYQuuO1MLlmHXKlNmNLOGqlreB/58q5PTPbIGOIzNiN+n0RYMkVSBVImLBQeepO2ICi/DSFW0yi70LpZvebx736P0yF1AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAGBzUyF4Cb/DN4lWY5yxd1/EI/6osAHySIgMEu5ClzyIqULc3QIvjhLrbLV/JKsVYT3h/gFZxwxoTGWdE1dApWj+Hja23TlLmo0uDDL/L3NOB/n041/gI2MQYw1Z9ME2sFzzWIli1P02JciykUQba/b0fRjPsY3ctzDS7QU2EFFs=")); |
451 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "UknTEEInZKDV9RCXnhv8W9KrXYppmRCUL/kSYXtdiiD3OmiwK0/4Nu0N8ix/Olo/IuWNLyPR+YZt6GLUQhw/AlWGd1mq8odlpiulFdB+e8ClkPvOW+3/KMvBO74ajyD2/PreEzCPYouM8YBqdpb49+TffnNQmEdaIpZ659ODppSNzMPmFpCcO6J2SoaU+KOp9uYdNab+JQfkGwrhF4F3FPYsQdPJAgS8Wt//khjQzAGFyOFIWmZ1ZwTbLxyf2QMHPrvtDWWH6h9qaR+2O9A90tF0PM2VUjznEOvBNigKwYTqBAW2j5oF6ZOQ4zyujqpQsm0pF6aPzaVjtZmfnpaCfA==")); |
|
21
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
452 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
453 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
454 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
455 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
456 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
457 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
458 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
459 |
assertTrue(ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT && (ocspEvent.eventError instanceof InstallerSecurityException)); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
460 |
ocspError = (InstallerSecurityException)ocspEvent.eventError; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
461 |
assertTrue(ocspError.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHENTICATION_FAILURE |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
462 |
&& ocspError.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.OCSP_GENERAL_ERR, null)) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
463 |
&& ocspError.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.OCSP_GENERAL_ERR, |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
464 |
null))); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
465 |
// PreInstallation: ocsp enabled, warning confirm, not silent mode, revoked |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
466 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_ENABLED, OcspSettings.OCSP_WARNING_CONFIRM, false, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
467 |
ocspUserPreferences.setOcspMode(-1); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
468 |
ocspUserPreferences.setOcspUrl(OCSP_URL); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
469 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
470 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
471 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
472 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
473 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
474 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
78 | 475 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICvDCCAiWgAwIBAgIJAM/3P7mVjkjRMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTcxMVoXDTE1MDkxOTA3NTcxMVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgUkVWT0tFRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGIt32Ki+UkQYc/rswY4Bho/ygLyqV8UTVob4yH4k9AQTegIkdjw+AqgfU0LcqMdXguok2PS0sdkgEDPqCMawSMsQRQMsFYcab/LL/i7haWULQL33VI8Wt9grgzFZSpeuhFgr3YgWV0iyMHpKwb4ORiJvWhhvseCK+iI4sAOIhmQZ12HLhvBla5KXTyslLUoXA7V0CuRYqkB3SXn/RARk7GHcoVM+PIk6MtPUkHlyZzqXbHeNOAxGhSEbIp6WJTG2Bg/5OmdSg/kJ44ZSKMk0K2djNTgx70s83B+/vOU81Zxo+SUGiaOC/uw9Irh51WlZl8joq3A+gefO+fPSKCJZDAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAnk5fcldVed5INUs3djxRF9BZ1+ZFdgIjclysYB6B2mSvIdnxnT9H66oKnPeyDqbwcWYfdyDwyeBgsLIk4oOF85lWs5ItjKKcViLbZDPi9J3B+Av/qCWkrkWQokJ5Tkyw8K/sBQrNTM5kH1WrapcKsplcv8FgorE7FC57Ozpli48=")); |
476 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "KXg8rbURv+eZ75Cg0+8KPgaxhhrHqyf26nLFweLWKE7rgkX6aHHfmHirpt/LGzFqQt+516bbkVhG7DLJIshb3qoZBlgzKOqjvJoYwMnVw0CaIMoYjcevortyKk8jbeFnrYU34pp8v0pz3NEKzVgnYAdEnTtl88X+TBgcVDteVUOaz2IGB4JtPKWWRhG7kaOJdYXmCRuNeExv1gHqLYNq0Mr6rmECoMpV1ksrTJK7bJeWwOHRgtVo55rb6bI2MmzE5/Eo4LWg9MKjzmHnCbBWKvFyy5RuEZu5XHAzCJlLO52rfh6dJOq5yuPyB+L87bsgehWFyj1ptq+2jESw0KXuHQ==")); |
|
21
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
477 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
478 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
479 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
480 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
481 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
482 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
483 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
484 |
assertTrue(ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT && (ocspEvent.eventError instanceof InstallerSecurityException)); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
485 |
ocspError = (InstallerSecurityException)ocspEvent.eventError; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
486 |
assertTrue(ocspError.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHENTICATION_FAILURE |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
487 |
&& ocspError.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.OCSP_GENERAL_ERR, null)) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
488 |
&& ocspError.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.OCSP_REVOKED_ERR, |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
489 |
null))); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
490 |
// PreInstallation: ocsp enabled, warning confirm, not silent mode, good |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
491 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_ENABLED, OcspSettings.OCSP_WARNING_CONFIRM, false, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
492 |
ocspUserPreferences.setOcspMode(-1); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
493 |
ocspUserPreferences.setOcspUrl(OCSP_URL); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
494 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
495 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
496 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
497 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
498 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
499 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
78 | 500 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICuTCCAiKgAwIBAgIJAKdHK8lkGvSqMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3Mzk0M1oXDTE1MDkxOTA3Mzk0M1owRjELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxFzAVBgNVBAMTDk9DU1AgR09PRCBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDRHWZYToWVP8is/TWKzRQaRc0SmPNOKdFqkjJYF2NjPmz/EABJLKps4m2BZzN2kMIBRkTuirLKjnsdSelI8itekzZBJJMPgtBvsXn+wa3fPaHa3Lqhp9oa8rr/DaCCnp/B4Id/x6HV53uA8e4qs3PeDnagvomBCQsVApWpL1tcnIow1vMEHIA5uqTOVhCKgwXnnoWfl7AWmh6Tu+SbMYALj8fGzvDhPmxIhVte9NaF462Cxf0B6EuCEEdh0xEWw4qLakWpH9QlwZnshfYFaoSYLqLp83E84Md8SkcraLZed8nDS93Gh++rEjgQSldzkf0MIvZyrmKwf+vgNU+WpvzJAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEACgN//8SRGqi50c5gmqZdH0YVC7ABUpBNMP1mP9z3+qadtHOOqIKn3q34rvKzyiZEndufZAt3vUQ1s+wlaJKQTUgAm7G8K8cYYCkexJoQVdfVTyJn2ZKTOkCdfoY9k/uxu3DmHhHteU7j0mmp1LVXrvrSGLtXmpzy+kHvVeH/UMw=")); |
501 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "NL+t9rmzVP7MFfYomU0pb/daz27COxIJ4qMxToYs4oHOn8hk4vwvdm//ORJZnLmk84gfnJRufassInIkwCszsxVoPx47jTi+tqSxFF398kT8MJdFNhr/F1CDQR6vPwMdW5CsRefPGBpr2IaL8oZRfzBDgEZL0bu8PPOOrFZCJbw69SACucYvsReQ1vHJf9XPu4eGEkIZHd9If2Bj/G8rxqUGzQ/ltVhUhhLj8rqrDghRF3+UeB1UPcCd6slKHQ+EyxKU/o2iuMe3B5rmcjDaoj52KsB+gk0puizvEgKn3F15a430u4/feKpqszDvFCWd8qxbWwBDDbLC92P2rc3T8g==")); |
|
21
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
502 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
503 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
504 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
505 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
506 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
507 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
508 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
509 |
assertTrue(ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT && ocspEvent.eventError == null); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
510 |
// PreInstallation: ocsp enabled, warning confirm, not silent mode, unknown |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
511 |
ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_ENABLED, OcspSettings.OCSP_WARNING_CONFIRM, false, "0", "0"); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
512 |
ocspUserPreferences.setOcspMode(-1); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
513 |
ocspUserPreferences.setOcspUrl(OCSP_URL); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
514 |
authenticationModule.setOCSPFlags(ocspSettings); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
515 |
storage.removeAuthenticationStorageData(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
516 |
oscpEventListener.reset(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
517 |
authenticationModule.registerOcspEventListener(appUID, oscpEventListener); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
518 |
allAttributes.clear(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
519 |
allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
78 | 520 |
allAttributes.put(AuthenticationAttribute.MAIN_ATTRIBUTE_PREFIX + "1-1", new Attribute("", "MIICvDCCAiWgAwIBAgIJAKrSZo9qYhM/MA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAmZpMRIwEAYDVQQIEwlQaXJrYW5tYWExEDAOBgNVBAcTB1RhbXBlcmUxDjAMBgNVBAoTBU5va2lhMQ0wCwYDVQQLEwRKYXZhMR8wHQYDVQQDDBZKUF9UaGlyZF9QYXJ0eV9UcnVzdGVkMB4XDTEwMDkyMDA3NTMzNVoXDTE1MDkxOTA3NTMzNVowSTELMAkGA1UEBhMCRkkxEDAOBgNVBAcTB1RhbXBlcmUxGjAYBgNVBAMTEU9DU1AgVU5LTk9XTiBDZXJ0MQwwCgYDVQQKEwNPcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCaZ4VDJjntiOeNKbRd8BIkEjW/Z6k/fLzbiM5hQL/xHQC1PM1spLgnr4pf7Nf+F/bJbDq2eE1jDar6wmtJPcXFFkChl1eS5yJAyY/bhswyzbqNwTcwo1Lu64TSfC4gTdthEmUPNEhzxMcdCj6myrv8hNyhv6dhkcHvZgBwFgS4Pf1DXRmr/PPjCZxyMaoLoKzjezBXVgTC9rViN7moL715HrpO1jkIB2LRY93fzBmPa1leNdiqUqachFtkzYQuuO1MLlmHXKlNmNLOGqlreB/58q5PTPbIGOIzNiN+n0RYMkVSBVImLBQeepO2ICi/DSFW0yi70LpZvebx736P0yF1AgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAGBzUyF4Cb/DN4lWY5yxd1/EI/6osAHySIgMEu5ClzyIqULc3QIvjhLrbLV/JKsVYT3h/gFZxwxoTGWdE1dApWj+Hja23TlLmo0uDDL/L3NOB/n041/gI2MQYw1Z9ME2sFzzWIli1P02JciykUQba/b0fRjPsY3ctzDS7QU2EFFs=")); |
521 |
allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", "UknTEEInZKDV9RCXnhv8W9KrXYppmRCUL/kSYXtdiiD3OmiwK0/4Nu0N8ix/Olo/IuWNLyPR+YZt6GLUQhw/AlWGd1mq8odlpiulFdB+e8ClkPvOW+3/KMvBO74ajyD2/PreEzCPYouM8YBqdpb49+TffnNQmEdaIpZ659ODppSNzMPmFpCcO6J2SoaU+KOp9uYdNab+JQfkGwrhF4F3FPYsQdPJAgS8Wt//khjQzAGFyOFIWmZ1ZwTbLxyf2QMHPrvtDWWH6h9qaR+2O9A90tF0PM2VUjznEOvBNigKwYTqBAW2j5oF6ZOQ4zyujqpQsm0pF6aPzaVjtZmfnpaCfA==")); |
|
21
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
522 |
securityAttributes = new SecurityAttributes(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
523 |
securityAttributes.addDescriptorAttributes(allAttributes); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
524 |
authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
525 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
526 |
sucess = (ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_START_EVENT); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
527 |
ocspEvent = oscpEventListener.getEvent(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
528 |
authenticationModule.unregisterOcspEventListener(appUID); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
529 |
assertTrue(ocspEvent != null && ocspEvent.eventId == OcspEventListener.OCSP_FINISH_EVENT && (ocspEvent.eventError instanceof InstallerSecurityException)); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
530 |
ocspError = (InstallerSecurityException)ocspEvent.eventError; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
531 |
assertTrue(ocspError.getOtaStatusCode() == OtaStatusCode.APPLICATION_AUTHENTICATION_FAILURE |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
532 |
&& ocspError.getShortMessage().equals(securityErrorMessage.get(SecurityErrorMessage.OCSP_GENERAL_ERR, null)) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
533 |
&& ocspError.getDetailedMessage().equals(securityDetailedErrorMessage.get(SecurityDetailedErrorMessage.OCSP_GENERAL_ERR, |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
534 |
null))); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
535 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
536 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
537 |
public static void showGuidelines(String guidelines) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
538 |
{ |
78 | 539 |
System.setProperty("com.nokia.mj.impl.rt.ui", "com.nokia.mj.impl.rt.ui.avkon.RuntimeUiAvkon"); |
540 |
try |
|
541 |
{ |
|
542 |
Class.forName("com.nokia.mj.impl.rt.ui.qt.RuntimeUiQt"); |
|
543 |
System.setProperty("com.nokia.mj.impl.rt.ui", "com.nokia.mj.impl.rt.ui.qt.RuntimeUiQt"); |
|
544 |
}catch(Throwable t) |
|
545 |
{ |
|
546 |
} |
|
21
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
547 |
RuntimeUi ui = RuntimeUiFactory.getRuntimeUi( |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
548 |
true /* aIdentified */); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
549 |
ConfirmData cData = new ConfirmData( |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
550 |
guidelines, |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
551 |
null /*answerOptions*/, |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
552 |
0 /* highlight always the first option */); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
553 |
ui.confirm("Test guidance",cData); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
554 |
ui.destroy(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
555 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
556 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
557 |
class OcspCancelThread extends Thread |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
558 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
559 |
OcspCancelThread(Uid msUid, Monitor ocspCancelMonitor) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
560 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
561 |
this.msUid = msUid; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
562 |
this.ocspCancelMonitor = ocspCancelMonitor; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
563 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
564 |
public void run() |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
565 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
566 |
authenticationModule.cancelOcspCheck(msUid); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
567 |
ocspCancelMonitor.notifyMonitor(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
568 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
569 |
private Uid msUid; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
570 |
private Monitor ocspCancelMonitor; |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
571 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
572 |
|
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
573 |
private void cancelOcsp(Uid msUid) |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
574 |
{ |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
575 |
Monitor ocspCancelMonitor = new Monitor(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
576 |
OcspCancelThread t = new OcspCancelThread(msUid, ocspCancelMonitor); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
577 |
t.start(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
578 |
// wait for the thread to finish |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
579 |
ocspCancelMonitor.waitOnMonitor(); |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
580 |
} |
2a9601315dfc
Revision: v2.1.22
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
581 |
} |