mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Require valid key for dst_key functions
Make sure that the key structure is valid when calling the following
functions:
- dst_key_setexternal
- dst_key_isexternal
- dst_key_setmodified
- dst_key_ismodified
(cherry picked from commit 888ec4e0d4)
This commit is contained in:
parent
ca7e3e25c4
commit
0ae48af8b2
1 changed files with 8 additions and 0 deletions
|
|
@ -461,16 +461,22 @@ dst_key_tofile(const dst_key_t *key, int type, const char *directory) {
|
|||
|
||||
void
|
||||
dst_key_setexternal(dst_key_t *key, bool value) {
|
||||
REQUIRE(VALID_KEY(key));
|
||||
|
||||
key->external = value;
|
||||
}
|
||||
|
||||
bool
|
||||
dst_key_isexternal(dst_key_t *key) {
|
||||
REQUIRE(VALID_KEY(key));
|
||||
|
||||
return (key->external);
|
||||
}
|
||||
|
||||
void
|
||||
dst_key_setmodified(dst_key_t *key, bool value) {
|
||||
REQUIRE(VALID_KEY(key));
|
||||
|
||||
isc_mutex_lock(&key->mdlock);
|
||||
key->modified = value;
|
||||
isc_mutex_unlock(&key->mdlock);
|
||||
|
|
@ -480,6 +486,8 @@ bool
|
|||
dst_key_ismodified(const dst_key_t *key) {
|
||||
bool modified;
|
||||
|
||||
REQUIRE(VALID_KEY(key));
|
||||
|
||||
isc_mutex_lock(&(((dst_key_t *)key)->mdlock));
|
||||
modified = key->modified;
|
||||
isc_mutex_unlock(&(((dst_key_t *)key)->mdlock));
|
||||
|
|
|
|||
Loading…
Reference in a new issue