void foo(X509Certificate[] a, String unused) {
if( a != null && a.length == 1) a[0].checkValidity();
while(true){
return;
/* never executed stuff */
foo(a, unused);
}
}
X509Certificate.checkValidity()'s javadoc:
http://docs.oracle.com/javase/1.5.0/docs/api/javax/security/...Selections from above link:
Checks that the certificate is currently valid. It is if the current date and time are within the validity period given in the certificate.
Throws:
CertificateExpiredException - if the certificate has expired.
CertificateNotYetValidException - if the certificate is not yet valid.
There has got to be more to their code than this. It does nothing useful except make sure a random certificate is not expired. If there is no certificate, it doesn't fail or return false or anything. What is this!?Could this be a profiler-optimized set of code that really had a LOT more code to it? But then why would the bit of random junk after the return statement exist? Did no one do a proper code-review of this???
[edit: I used JavaSE 1.5 above; but I just checked Android's version and it looks to be the same, just less verbage in the docs.]