Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next Range Calculation error Dogtag 10 5 branch #4842

Open
wants to merge 2 commits into
base: DOGTAG_10_5_BRANCH
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ public void setNextMinSerialConfig(int repo, String serial)
* @param repo repo identifier
* @return start of next range
*/
public String getNextRange(int repo) {
public String getNextRange(int repo, int mRadix) {
LDAPConnection conn = null;
String nextRange = null;
try {
Expand All @@ -414,9 +414,9 @@ public String getNextRange(int repo) {
}
nextRange = (String) attr.getStringValues().nextElement();

BigInteger nextRangeNo = new BigInteger(nextRange);
BigInteger incrementNo = new BigInteger(h.get(PROP_INCREMENT));
String newNextRange = nextRangeNo.add(incrementNo).toString();
BigInteger nextRangeNo = new BigInteger(nextRange, mRadix);
BigInteger incrementNo = new BigInteger(h.get(PROP_INCREMENT), mRadix);
String newNextRange = nextRangeNo.add(incrementNo).toString(mRadix);

// To make sure attrNextRange always increments, first delete the current value and then
// increment. Two operations in the same transaction
Expand All @@ -430,7 +430,7 @@ public String getNextRange(int repo) {
conn.modify(dn, mods);

// Add new range object
String endRange = nextRangeNo.add(incrementNo).subtract(BigInteger.ONE).toString();
String endRange = nextRangeNo.add(incrementNo).subtract(BigInteger.ONE).toString(mRadix);
LDAPAttributeSet attrs = new LDAPAttributeSet();
attrs.add(new LDAPAttribute("objectClass", "top"));
attrs.add(new LDAPAttribute("objectClass", "pkiRange"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ public void checkRanges() throws EBaseException {

if ((numsAvail.compareTo(mLowWaterMarkNo) < 0) && (!CMS.isPreOpMode())) {
CMS.debug("Repository: Requesting next range");
String nextRange = mDB.getNextRange(mRepo);
String nextRange = mDB.getNextRange(mRepo, mRadix);
CMS.debug("Repository: next range: " + nextRange);

mNextMinSerialNo = new BigInteger(nextRange, mRadix);
Expand Down