From: Stefan Metzmacher Date: Fri, 11 Feb 2022 20:04:57 +0000 (+0100) Subject: s4:kdc: remove unused mkvno from sdb_key X-Git-Tag: tevent-0.12.0~340 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7312bca8c7a09b5fd4a35c15f1c8b49fc2c209cf;p=thirdparty%2Fsamba.git s4:kdc: remove unused mkvno from sdb_key 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 Reviewed-by: Andrew Bartlett --- diff --git a/source4/kdc/sdb.c b/source4/kdc/sdb.c index 2150150505b..673cf4db272 100644 --- a/source4/kdc/sdb.c +++ b/source4/kdc/sdb.c @@ -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) { diff --git a/source4/kdc/sdb.h b/source4/kdc/sdb.h index cf7060bd169..18b635f5a12 100644 --- a/source4/kdc/sdb.h +++ b/source4/kdc/sdb.h @@ -30,7 +30,6 @@ struct sdb_salt { }; struct sdb_key { - unsigned int *mkvno; krb5_keyblock key; struct sdb_salt *salt; }; diff --git a/source4/kdc/sdb_to_hdb.c b/source4/kdc/sdb_to_hdb.c index e2d6e40c837..f832a9e7fcd 100644 --- a/source4/kdc/sdb_to_hdb.c +++ b/source4/kdc/sdb_to_hdb.c @@ -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,