summaryrefslogtreecommitdiffstats
path: root/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileReviewServlet.java
diff options
context:
space:
mode:
authorawnuk <awnuk@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2009-06-12 20:05:42 +0000
committerawnuk <awnuk@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2009-06-12 20:05:42 +0000
commite4852c11aa10773425abef5327735f7f3339ac0e (patch)
treeb6efb94afa4a818e1048eaa43ade27808b350720 /pki/base/common/src/com/netscape/cms/servlet/profile/ProfileReviewServlet.java
parentd6b98f654e660b43607d5605b4682a21c837e9a2 (diff)
downloadpki-e4852c11aa10773425abef5327735f7f3339ac0e.tar.gz
pki-e4852c11aa10773425abef5327735f7f3339ac0e.tar.xz
pki-e4852c11aa10773425abef5327735f7f3339ac0e.zip
Bugzilla bug #502694.
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@599 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
Diffstat (limited to 'pki/base/common/src/com/netscape/cms/servlet/profile/ProfileReviewServlet.java')
-rw-r--r--pki/base/common/src/com/netscape/cms/servlet/profile/ProfileReviewServlet.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileReviewServlet.java b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileReviewServlet.java
index 50ca8ba2d..a3fb0d321 100644
--- a/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileReviewServlet.java
+++ b/pki/base/common/src/com/netscape/cms/servlet/profile/ProfileReviewServlet.java
@@ -33,6 +33,7 @@ import com.netscape.certsrv.profile.*;
import com.netscape.certsrv.authentication.*;
import com.netscape.certsrv.authorization.*;
import com.netscape.certsrv.logging.*;
+import com.netscape.certsrv.ca.*;
import com.netscape.cms.servlet.common.*;
@@ -46,6 +47,8 @@ public class ProfileReviewServlet extends ProfileServlet {
private static final String PROP_AUTHORITY_ID = "authorityId";
private String mAuthorityId = null;
+ private Random mRandom = null;
+ private Nonces mNonces = null;
public ProfileReviewServlet() {
}
@@ -59,6 +62,15 @@ public class ProfileReviewServlet extends ProfileServlet {
public void init(ServletConfig sc) throws ServletException {
super.init(sc);
mAuthorityId = sc.getInitParameter(PROP_AUTHORITY_ID);
+
+ ICertificateAuthority authority = null;
+ if (mAuthorityId != null)
+ authority = (ICertificateAuthority) CMS.getSubsystem(mAuthorityId);
+
+ if (authority != null && authority.noncesEnabled()) {
+ mNonces = authority.getNonces();
+ mRandom = new Random();
+ }
}
/**
@@ -220,6 +232,15 @@ public class ProfileReviewServlet extends ProfileServlet {
count++;
}
}
+
+ if (mNonces != null) {
+ long n = mRandom.nextLong();
+ long m = mNonces.addNonce(n, getSSLClientCertificate(request));
+ if ((n + m) != 0) {
+ args.set(ARG_REQUEST_NONCE, Long.toString(m));
+ }
+ }
+
args.set(ARG_REQUEST_ID, req.getRequestId().toString());
args.set(ARG_REQUEST_TYPE, req.getRequestType());
args.set(ARG_REQUEST_STATUS, req.getRequestStatus().toString());