diff options
author | Kai Blin <kai@samba.org> | 2012-09-05 08:24:52 +0200 |
---|---|---|
committer | Kai Blin <kai@samba.org> | 2012-09-05 19:02:16 +0200 |
commit | c0e6a4b1b07c7aff49f19c4d8cf3de1ff020afab (patch) | |
tree | 682919c3b26cf5c10b3ec077e7be828053a00275 /source4/dns_server/dns_crypto.c | |
parent | 22fda8cb155041556a51106e5b1f058378c2c05b (diff) | |
download | samba-c0e6a4b1b07c7aff49f19c4d8cf3de1ff020afab.tar.gz samba-c0e6a4b1b07c7aff49f19c4d8cf3de1ff020afab.tar.bz2 samba-c0e6a4b1b07c7aff49f19c4d8cf3de1ff020afab.zip |
s4 dns: Move dns_find_tkey to an extra file
Diffstat (limited to 'source4/dns_server/dns_crypto.c')
-rw-r--r-- | source4/dns_server/dns_crypto.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/source4/dns_server/dns_crypto.c b/source4/dns_server/dns_crypto.c new file mode 100644 index 0000000000..4be61f6aac --- /dev/null +++ b/source4/dns_server/dns_crypto.c @@ -0,0 +1,54 @@ +/* + Unix SMB/CIFS implementation. + + DNS server handler for signed packets + + Copyright (C) 2012 Kai Blin <kai@samba.org> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#include "includes.h" +#include "lib/crypto/hmacmd5.h" +#include "system/network.h" +#include "librpc/ndr/libndr.h" +#include "librpc/gen_ndr/ndr_dns.h" +#include "dns_server/dns_server.h" +#include "libcli/util/ntstatus.h" +#include "auth/auth.h" +#include "auth/gensec/gensec.h" + +struct dns_server_tkey *dns_find_tkey(struct dns_server_tkey_store *store, + const char *name) +{ + struct dns_server_tkey *tkey = NULL; + uint16_t i = 0; + + do { + struct dns_server_tkey *tmp_key = store->tkeys[i]; + + i++; + i %= TKEY_BUFFER_SIZE; + + if (tmp_key == NULL) { + continue; + } + if (dns_name_equal(name, tmp_key->name)) { + tkey = tmp_key; + break; + } + } while (i != 0); + + return tkey; +} |