]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:kdc: remove unused mkvno from sdb_key
authorStefan Metzmacher <metze@samba.org>
Fri, 11 Feb 2022 20:04:57 +0000 (21:04 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 24 Mar 2022 09:19:33 +0000 (09:19 +0000)
This is not related to the kvno of the key,
the mkvno tells the HDB layer that the keys need to
be decrypted with a master key (with the given [m]kvno).

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/kdc/sdb.c
source4/kdc/sdb.h
source4/kdc/sdb_to_hdb.c

index 2150150505b831031a44acc96f89ff69e4e8a6e0..673cf4db27278f7f4d824572bb100d6c6933adce 100644 (file)
@@ -55,10 +55,6 @@ static void free_sdb_key(struct sdb_key *k)
                return;
        }
 
-       if (k->mkvno) {
-               free(k->mkvno);
-       }
-
        /* keyblock not alloced */
 
        if (k->salt) {
index cf7060bd169169789ff02842b8525423cc8fa1b2..18b635f5a121c2313b655226267bf67a05d62717 100644 (file)
@@ -30,7 +30,6 @@ struct sdb_salt {
 };
 
 struct sdb_key {
-       unsigned int *mkvno;
        krb5_keyblock key;
        struct sdb_salt *salt;
 };
index e2d6e40c837e5c7a3c5fffce915769f1ee072d45..f832a9e7fcdd4c8e960d18b8f929586ec236e53b 100644 (file)
@@ -86,15 +86,7 @@ static int sdb_key_to_Key(const struct sdb_key *s, Key *h)
 {
        int rc;
 
-       if (s->mkvno != NULL) {
-               h->mkvno = malloc(sizeof(unsigned int));
-               if (h->mkvno == NULL) {
-                       goto error_nomem;
-               }
-               *h->mkvno = *s->mkvno;
-       } else {
-               h->mkvno = NULL;
-       }
+       ZERO_STRUCTP(h);
 
        h->key.keytype = s->key.keytype;
        rc = smb_krb5_copy_data_contents(&h->key.keyvalue,