X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2FdbObjects%2FCertificateProfile.java;h=afcc019c417b172308d5092921df3e020e7879c5;hb=3238dff5b3beca228359b370bc104f48d6247632;hp=c31f6cbfa3449dbaebb4ceb2e7f2564765da2640;hpb=d21c39f52385389984da44fd55d85d7f86a2d5c4;p=gigi.git diff --git a/src/org/cacert/gigi/dbObjects/CertificateProfile.java b/src/org/cacert/gigi/dbObjects/CertificateProfile.java index c31f6cbf..afcc019c 100644 --- a/src/org/cacert/gigi/dbObjects/CertificateProfile.java +++ b/src/org/cacert/gigi/dbObjects/CertificateProfile.java @@ -180,7 +180,13 @@ public class CertificateProfile implements IdCachable { final HashMap myName = new HashMap(); final HashMap myId = new HashMap(); - for (File f : new File("config/profiles").listFiles()) { + File profiledir = new File("config/profiles"); + File[] profilelist = profiledir.listFiles(); + if (null == profilelist) { + throw new Error("Unable to list available profiles from " + profiledir.getName()); + } + + for (File f : profilelist) { Properties p = new Properties(); try (FileInputStream inStream = new FileInputStream(f)) { p.load(inStream); @@ -263,6 +269,14 @@ public class CertificateProfile implements IdCachable { if ( !actor.isInGroup(Group.CODESIGNING)) { return false; } + } else if (s.equals("ocsp")) { + if ( !(owner instanceof Organisation)) { + return false; + } + Organisation o = (Organisation) owner; + if ( !o.isSelfOrganisation()) { + return false; + } } else { return false; }