Skip to content

Commit 6d7e791

Browse files
committed
Only run the x509 serialization check on devices >= kitkat
1 parent 41c2117 commit 6d7e791

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

app/src/main/java/fuzion24/device/vulnerability/vulnerabilities/framework/serialization/OpenSSLTransientBug.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package fuzion24.device.vulnerability.vulnerabilities.framework.serialization;
22
import android.content.Context;
3+
import android.os.Build;
34
import android.util.Log;
45

56
import com.android.org.conscrypt.ZpenSSLX509Certificate;
@@ -74,6 +75,19 @@ public List<CPUArch> getSupportedArchitectures() {
7475
@Override
7576
public boolean isVulnerable(Context context) throws Exception {
7677

78+
/*
79+
AOSP switched from bouncy castle to conscrypt in 4.4
80+
This can be validated by looking at the preloaded classes:
81+
https://github.com/android/platform_frameworks_base/blob/jb-mr2-release/preloaded-classes
82+
https://github.com/android/platform_frameworks_base/blob/kitkat-release/preloaded-classes
83+
Notice that conscrypt classes exist in KitKat 4.4 SDK 19
84+
but not in Jellybean 4.3 MR SDK 18
85+
*/
86+
87+
if(Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT){
88+
return false;
89+
}
90+
7791
Class openSSLX509CertificateClass = Class.forName("com.android.org.conscrypt.OpenSSLX509Certificate");
7892

7993
ObjectStreamClass clDesc = ObjectStreamClass.lookup(openSSLX509CertificateClass);

0 commit comments

Comments
 (0)