diff options
author | Kenny Root <kroot@google.com> | 2015-05-29 16:20:13 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2015-05-29 19:52:37 -0700 |
commit | a5affcff77428d882dacb272fed73845ff0b0445 (patch) | |
tree | 4e610ddc08169e407915f2df0003248f6b1dfdda /luni/src | |
parent | eaf9bc046bc7506d9be6afc4f6f8e5e8d3f66c3b (diff) | |
download | libcore-a5affcff77428d882dacb272fed73845ff0b0445.zip libcore-a5affcff77428d882dacb272fed73845ff0b0445.tar.gz libcore-a5affcff77428d882dacb272fed73845ff0b0445.tar.bz2 |
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
Diffstat (limited to 'luni/src')
-rw-r--r-- | luni/src/test/java/org/apache/harmony/security/tests/java/security/Signature2Test.java | 15 |
1 files changed, 4 insertions, 11 deletions
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 { |