add original ownername comments to the NSEC3 generation
git-svn-id: https://svn.verisignlabs.com/jdnssec/tools/trunk@49 4cbd57fe-54e5-0310-bd9a-f30fe5ea5e6e
This commit is contained in:
parent
68a2d6bae9
commit
13fae1fc81
Binary file not shown.
@ -35,6 +35,7 @@ import org.xbill.DNS.utils.base32;
|
|||||||
|
|
||||||
public class ProtoNSEC3
|
public class ProtoNSEC3
|
||||||
{
|
{
|
||||||
|
private Name originalOwner;
|
||||||
private boolean optInFlag;
|
private boolean optInFlag;
|
||||||
private byte hashAlg;
|
private byte hashAlg;
|
||||||
private int iterations;
|
private int iterations;
|
||||||
@ -50,11 +51,12 @@ public class ProtoNSEC3
|
|||||||
/**
|
/**
|
||||||
* Creates an NSEC3 Record from the given data.
|
* Creates an NSEC3 Record from the given data.
|
||||||
*
|
*
|
||||||
|
* @param originalOwner TODO
|
||||||
* @param next The following name in an ordered list of the zone
|
* @param next The following name in an ordered list of the zone
|
||||||
* @param types An array containing the types present.
|
* @param types An array containing the types present.
|
||||||
*/
|
*/
|
||||||
public ProtoNSEC3(byte[] owner, Name zone, int dclass, long ttl,
|
public ProtoNSEC3(byte[] owner, Name originalOwner, Name zone, int dclass,
|
||||||
boolean optInFlag, byte hashAlg, int iterations, byte[] salt,
|
long ttl, boolean optInFlag, byte hashAlg, int iterations, byte[] salt,
|
||||||
byte[] next, TypeMap typemap)
|
byte[] next, TypeMap typemap)
|
||||||
{
|
{
|
||||||
this.zone = zone;
|
this.zone = zone;
|
||||||
@ -67,14 +69,15 @@ public class ProtoNSEC3
|
|||||||
this.salt = salt;
|
this.salt = salt;
|
||||||
this.next = next;
|
this.next = next;
|
||||||
this.typemap = typemap;
|
this.typemap = typemap;
|
||||||
|
this.originalOwner = originalOwner;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProtoNSEC3(byte[] owner, Name zone, int dclass, long ttl,
|
public ProtoNSEC3(byte[] owner, Name originalOwner, Name zone, int dclass,
|
||||||
boolean optInFlag, byte hashAlg, int iterations, byte[] salt,
|
long ttl, boolean optInFlag, byte hashAlg, int iterations, byte[] salt,
|
||||||
byte[] next, int[] types)
|
byte[] next, int[] types)
|
||||||
{
|
{
|
||||||
this(owner, zone, dclass, ttl, optInFlag, hashAlg, iterations, salt,
|
this(owner, originalOwner, zone, dclass, ttl, optInFlag, hashAlg,
|
||||||
next, TypeMap.fromTypes(types));
|
iterations, salt, next, TypeMap.fromTypes(types));
|
||||||
}
|
}
|
||||||
|
|
||||||
private String hashToString(byte[] hash)
|
private String hashToString(byte[] hash)
|
||||||
@ -177,8 +180,11 @@ public class ProtoNSEC3
|
|||||||
|
|
||||||
public NSEC3Record getNSEC3Record()
|
public NSEC3Record getNSEC3Record()
|
||||||
{
|
{
|
||||||
|
String comment = (originalOwner == null)
|
||||||
|
? "(unknown original ownername)"
|
||||||
|
: originalOwner.toString();
|
||||||
return new NSEC3Record(getName(), dclass, ttl, optInFlag, hashAlg,
|
return new NSEC3Record(getName(), dclass, ttl, optInFlag, hashAlg,
|
||||||
iterations, salt, next, getTypes());
|
iterations, salt, next, getTypes(), comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void mergeTypes(TypeMap new_types)
|
public void mergeTypes(TypeMap new_types)
|
||||||
@ -230,6 +236,8 @@ public class ProtoNSEC3
|
|||||||
sb.append(" ");
|
sb.append(" ");
|
||||||
sb.append(Type.string(types[i]));
|
sb.append(Type.string(types[i]));
|
||||||
}
|
}
|
||||||
|
if (originalOwner != null) sb.append(" ; " + originalOwner);
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -870,8 +870,8 @@ public class SignUtils
|
|||||||
{
|
{
|
||||||
types = ENT_NSEC3_TYPES;
|
types = ENT_NSEC3_TYPES;
|
||||||
}
|
}
|
||||||
ProtoNSEC3 r = new ProtoNSEC3(hash, zonename, DClass.IN, ttl, optIn,
|
ProtoNSEC3 r = new ProtoNSEC3(hash, name, zonename, DClass.IN, ttl,
|
||||||
NSEC3Record.SHA1_DIGEST_ID, iterations, salt, null, types);
|
optIn, NSEC3Record.SHA1_DIGEST_ID, iterations, salt, null, types);
|
||||||
|
|
||||||
log.finer("Generated: " + r);
|
log.finer("Generated: " + r);
|
||||||
return r;
|
return r;
|
||||||
|
Loading…
Reference in New Issue
Block a user