From: Felix Dörre Date: Fri, 26 Sep 2014 15:44:13 +0000 (+0200) Subject: UPD: add another check for the certprofile. X-Git-Url: https://code.wpia.club/?p=gigi.git;a=commitdiff_plain;h=a9a62c51d7042f32585ac362e980a0bbd7e34eb0;hp=90771b77a6e7cd00bce47feeb35786f0371b89bd UPD: add another check for the certprofile. In some situations double checking is better. --- diff --git a/src/org/cacert/gigi/dbObjects/Certificate.java b/src/org/cacert/gigi/dbObjects/Certificate.java index 991310ad..0c63c2cd 100644 --- a/src/org/cacert/gigi/dbObjects/Certificate.java +++ b/src/org/cacert/gigi/dbObjects/Certificate.java @@ -128,7 +128,10 @@ public class Certificate { private CertificateProfile profile; - public Certificate(User owner, String dn, String md, String csr, CSRType csrType, CertificateProfile profile, SubjectAlternateName... sans) { + public Certificate(User owner, String dn, String md, String csr, CSRType csrType, CertificateProfile profile, SubjectAlternateName... sans) throws GigiApiException { + if ( !owner.canIssue(profile)) { + throw new GigiApiException("You are not allowed to issue these certificates."); + } this.owner = owner; this.dn = dn; this.md = md;