Skip to content

Commit

Permalink
Fix EKU decoding
Browse files Browse the repository at this point in the history
OIDMap was not correctly mapping EKU when decoding a certificate to an
X509CertImpl object because the name should include the full
path from the Root element
  • Loading branch information
fmarco76 committed May 22, 2024
1 parent 945cb06 commit b2dd53a
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public class OIDMap {
*/
@Deprecated(since = "5.6.0", forRemoval = true)
public static final String EXT_KEY_USAGE_NAME = "ExtendedKeyUsageExtension";
private static final String EXT_KEY_USAGE = ROOT + "." + ExtendedKeyUsageExtension.NAME;
/**
* @deprecated This will be removed to avoid duplications
*/
Expand All @@ -120,7 +121,6 @@ public class OIDMap {
loadNames();
loadClasses();
addClass(CRLDistributionPointsExtension.class);
addClass(ExtendedKeyUsageExtension.class);
addClass(OCSPNoCheckExtension.class);
addClass(InhibitAnyPolicyExtension.class);
}
Expand All @@ -143,6 +143,7 @@ private static void loadNamesDefault(Properties props) {
props.put(CERT_POLICIES, "2.5.29.32");
props.put(AUTH_KEY_IDENTIFIER, "2.5.29.35");
props.put(SUBJ_DIR_ATTR, "2.5.29.9");
props.put(EXT_KEY_USAGE, "2.5.29.37");
}

// Load the default name to class map (EXTENSIONS_CLASSES)
Expand All @@ -165,6 +166,7 @@ private static void loadClassDefault(Properties props) {
props.put(SUBJ_DIR_ATTR, SubjectDirAttributesExtension.class.getName());
props.put(CRL_NUMBER, CRLNumberExtension.class.getName());
props.put(CRL_REASON, CRLReasonExtension.class.getName());
props.put(EXT_KEY_USAGE, ExtendedKeyUsageExtension.class.getName());
}

// Return the file along with location
Expand Down

0 comments on commit b2dd53a

Please sign in to comment.