add some error checking for NSEC3 parameters

git-svn-id: https://svn.verisignlabs.com/jdnssec/tools/trunk@72 4cbd57fe-54e5-0310-bd9a-f30fe5ea5e6e
This commit is contained in:
David Blacka 2006-05-24 19:48:48 +00:00
parent 435acff6d0
commit c95e1296ca

View File

@ -266,6 +266,11 @@ public class SignZone
if ((optstr = cli.getOptionValue('S')) != null)
{
salt = base16.fromString(optstr);
if (salt == null && !optstr.equals("-"))
{
System.err.println("error: salt is not valid hexidecimal.");
usage();
}
}
if ((optstr = cli.getOptionValue('R')) != null)
@ -282,6 +287,11 @@ public class SignZone
if ((optstr = cli.getOptionValue("iterations")) != null)
{
iterations = parseInt(optstr, iterations);
if (iterations < 0 || iterations > 8388607)
{
System.err.println("error: iterations value is invalid");
usage();
}
}
String[] files = cli.getArgs();
@ -341,7 +351,6 @@ public class SignZone
out.flush();
System.exit(64);
}
}
/**