[PATCH] Fix NumberFormatException for tps-cert-find when given non integer value to size and start option
by Geetika Kapoor
Hi,
I tried to fix NumberFormatException when i did tps-cert-find with
non-integer/invalid range value for size and start.I was doing testing
for tps-cert and then i came across this.I thought giving some
additional info to users inplace of numberformat.I have done similar
fix on rhel7 compile it and make a jar and test on rhel7 .I can share
that patch if needed. Below are the test result.
Before fix testing:
1. pki -h pki1.example.com -p 25080 tps-cert-find --start "gy"
NumberFormatException: For input string: "gy"
2. pki -h pki1.example.com -p 25080 tps-cert-find --size "gy"
NumberFormatException: For input string: "gy"
3. pki -p 25080 tps-cert-find --start
1789999999999999999999999999999999999999999999
NumberFormatException: For input string:
"1789999999999999999999999999999999999999999999"
After fix testing:
1. [root@pki1 ~]# pki -d /opt/rhqa_pki/certdb -c Secret123 -h
pki1.example.com -p 25080 tps-cert-find --start "gy"
Error: Enter valid integer value for size/start option
usage: tps-cert-find [FILTER] [OPTIONS...]
--help Show help options
--size <size> Page size
--start <start> Page start
--token <ID> Token ID
2. [root@pki1 ~]# pki -d /opt/rhqa_pki/certdb -c Secret123 -h
pki1.example.com -p 25080 tps-cert-find --size "hy"
Error: Enter valid integer value for size/start option
usage: tps-cert-find [FILTER] [OPTIONS...]
--help Show help options
--size <size> Page size
--start <start> Page start
--token <ID> Token ID
3. [root@pki1 ~]# pki -d /opt/rhqa_pki/certdb -c Secret123 -h
pki1.example.com -p 25080 tps-cert-find --start 1
-----------------
2 entries matched
-----------------
Cert ID: 3d.20160720042931
Serial Number: 0x3d
Subject: UID=ldapuser7,O=Token Key User
Token ID: 40906145C76224192D78
Key Type: encryption
Status: active
User ID: ldapuser7
Create Time: Wed Jul 20 04:29:31 EDT 2016
----------------------------
Number of entries returned 1
----------------------------
4. [root@pki1 ~]# pki -d /opt/rhqa_pki/certdb -c Secret123 -h
pki1.example.com -p 25080 tps-cert-find --size 1
-----------------
2 entries matched
-----------------
Cert ID: 3c.20160720042931
Serial Number: 0x3c
Subject: UID=ldapuser7,O=Token Key User
Token ID: 40906145C76224192D78
Key Type: signing
Status: active
User ID: ldapuser7
Create Time: Wed Jul 20 04:29:31 EDT 2016
----------------------------
Number of entries returned 1
----------------------------
5. [root@pki1 cert]# pki -d /opt/rhqa_pki/certdb -c Secret123 -h
pki1.example.com -p 25080 tps-cert-find --start
1789999999999999999999999999999999999999999999
Error: Enter valid integer value for size/start option
usage: tps-cert-find [FILTER] [OPTIONS...]
--help Show help options
--size <size> Page size
--start <start> Page start
--token <ID> Token ID
Thanks
Geetika
8 years, 3 months
[pki-devel][PATCH] 0077-Make-starting-CRL-Number-configurable.patch
by John Magne
Make starting CRL Number configurable.
Ticket #2406 Make starting CRL Number configurable
This simple patch provides a pkispawn config param that passes
some starting crl number value to the config process.
Here is a sample:
[CA]
pki_ca_starting_crl_number=4000
After the CA comes up the value of "crlNumber" in the db will
reflect that value of 4000.
Currently no other values are changed. We can talk about if we
need more values reset in the given case.
Also, this creates a setting in the CS.cfg
ca.crl.MasterCrl.startingCrlNumber=4000
This setting is only consulted when the crl Issuing Point record is created
for the first time.
8 years, 3 months