From a5affcff77428d882dacb272fed73845ff0b0445 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Fri, 29 May 2015 16:20:13 -0700 Subject: Signature2Test: calling verify a second time can throw The docs for Signature don't guarantee that the implementation will not throw. It is perfectly fine to throw here. The original bug for which this check was added is bogus (re: https://code.google.com/p/android/issues/detail?id=34933) in that the RI behavior is clearly not the same as this test indicates with the StandardNames.IS_RI branch. (cherry picked from commit fb8371585860dd8f2321f47c490c1a622f5158ce) Bug: 18869265 Change-Id: I6e413cac85daf5b14bc20adc2279741ab11d97f6 --- .../security/tests/java/security/Signature2Test.java | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'luni/src') diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Signature2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Signature2Test.java index ad084e1..22e6795 100644 --- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Signature2Test.java +++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Signature2Test.java @@ -478,17 +478,10 @@ public class Signature2Test extends junit.framework.TestCase { } catch (IllegalArgumentException expected) { } - if (StandardNames.IS_RI) { - try { - sig.verify(signature, signature.length, 0); - fail(); - } catch (SignatureException expected) { - } - } else { - // Calling Signature.verify a second time should not throw - // http://code.google.com/p/android/issues/detail?id=34933 - boolean verified = sig.verify(signature, signature.length, 0); - assertFalse(verified); + try { + sig.verify(signature, signature.length, 0); + fail(); + } catch (SignatureException expected) { } try { -- cgit v1.1