X-Git-Url: https://code.wpia.club/?a=blobdiff_plain;f=src%2Forg%2Fcacert%2Fgigi%2FdbObjects%2FCertificateProfile.java;h=afcc019c417b172308d5092921df3e020e7879c5;hb=9531b0af1a9545017db7d5a4ba6ae65f6a9cfcdb;hp=6f57b3ec0a7d1a848841e60b1c099d425ef50552;hpb=a0232b6e40e7e09767f0444d24e18bf12dafc362;p=gigi.git diff --git a/src/org/cacert/gigi/dbObjects/CertificateProfile.java b/src/org/cacert/gigi/dbObjects/CertificateProfile.java index 6f57b3ec..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); @@ -260,7 +266,15 @@ public class CertificateProfile implements IdCachable { return false; } } else if (s.equals("codesign")) { - if (actor.isInGroup(Group.CODESIGNING)) { + 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 {