]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dssync keytab: add store enctypes in the libnet_keytype_entry structs.
authorMichael Adam <obnox@samba.org>
Mon, 28 Jul 2008 12:42:30 +0000 (14:42 +0200)
committerMichael Adam <obnox@samba.org>
Fri, 1 Aug 2008 14:04:41 +0000 (16:04 +0200)
Still unused by the libnet_keytab_add() function.
This will follow.
In preparation of supporting multiple encryption types in libnet_dssync_keytab.

Michael

source/libnet/libnet_dssync_keytab.c

index 350aa033208f08f9415df1a5e523b70e783c5a8b..cc53c983afdca110e219c739f0570978985f97ad 100644 (file)
@@ -28,6 +28,7 @@ static NTSTATUS add_to_keytab_entries(TALLOC_CTX *mem_ctx,
                                      uint32_t kvno,
                                      const char *name,
                                      const char *prefix,
+                                     const krb5_enctype enctype,
                                      DATA_BLOB blob)
 {
        struct libnet_keytab_entry entry;
@@ -38,6 +39,7 @@ static NTSTATUS add_to_keytab_entries(TALLOC_CTX *mem_ctx,
                                          prefix ? prefix : "",
                                          prefix ? "/" : "",
                                          name, ctx->dns_domain_name);
+       entry.enctype = enctype;
        entry.password = blob;
        NT_STATUS_HAVE_NO_MEMORY(entry.name);
        NT_STATUS_HAVE_NO_MEMORY(entry.principal);
@@ -126,7 +128,8 @@ static NTSTATUS keytab_finish(struct dssync_context *ctx, TALLOC_CTX *mem_ctx,
                }
 
                status = add_to_keytab_entries(mem_ctx, keytab_ctx, 0,
-                                              ctx->nc_dn, "UTDV", blob);
+                                              ctx->nc_dn, "UTDV",
+                                              ENCTYPE_NULL, blob);
                if (!NT_STATUS_IS_OK(status)) {
                        goto done;
                }
@@ -250,6 +253,7 @@ static NTSTATUS parse_object(TALLOC_CTX *mem_ctx,
        DEBUGADD(1,("\n"));
 
        status = add_to_keytab_entries(mem_ctx, ctx, kvno, name, NULL,
+                                      ENCTYPE_ARCFOUR_HMAC,
                                       data_blob_talloc(mem_ctx, nt_passwd, 16));
 
        if (!NT_STATUS_IS_OK(status)) {
@@ -272,6 +276,7 @@ static NTSTATUS parse_object(TALLOC_CTX *mem_ctx,
 
        for (; i<pwd_history_len; i++) {
                status = add_to_keytab_entries(mem_ctx, ctx, kvno--, name, NULL,
+                               ENCTYPE_ARCFOUR_HMAC,
                                data_blob_talloc(mem_ctx, &pwd_history[i*16], 16));
                if (!NT_STATUS_IS_OK(status)) {
                        break;