177 authenticationModule.removeSecurityData(session, appUID); |
177 authenticationModule.removeSecurityData(session, appUID); |
178 // 2. unsigned, install from JAR which does not exist |
178 // 2. unsigned, install from JAR which does not exist |
179 authenticationModule.removeSecurityData(session, appUID); |
179 authenticationModule.removeSecurityData(session, appUID); |
180 try |
180 try |
181 { |
181 { |
182 authenticationModule.authenticateJar(session, appUID,null,"somethingWhichDoesNotExist", false); |
182 authenticationModule.authenticateJar(appUID,null,"somethingWhichDoesNotExist", false); |
|
183 authenticationModule.addSecurityData(session, appUID, null); |
183 assertTrue(false); |
184 assertTrue(false); |
184 } |
185 } |
185 catch (InstallerSecurityException e) |
186 catch (InstallerSecurityException e) |
186 { |
187 { |
187 assertTrue("", |
188 assertTrue("", |
191 new String[] {"Could not compute hash for somethingWhichDoesNotExist"}))); |
192 new String[] {"Could not compute hash for somethingWhichDoesNotExist"}))); |
192 } |
193 } |
193 authenticationModule.removeSecurityData(session, appUID); |
194 authenticationModule.removeSecurityData(session, appUID); |
194 // 3. unsigned, install from JAR |
195 // 3. unsigned, install from JAR |
195 authenticationModule.removeSecurityData(session, appUID); |
196 authenticationModule.removeSecurityData(session, appUID); |
196 authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
197 authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
198 authenticationModule.addSecurityData(session, appUID, null); |
197 assertTrue(authenticationModule.getProtectionDomainCategory(session, appUID).equals(ApplicationInfo.UNIDENTIFIED_THIRD_PARTY_DOMAIN) |
199 assertTrue(authenticationModule.getProtectionDomainCategory(session, appUID).equals(ApplicationInfo.UNIDENTIFIED_THIRD_PARTY_DOMAIN) |
198 && authenticationModule.getCertificatesDetails(session, appUID) == null); |
200 && authenticationModule.getCertificatesDetails(session, appUID) == null); |
199 authenticationModule.removeSecurityData(session, appUID); |
201 authenticationModule.removeSecurityData(session, appUID); |
200 // 3.1. unsigned, install from JAR, no session provided to authenticateJar -> no authentication data stored to storage |
202 // 3.1. unsigned, install from JAR, no session provided to addSecurityData -> no authentication data stored to storage |
201 authenticationModule.removeSecurityData(session, appUID); |
203 authenticationModule.removeSecurityData(session, appUID); |
202 authenticationModule.authenticateJar(null, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
204 authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
205 authenticationModule.addSecurityData(null, appUID, null); |
203 StorageEntry query = new StorageEntry(); |
206 StorageEntry query = new StorageEntry(); |
204 query.addAttribute(new StorageAttribute( |
207 query.addAttribute(new StorageAttribute( |
205 StorageAttribute.ID, |
208 StorageAttribute.ID, |
206 appUID.getStringValue())); |
209 appUID.getStringValue())); |
207 query.addAttribute(new StorageAttribute( |
210 query.addAttribute(new StorageAttribute( |
229 securityAttributes = new SecurityAttributes(); |
232 securityAttributes = new SecurityAttributes(); |
230 securityAttributes.addDescriptorAttributes(allAttributes); |
233 securityAttributes.addDescriptorAttributes(allAttributes); |
231 credentials = authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
234 credentials = authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
232 assertTrue(credentials != null && credentials.length == 1 && credentials[0].getProtectionDomainName().equals("UnidentifiedThirdParty") |
235 assertTrue(credentials != null && credentials.length == 1 && credentials[0].getProtectionDomainName().equals("UnidentifiedThirdParty") |
233 && authenticationModule.getCertificatesDetails(session, appUID) == null); |
236 && authenticationModule.getCertificatesDetails(session, appUID) == null); |
234 authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
237 authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
238 authenticationModule.addSecurityData(session, appUID, null); |
235 assertTrue(authenticationModule.getProtectionDomainCategory(session, appUID).equals(ApplicationInfo.UNIDENTIFIED_THIRD_PARTY_DOMAIN)); |
239 assertTrue(authenticationModule.getProtectionDomainCategory(session, appUID).equals(ApplicationInfo.UNIDENTIFIED_THIRD_PARTY_DOMAIN)); |
236 authenticationModule.removeSecurityData(session, appUID); |
240 authenticationModule.removeSecurityData(session, appUID); |
237 // 5. upgrade of authentication storage data |
241 // 5. upgrade of authentication storage data |
238 authenticationModule.removeSecurityData(session, appUID); |
242 authenticationModule.removeSecurityData(session, appUID); |
239 storage.writeAuthenticationStorageData(appUID, new AuthenticationStorageData("UnidentifiedThirdParty", ApplicationInfo.UNIDENTIFIED_THIRD_PARTY_DOMAIN, "jarHash", "rootHash", new Vector())); |
243 storage.writeAuthenticationStorageData(appUID, new AuthenticationStorageData("UnidentifiedThirdParty", ApplicationInfo.UNIDENTIFIED_THIRD_PARTY_DOMAIN, "jarHash", "rootHash", new Vector())); |
240 authenticationModule.authenticateJar(session, appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
244 authenticationModule.authenticateJar(appUID,appUID,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
245 authenticationModule.addSecurityData(session, appUID, appUID); |
241 assertTrue(authenticationModule.getProtectionDomainCategory(session, appUID).equals(ApplicationInfo.UNIDENTIFIED_THIRD_PARTY_DOMAIN) |
246 assertTrue(authenticationModule.getProtectionDomainCategory(session, appUID).equals(ApplicationInfo.UNIDENTIFIED_THIRD_PARTY_DOMAIN) |
242 && authenticationModule.getCertificatesDetails(session, appUID) == null); |
247 && authenticationModule.getCertificatesDetails(session, appUID) == null); |
243 authenticationModule.removeSecurityData(session, appUID); |
248 authenticationModule.removeSecurityData(session, appUID); |
244 // 6. cert validation ok (2 certs succesfully validated) |
249 // 6. cert validation ok (2 certs succesfully validated) |
245 authenticationModule.removeSecurityData(session, appUID); |
250 authenticationModule.removeSecurityData(session, appUID); |
270 "kwxpKeSSWSeSW5ieWCx9ARFD6Lrwabxk5t7Aas5FFVEtr89vslY1QIexKNiytQm51PTIRnCNhl6y+tcv7V7GRskV1VMlTHwbCVjK4rqoFFrcZrO3qHvkRh6K9wnHnw5PPtBsrMbg8lWKBrGaf4TYRYFW+CukmR+06R7u5zAZaL7CMhl69bCXd78Tz1Z4N5CxVFD8vGatp66TMBk+0YhZP7Lo1yIDu2XsojVtigAoV9sm8OF5/aXmgfFb2AUmANGxlaDAieUfOAm7RXvsOZgaPN72KEqya8XQW6r1/aGF6jMmJ62qgPqJV3TtJtbFSwH1suywAk1UDltVim4b/Ucw1A==")); |
275 "kwxpKeSSWSeSW5ieWCx9ARFD6Lrwabxk5t7Aas5FFVEtr89vslY1QIexKNiytQm51PTIRnCNhl6y+tcv7V7GRskV1VMlTHwbCVjK4rqoFFrcZrO3qHvkRh6K9wnHnw5PPtBsrMbg8lWKBrGaf4TYRYFW+CukmR+06R7u5zAZaL7CMhl69bCXd78Tz1Z4N5CxVFD8vGatp66TMBk+0YhZP7Lo1yIDu2XsojVtigAoV9sm8OF5/aXmgfFb2AUmANGxlaDAieUfOAm7RXvsOZgaPN72KEqya8XQW6r1/aGF6jMmJ62qgPqJV3TtJtbFSwH1suywAk1UDltVim4b/Ucw1A==")); |
271 securityAttributes = new SecurityAttributes(); |
276 securityAttributes = new SecurityAttributes(); |
272 securityAttributes.addDescriptorAttributes(allAttributes); |
277 securityAttributes.addDescriptorAttributes(allAttributes); |
273 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
278 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
274 details = (SigningCertificate[])authenticationModule.getCertificatesDetails(session, appUID); |
279 details = (SigningCertificate[])authenticationModule.getCertificatesDetails(session, appUID); |
275 authenticationModule.authenticateJar(session, appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
280 authenticationModule.authenticateJar(appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
281 authenticationModule.addSecurityData(session, appUID, null); |
276 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
282 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
277 // this empties the cache as well |
283 // this empties the cache as well |
278 authenticationModule.removeSecurityData(session, appUID); |
284 authenticationModule.removeSecurityData(session, appUID); |
279 appPackageEntry = new StorageEntry(); |
285 appPackageEntry = new StorageEntry(); |
280 appPackageEntry.addAttribute(new StorageAttribute( |
286 appPackageEntry.addAttribute(new StorageAttribute( |
357 securityAttributes = new SecurityAttributes(); |
363 securityAttributes = new SecurityAttributes(); |
358 securityAttributes.addDescriptorAttributes(allAttributes); |
364 securityAttributes.addDescriptorAttributes(allAttributes); |
359 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
365 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
360 try |
366 try |
361 { |
367 { |
362 authenticationModule.authenticateJar(session, appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "modified_app.jar", false); |
368 authenticationModule.authenticateJar(appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "modified_app.jar", false); |
|
369 authenticationModule.addSecurityData(session, appUID, null); |
363 assertTrue(INVALID_CERTIFICATE_SIGNATURE_MSG, false); |
370 assertTrue(INVALID_CERTIFICATE_SIGNATURE_MSG, false); |
364 } |
371 } |
365 catch (InstallerSecurityException e) |
372 catch (InstallerSecurityException e) |
366 { |
373 { |
367 assertTrue(INVALID_CERTIFICATE_SIGNATURE_MSG + e.getOtaStatusCode() + " " + e.getShortMessage() + "," + e.getDetailedMessage(), |
374 assertTrue(INVALID_CERTIFICATE_SIGNATURE_MSG + e.getOtaStatusCode() + " " + e.getShortMessage() + "," + e.getDetailedMessage(), |
550 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
557 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
551 "otIHquw4orxOi5bhejtnZGdWPHyJW+EQPhTgqoGFqQt8zNhAl1MNbBxZCaXBu84IWChcMbTj3ziogyUDeW+CmnP5T85z18/A0GanqAXYj7otaYiba/Si2CiHYQdEBvGgjATuDuVr9wsv/1qWGqmmnPo6+1OqulM38etWnB2/zGQ=")); |
558 "otIHquw4orxOi5bhejtnZGdWPHyJW+EQPhTgqoGFqQt8zNhAl1MNbBxZCaXBu84IWChcMbTj3ziogyUDeW+CmnP5T85z18/A0GanqAXYj7otaYiba/Si2CiHYQdEBvGgjATuDuVr9wsv/1qWGqmmnPo6+1OqulM38etWnB2/zGQ=")); |
552 securityAttributes = new SecurityAttributes(); |
559 securityAttributes = new SecurityAttributes(); |
553 securityAttributes.addDescriptorAttributes(allAttributes); |
560 securityAttributes.addDescriptorAttributes(allAttributes); |
554 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
561 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
555 authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
562 authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
563 authenticationModule.addSecurityData(session, appUID, null); |
556 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
564 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
557 assertTrue(domainCategory.equals(ApplicationInfo.IDENTIFIED_THIRD_PARTY_DOMAIN)); |
565 assertTrue(domainCategory.equals(ApplicationInfo.IDENTIFIED_THIRD_PARTY_DOMAIN)); |
558 // 17. Developer Certificates/Manufacturer - sign to operator party domain |
566 // 17. Developer Certificates/Manufacturer - sign to operator party domain |
559 authenticationModule.removeSecurityData(session, appUID); |
567 authenticationModule.removeSecurityData(session, appUID); |
560 allAttributes.clear(); |
568 allAttributes.clear(); |
564 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
572 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
565 "wXTAM75XDaBaBV89qlb/XnR/hRtQ2y8uVJmUJg/NY0JXD0g8o9mT3M7PGJbDIjUGE1zcdqN+NmWaDQtWo7yUX1G4nn8TEnXvupNo2hWqwhTMDM3wMgs7kgbK1W/lC/OZVuM9CXmbPw+/r8eRJmCspz1ocYonYS08ZQUQ943cRt0=")); |
573 "wXTAM75XDaBaBV89qlb/XnR/hRtQ2y8uVJmUJg/NY0JXD0g8o9mT3M7PGJbDIjUGE1zcdqN+NmWaDQtWo7yUX1G4nn8TEnXvupNo2hWqwhTMDM3wMgs7kgbK1W/lC/OZVuM9CXmbPw+/r8eRJmCspz1ocYonYS08ZQUQ943cRt0=")); |
566 securityAttributes = new SecurityAttributes(); |
574 securityAttributes = new SecurityAttributes(); |
567 securityAttributes.addDescriptorAttributes(allAttributes); |
575 securityAttributes.addDescriptorAttributes(allAttributes); |
568 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
576 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
569 authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
577 authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
578 authenticationModule.addSecurityData(session, appUID, null); |
570 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
579 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
571 assertTrue(domainCategory.equals(ApplicationInfo.OPERATOR_DOMAIN)); |
580 assertTrue(domainCategory.equals(ApplicationInfo.OPERATOR_DOMAIN)); |
572 // 18. Developer Certificates/Manufacturer - sign to manufacturer domain |
581 // 18. Developer Certificates/Manufacturer - sign to manufacturer domain |
573 authenticationModule.removeSecurityData(session, appUID); |
582 authenticationModule.removeSecurityData(session, appUID); |
574 allAttributes.clear(); |
583 allAttributes.clear(); |
578 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
587 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
579 "1ggIHsuOMDD+GeLcwZr3W3EnY9HD9g68WH7qe6fXLsCicGc+mEB3jqmvxIsMgv8zvv+fdAQsgQfXDqNWQ5EJ5pf5SKXIowpilwQu9Tvk2iRaqDXqAZIqp0en1ST4CZOEC1xEdBcXBBAaAMvAG2EJQtCeMtkdU27UfpFbdWy1eu4=")); |
588 "1ggIHsuOMDD+GeLcwZr3W3EnY9HD9g68WH7qe6fXLsCicGc+mEB3jqmvxIsMgv8zvv+fdAQsgQfXDqNWQ5EJ5pf5SKXIowpilwQu9Tvk2iRaqDXqAZIqp0en1ST4CZOEC1xEdBcXBBAaAMvAG2EJQtCeMtkdU27UfpFbdWy1eu4=")); |
580 securityAttributes = new SecurityAttributes(); |
589 securityAttributes = new SecurityAttributes(); |
581 securityAttributes.addDescriptorAttributes(allAttributes); |
590 securityAttributes.addDescriptorAttributes(allAttributes); |
582 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
591 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
583 authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
592 authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
593 authenticationModule.addSecurityData(session, appUID, null); |
584 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
594 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
585 assertTrue(domainCategory.equals(ApplicationInfo.MANUFACTURER_DOMAIN)); |
595 assertTrue(domainCategory.equals(ApplicationInfo.MANUFACTURER_DOMAIN)); |
586 // 19. Developer Certificates/Operator - sign to trusted third party domain |
596 // 19. Developer Certificates/Operator - sign to trusted third party domain |
587 authenticationModule.removeSecurityData(session, appUID); |
597 authenticationModule.removeSecurityData(session, appUID); |
588 allAttributes.clear(); |
598 allAttributes.clear(); |
592 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
602 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
593 "mQ5yJoXJK1Uc4KXGm8Gue+Yi8LzzFEaRSfYyUiZSROXzapVTHpfnCYJKvG1cQOv/aZ9gDQ8LQoBLYIuZEXIK6RzzEaBCY/RcEaCviaSVq3JB/OiXglLcTZ1e+mFBvQQ0LUuPKaCW1jv4EJy3BfNL9ckeh/7dNxXc1qRSe5lZWFk=")); |
603 "mQ5yJoXJK1Uc4KXGm8Gue+Yi8LzzFEaRSfYyUiZSROXzapVTHpfnCYJKvG1cQOv/aZ9gDQ8LQoBLYIuZEXIK6RzzEaBCY/RcEaCviaSVq3JB/OiXglLcTZ1e+mFBvQQ0LUuPKaCW1jv4EJy3BfNL9ckeh/7dNxXc1qRSe5lZWFk=")); |
594 securityAttributes = new SecurityAttributes(); |
604 securityAttributes = new SecurityAttributes(); |
595 securityAttributes.addDescriptorAttributes(allAttributes); |
605 securityAttributes.addDescriptorAttributes(allAttributes); |
596 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
606 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
597 authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
607 authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
608 authenticationModule.addSecurityData(session, appUID, null); |
598 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
609 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
599 assertTrue(domainCategory.equals(ApplicationInfo.IDENTIFIED_THIRD_PARTY_DOMAIN)); |
610 assertTrue(domainCategory.equals(ApplicationInfo.IDENTIFIED_THIRD_PARTY_DOMAIN)); |
600 // 20. Developer Certificates/Operator - sign to operator party domain |
611 // 20. Developer Certificates/Operator - sign to operator party domain |
601 authenticationModule.removeSecurityData(session, appUID); |
612 authenticationModule.removeSecurityData(session, appUID); |
602 allAttributes.clear(); |
613 allAttributes.clear(); |
606 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
617 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
607 "oTIYybIjUD9bop+tDyOkVKP6kUKnAYi1JTI561Atrm6jhobZlQyBksNv8hI76xs1VOU8wnY0EYozhAnMR0WzC9QLGihJE0l5npLyvBi/0Q4CuFIpLg+2xpbBQ4vF3s7rDknimPVzd3VIsxo5mz7qGVeGCDfoxf85W+qMrY9lsy4=")); |
618 "oTIYybIjUD9bop+tDyOkVKP6kUKnAYi1JTI561Atrm6jhobZlQyBksNv8hI76xs1VOU8wnY0EYozhAnMR0WzC9QLGihJE0l5npLyvBi/0Q4CuFIpLg+2xpbBQ4vF3s7rDknimPVzd3VIsxo5mz7qGVeGCDfoxf85W+qMrY9lsy4=")); |
608 securityAttributes = new SecurityAttributes(); |
619 securityAttributes = new SecurityAttributes(); |
609 securityAttributes.addDescriptorAttributes(allAttributes); |
620 securityAttributes.addDescriptorAttributes(allAttributes); |
610 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
621 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
611 authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
622 authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
623 authenticationModule.addSecurityData(session, appUID, null); |
612 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
624 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
613 assertTrue(domainCategory.equals(ApplicationInfo.OPERATOR_DOMAIN)); |
625 assertTrue(domainCategory.equals(ApplicationInfo.OPERATOR_DOMAIN)); |
614 // 21. Developer Certificates/Operator - sign to manufacturer domain -> still the operator domain is used |
626 // 21. Developer Certificates/Operator - sign to manufacturer domain -> still the operator domain is used |
615 authenticationModule.removeSecurityData(session, appUID); |
627 authenticationModule.removeSecurityData(session, appUID); |
616 allAttributes.clear(); |
628 allAttributes.clear(); |
620 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
632 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
621 "lLOY+UtDU4Edj2S8T3ERkDnwJvBDJgh6Y6ah/hTL6/njyWnnGUCXdu3UN2jayqP0xTNQvM5Xv0zc5lv0mpdwzpT+17xDG6t0xSu2QvI+xRgIqzS9ncxaSF9oa4aIFe8IE3kf2+LW+jRleKplC3d0rzOmOHJLCZspRr1Zrs2238M=")); |
633 "lLOY+UtDU4Edj2S8T3ERkDnwJvBDJgh6Y6ah/hTL6/njyWnnGUCXdu3UN2jayqP0xTNQvM5Xv0zc5lv0mpdwzpT+17xDG6t0xSu2QvI+xRgIqzS9ncxaSF9oa4aIFe8IE3kf2+LW+jRleKplC3d0rzOmOHJLCZspRr1Zrs2238M=")); |
622 securityAttributes = new SecurityAttributes(); |
634 securityAttributes = new SecurityAttributes(); |
623 securityAttributes.addDescriptorAttributes(allAttributes); |
635 securityAttributes.addDescriptorAttributes(allAttributes); |
624 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
636 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
625 authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
637 authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
638 authenticationModule.addSecurityData(session, appUID, null); |
626 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
639 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
627 assertTrue(domainCategory.equals(ApplicationInfo.OPERATOR_DOMAIN)); |
640 assertTrue(domainCategory.equals(ApplicationInfo.OPERATOR_DOMAIN)); |
628 // 22. Developer Certificates/TrustedThirdParty - sign to manufacturer domain -> still the trusted third party domain is used |
641 // 22. Developer Certificates/TrustedThirdParty - sign to manufacturer domain -> still the trusted third party domain is used |
629 authenticationModule.removeSecurityData(session, appUID); |
642 authenticationModule.removeSecurityData(session, appUID); |
630 allAttributes.clear(); |
643 allAttributes.clear(); |
634 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
647 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
635 "P80CAyaqrtCFH+c2vrXX1yJkwAo2NrFEboC/h5R/47W8D1dOfhUUWSkGmCSs3eQRgdgFXjIjZL/zmCQbNuZJ5mkE+o8Z3ptFNJEQCBlV9Nfh9D0YmdR81CJgSh0af7QNHJ4rlttKtTmvFEUD2Kc49g4FDXMjU+7ISp6ZbUhNk4Y=")); |
648 "P80CAyaqrtCFH+c2vrXX1yJkwAo2NrFEboC/h5R/47W8D1dOfhUUWSkGmCSs3eQRgdgFXjIjZL/zmCQbNuZJ5mkE+o8Z3ptFNJEQCBlV9Nfh9D0YmdR81CJgSh0af7QNHJ4rlttKtTmvFEUD2Kc49g4FDXMjU+7ISp6ZbUhNk4Y=")); |
636 securityAttributes = new SecurityAttributes(); |
649 securityAttributes = new SecurityAttributes(); |
637 securityAttributes.addDescriptorAttributes(allAttributes); |
650 securityAttributes.addDescriptorAttributes(allAttributes); |
638 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
651 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
639 authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
652 authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
653 authenticationModule.addSecurityData(session, appUID, null); |
640 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
654 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
641 assertTrue(domainCategory.equals(ApplicationInfo.IDENTIFIED_THIRD_PARTY_DOMAIN)); |
655 assertTrue(domainCategory.equals(ApplicationInfo.IDENTIFIED_THIRD_PARTY_DOMAIN)); |
642 // 23. Developer Certificates/TrustedThirdParty - sign to operator domain -> still the trusted third party domain is used |
656 // 23. Developer Certificates/TrustedThirdParty - sign to operator domain -> still the trusted third party domain is used |
643 authenticationModule.removeSecurityData(session, appUID); |
657 authenticationModule.removeSecurityData(session, appUID); |
644 allAttributes.clear(); |
658 allAttributes.clear(); |
648 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
662 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
649 "FVXATPVhIFWYUp7a/BcmQodZLHcuBi8L4gibaXVBFECjqIQG0TGqgzm00xw4nxCFikV+vqdCiF7qD/YJClc6DPxgcqd70QTaTouRJGMsitj0ax7CPISLcXkn22aYZREChMpm1qWegAa9OwGudln6hlFqJLqa8iyD8482NiVG2Z4=")); |
663 "FVXATPVhIFWYUp7a/BcmQodZLHcuBi8L4gibaXVBFECjqIQG0TGqgzm00xw4nxCFikV+vqdCiF7qD/YJClc6DPxgcqd70QTaTouRJGMsitj0ax7CPISLcXkn22aYZREChMpm1qWegAa9OwGudln6hlFqJLqa8iyD8482NiVG2Z4=")); |
650 securityAttributes = new SecurityAttributes(); |
664 securityAttributes = new SecurityAttributes(); |
651 securityAttributes.addDescriptorAttributes(allAttributes); |
665 securityAttributes.addDescriptorAttributes(allAttributes); |
652 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
666 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
653 authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
667 authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
668 authenticationModule.addSecurityData(session, appUID, null); |
654 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
669 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
655 assertTrue(domainCategory.equals(ApplicationInfo.IDENTIFIED_THIRD_PARTY_DOMAIN)); |
670 assertTrue(domainCategory.equals(ApplicationInfo.IDENTIFIED_THIRD_PARTY_DOMAIN)); |
656 // 24. Developer Certificates - no domain info -> fail |
671 // 24. Developer Certificates - no domain info -> fail |
657 try |
672 try |
658 { |
673 { |
685 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
700 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" ,new Attribute("", |
686 "sOpL9KbJMxvT8Cwtvlj9rLfJKSDVkWYm13rGWgU27djNP77+48d/VBN5WkUp1MW2XLmn3umA3sstFBk0YfLGOSe4N0TusvcdmQXwBovK82xJfX1yNXs23Z6eRvDFanxC85IEfKLXcuIw5tK6v0lAG94AbMaQPhB5olAamdtgzLc=")); |
701 "sOpL9KbJMxvT8Cwtvlj9rLfJKSDVkWYm13rGWgU27djNP77+48d/VBN5WkUp1MW2XLmn3umA3sstFBk0YfLGOSe4N0TusvcdmQXwBovK82xJfX1yNXs23Z6eRvDFanxC85IEfKLXcuIw5tK6v0lAG94AbMaQPhB5olAamdtgzLc=")); |
687 securityAttributes = new SecurityAttributes(); |
702 securityAttributes = new SecurityAttributes(); |
688 securityAttributes.addDescriptorAttributes(allAttributes); |
703 securityAttributes.addDescriptorAttributes(allAttributes); |
689 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
704 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
690 authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
705 authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
706 authenticationModule.addSecurityData(session, appUID, null); |
691 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
707 domainCategory = authenticationModule.getProtectionDomainCategory(session, appUID); |
692 assertTrue(domainCategory.equals(ApplicationInfo.IDENTIFIED_THIRD_PARTY_DOMAIN)); |
708 assertTrue(domainCategory.equals(ApplicationInfo.IDENTIFIED_THIRD_PARTY_DOMAIN)); |
693 // 26. Developer Certificates - empty IMEI list -> failure |
709 // 26. Developer Certificates - empty IMEI list -> failure |
694 try |
710 try |
695 { |
711 { |
805 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" , new Attribute("", |
821 allAttributes.put(AuthenticationAttribute.SECOND_ATTRIBUTE_PREFIX + "1" , new Attribute("", |
806 "kwxpKeSSWSeSW5ieWCx9ARFD6Lrwabxk5t7Aas5FFVEtr89vslY1QIexKNiytQm51PTIRnCNhl6y+tcv7V7GRskV1VMlTHwbCVjK4rqoFFrcZrO3qHvkRh6K9wnHnw5PPtBsrMbg8lWKBrGaf4TYRYFW+CukmR+06R7u5zAZaL7CMhl69bCXd78Tz1Z4N5CxVFD8vGatp66TMBk+0YhZP7Lo1yIDu2XsojVtigAoV9sm8OF5/aXmgfFb2AUmANGxlaDAieUfOAm7RXvsOZgaPN72KEqya8XQW6r1/aGF6jMmJ62qgPqJV3TtJtbFSwH1suywAk1UDltVim4b/Ucw1A==")); |
822 "kwxpKeSSWSeSW5ieWCx9ARFD6Lrwabxk5t7Aas5FFVEtr89vslY1QIexKNiytQm51PTIRnCNhl6y+tcv7V7GRskV1VMlTHwbCVjK4rqoFFrcZrO3qHvkRh6K9wnHnw5PPtBsrMbg8lWKBrGaf4TYRYFW+CukmR+06R7u5zAZaL7CMhl69bCXd78Tz1Z4N5CxVFD8vGatp66TMBk+0YhZP7Lo1yIDu2XsojVtigAoV9sm8OF5/aXmgfFb2AUmANGxlaDAieUfOAm7RXvsOZgaPN72KEqya8XQW6r1/aGF6jMmJ62qgPqJV3TtJtbFSwH1suywAk1UDltVim4b/Ucw1A==")); |
807 securityAttributes = new SecurityAttributes(); |
823 securityAttributes = new SecurityAttributes(); |
808 securityAttributes.addDescriptorAttributes(allAttributes); |
824 securityAttributes.addDescriptorAttributes(allAttributes); |
809 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
825 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
810 authenticationModule.authenticateJar(session, appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
826 authenticationModule.authenticateJar(appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
827 authenticationModule.addSecurityData(session, appUID, null); |
811 SigningInfo info = authenticationModule.getSigningInfo("appName","appVersion","appVendor"); |
828 SigningInfo info = authenticationModule.getSigningInfo("appName","appVersion","appVendor"); |
812 // app is unknown |
829 // app is unknown |
813 assertTrue(info == null); |
830 assertTrue(info == null); |
814 // make the application known |
831 // make the application known |
815 appPackageEntry = new StorageEntry(); |
832 appPackageEntry = new StorageEntry(); |
849 allAttributes.clear(); |
866 allAttributes.clear(); |
850 allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
867 allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
851 securityAttributes = new SecurityAttributes(); |
868 securityAttributes = new SecurityAttributes(); |
852 securityAttributes.addDescriptorAttributes(allAttributes); |
869 securityAttributes.addDescriptorAttributes(allAttributes); |
853 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
870 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
854 authenticationModule.authenticateJar(session, appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
871 authenticationModule.authenticateJar(appUID, null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar", false); |
|
872 authenticationModule.addSecurityData(session, appUID, null); |
855 info = authenticationModule.getSigningInfo("appName","appVersion","appVendor"); |
873 info = authenticationModule.getSigningInfo("appName","appVersion","appVendor"); |
856 assertTrue(info.getProtectionDomain() != null |
874 assertTrue(info.getProtectionDomain() != null |
857 && info.getProtectionDomain().getName() != null |
875 && info.getProtectionDomain().getName() != null |
858 && info.getProtectionDomain().getCategory() != null |
876 && info.getProtectionDomain().getCategory() != null |
859 && info.getSigningCertificate() == null |
877 && info.getSigningCertificate() == null |
956 session.remove(StorageNames.APPLICATION_PACKAGE_TABLE, appUID); |
974 session.remove(StorageNames.APPLICATION_PACKAGE_TABLE, appUID); |
957 session.remove(StorageNames.APPLICATION_PACKAGE_ATTRIBUTES_TABLE, appUID); |
975 session.remove(StorageNames.APPLICATION_PACKAGE_ATTRIBUTES_TABLE, appUID); |
958 authenticationModule.removeSecurityData(session, appUID); |
976 authenticationModule.removeSecurityData(session, appUID); |
959 try |
977 try |
960 { |
978 { |
961 authenticationModule.authenticateJar(session, appUID, null, domain, TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar"); |
979 authenticationModule.authenticateJar(appUID, null, domain, TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "app.jar"); |
|
980 authenticationModule.addSecurityData(session, appUID, null); |
962 assertTrue(!expectToFail); |
981 assertTrue(!expectToFail); |
963 } |
982 } |
964 catch (InstallerSecurityException e) |
983 catch (InstallerSecurityException e) |
965 { |
984 { |
966 assertTrue(expectToFail); |
985 assertTrue(expectToFail); |
1198 securityAttributes.addDescriptorAttributes(allAttributes); |
1217 securityAttributes.addDescriptorAttributes(allAttributes); |
1199 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
1218 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
1200 allAttributes.clear(); |
1219 allAttributes.clear(); |
1201 allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
1220 allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
1202 securityAttributes.addManifestAttributes(allAttributes); |
1221 securityAttributes.addManifestAttributes(allAttributes); |
1203 authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); |
1222 authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); |
|
1223 authenticationModule.addSecurityData(session, appUID, null); |
1204 assertTrue(true); |
1224 assertTrue(true); |
1205 // PreInstallation: ocsp disabled, warning undefined, silent mode |
1225 // PreInstallation: ocsp disabled, warning undefined, silent mode |
1206 ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_DISABLED, OcspSettings.OCSP_WARNING_UNDEFINED, true, "0", "0"); |
1226 ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_DISABLED, OcspSettings.OCSP_WARNING_UNDEFINED, true, "0", "0"); |
1207 ocspUserPreferences.setOcspMode(0); |
1227 ocspUserPreferences.setOcspMode(0); |
1208 ocspUserPreferences.setOcspUrl(null); |
1228 ocspUserPreferences.setOcspUrl(null); |
1216 securityAttributes.addDescriptorAttributes(allAttributes); |
1236 securityAttributes.addDescriptorAttributes(allAttributes); |
1217 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
1237 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
1218 allAttributes.clear(); |
1238 allAttributes.clear(); |
1219 allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
1239 allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
1220 securityAttributes.addManifestAttributes(allAttributes); |
1240 securityAttributes.addManifestAttributes(allAttributes); |
1221 authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); |
1241 authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); |
|
1242 authenticationModule.addSecurityData(session, appUID, null); |
1222 assertTrue(true); |
1243 assertTrue(true); |
1223 // PreInstallation: ocsp enabled, warning ignore, silent mode, ocsp url not set |
1244 // PreInstallation: ocsp enabled, warning ignore, silent mode, ocsp url not set |
1224 ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_ENABLED, OcspSettings.OCSP_WARNING_IGNORE, true, "0", "0"); |
1245 ocspSettings = new OcspSettings(OcspSettings.OCSP_MODE_ENABLED, OcspSettings.OCSP_WARNING_IGNORE, true, "0", "0"); |
1225 ocspUserPreferences.setOcspMode(-1); |
1246 ocspUserPreferences.setOcspMode(-1); |
1226 ocspUserPreferences.setOcspUrl(null); |
1247 ocspUserPreferences.setOcspUrl(null); |
1234 securityAttributes.addDescriptorAttributes(allAttributes); |
1255 securityAttributes.addDescriptorAttributes(allAttributes); |
1235 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
1256 authenticationModule.authenticateJad(appUID,null,securityAttributes.getAuthenticationAttributes()); |
1236 allAttributes.clear(); |
1257 allAttributes.clear(); |
1237 allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
1258 allAttributes.put(MIDP_PROFILE_ATTRIBUTE_NAME,new Attribute("",MIDP3)); |
1238 securityAttributes.addManifestAttributes(allAttributes); |
1259 securityAttributes.addManifestAttributes(allAttributes); |
1239 authenticationModule.authenticateJar(session, appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); |
1260 authenticationModule.authenticateJar(appUID,null,TEST_DATA_DIR + "security_tmp" + System.getProperty("file.separator") + "HelloWorld.jar", false); |
|
1261 authenticationModule.addSecurityData(session, appUID, null); |
1240 assertTrue(true); |
1262 assertTrue(true); |
1241 } |
1263 } |
1242 |
1264 |
1243 private boolean checkCertificateDetails(SigningCertificate[] details) |
1265 private boolean checkCertificateDetails(SigningCertificate[] details) |
1244 { |
1266 { |