mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
Update dst key code to maintain key state
Add a number of metadata variables (lifetime, ksk and zsk role). For the roles we add a new type of metadata (booleans). Add a function to write the state of the key to a separate file. Only write out known metadata to private file. With the introduction of the numeric metadata "Lifetime", adjust the write private key file functionality to only write out metadata it knows about.
This commit is contained in:
@@ -734,7 +734,9 @@ dst__privstruct_writefile(const dst_key_t *key, const dst_private_t *priv,
|
||||
result = dst_key_getnum(key, i, &value);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
continue;
|
||||
fprintf(fp, "%s %u\n", numerictags[i], value);
|
||||
if (numerictags[i] != NULL) {
|
||||
fprintf(fp, "%s %u\n", numerictags[i], value);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < TIMING_NTAGS; i++) {
|
||||
result = dst_key_gettime(key, i, &when);
|
||||
@@ -750,8 +752,10 @@ dst__privstruct_writefile(const dst_key_t *key, const dst_private_t *priv,
|
||||
|
||||
isc_buffer_usedregion(&b, &r);
|
||||
|
||||
fprintf(fp, "%s %.*s\n", timetags[i], (int)r.length,
|
||||
r.base);
|
||||
if (timetags[i] != NULL) {
|
||||
fprintf(fp, "%s %.*s\n", timetags[i],
|
||||
(int)r.length, r.base);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user