CVE-2016-0771: s4:dns_server: fix idl for dns_txt_record
[samba.git] / librpc / idl / dns.idl
index 90ac47a83113126117dc9287c8964e88e81e3336..918073ca9a8aa48d8ada819bdc7980ff998af59c 100644 (file)
@@ -8,7 +8,7 @@
    encoding if it doesn't work out
 */
 
-import "misc.idl";
+import "misc.idl", "dnsp.idl";
 [
        helper("librpc/ndr/ndr_dns.h"),
        helpstring("DNS records"),
@@ -36,7 +36,7 @@ interface dns
                DNS_OPCODE_QUERY          =  (0x0<<11),
                DNS_OPCODE_IQUERY         =  (0x1<<11),
                DNS_OPCODE_STATUS         =  (0x2<<11),
-               DNS_OPCODE_REGISTER       =  (0x5<<11),
+               DNS_OPCODE_UPDATE         =  (0x5<<11),
                DNS_OPCODE_RELEASE        =  (0x6<<11),
                DNS_OPCODE_WACK           =  (0x7<<11),
                DNS_OPCODE_REFRESH        =  (0x8<<11),
@@ -46,21 +46,27 @@ interface dns
 
        /* rcode values */
        typedef [public] enum {
-               DNS_RCODE_OK       = 0x0,
-               DNS_RCODE_FORMERR  = 0x1,
-               DNS_RCODE_SERVFAIL = 0x2,
-               DNS_RCODE_NXDOMAIN = 0x3,
-               DNS_RCODE_NOTIMP   = 0x4,
-               DNS_RCODE_REFUSED  = 0x5,
-               DNS_RCODE_YXDOMAIN = 0x6,
-               DNS_RCODE_YXRRSET  = 0x7,
-               DNS_RCODE_NXRRSET  = 0x8,
-               DNS_RCODE_NOTAUTH  = 0x9,
-               DNS_RCODE_NOTZONE  = 0xA
+               DNS_RCODE_OK       = 0x00,
+               DNS_RCODE_FORMERR  = 0x01,
+               DNS_RCODE_SERVFAIL = 0x02,
+               DNS_RCODE_NXDOMAIN = 0x03,
+               DNS_RCODE_NOTIMP   = 0x04,
+               DNS_RCODE_REFUSED  = 0x05,
+               DNS_RCODE_YXDOMAIN = 0x06,
+               DNS_RCODE_YXRRSET  = 0x07,
+               DNS_RCODE_NXRRSET  = 0x08,
+               DNS_RCODE_NOTAUTH  = 0x09,
+               DNS_RCODE_NOTZONE  = 0x0A,
+               DNS_RCODE_BADSIG   = 0x10,
+               DNS_RCODE_BADKEY   = 0x11,
+               DNS_RCODE_BADTIME  = 0x12,
+               DNS_RCODE_BADMODE  = 0x13,
+               DNS_RCODE_BADNAME  = 0x14,
+               DNS_RCODE_BADALG   = 0x15
        } dns_rcode;
 
        typedef [public,enum16bit] enum {
-               DNS_QCLASS_IP   = 0x0001,
+               DNS_QCLASS_IN   = 0x0001,
                DNS_QCLASS_NONE = 0x00FE,
                DNS_QCLASS_ANY  = 0x00FF
        } dns_qclass;
@@ -100,16 +106,30 @@ interface dns
                DNS_QTYPE_ATMA   = 0x0022,
                DNS_QTYPE_NAPTR  = 0x0023,
                DNS_QTYPE_DNAME  = 0x0027,
+               DNS_QTYPE_OPT    = 0x0029,
                DNS_QTYPE_DS     = 0x002B,
                DNS_QTYPE_RRSIG  = 0x002E,
                DNS_QTYPE_NSEC   = 0x002F,
                DNS_QTYPE_DNSKEY = 0x0030,
                DNS_QTYPE_DHCID  = 0x0031,
-               DNS_QTYPE_ALL    = 0x00FF,
-               DNS_QTYPE_WINS   = 0xFF01,
-               DNS_QTYPE_WINSR  = 0xFF02
+               DNS_QTYPE_TKEY   = 0x00F9,
+               DNS_QTYPE_TSIG   = 0x00FA,
+               DNS_QTYPE_AXFR   = 0x00FC,
+               DNS_QTYPE_MAILB  = 0x00FD,
+               DNS_QTYPE_MAILA  = 0x00FE,
+               DNS_QTYPE_ALL    = 0x00FF
        } dns_qtype;
 
+       typedef [public,enum16bit] enum {
+               DNS_TKEY_MODE_NULL   = 0x0000,
+               DNS_TKEY_MODE_SERVER = 0x0001,
+               DNS_TKEY_MODE_DH     = 0x0002,
+               DNS_TKEY_MODE_GSSAPI = 0x0003,
+               DNS_TKEY_MODE_CLIENT = 0x0004,
+               DNS_TKEY_MODE_DELETE = 0x0005,
+               DNS_TKEY_MODE_LAST   = 0xFFFF
+       } dns_tkey_mode;
+
        typedef [public] struct {
                dns_string name;
                dns_qtype  question_type;
@@ -131,6 +151,28 @@ interface dns
                uint32     minimum;
        } dns_soa_record;
 
+       typedef [public] struct {
+               [value(strlen(cpu))] uint8 cpu_length;
+               [charset(DOS)] uint8 cpu[cpu_length];
+               [value(strlen(os))] uint8 os_length;
+               [charset(DOS)] uint8 os[os_length];
+       } dns_hinfo_record;
+
+       typedef [public] struct {
+               uint16     preference;
+               dns_string exchange;
+       } dns_mx_record;
+
+       typedef [public,nopull] struct {
+               dnsp_string_list txt;
+       } dns_txt_record;
+
+       typedef [public] struct {
+               dns_string mbox;
+               dns_string txt;
+
+       } dns_rp_record;
+
        typedef [public] struct {
                uint16     priority;
                uint16     weight;
@@ -139,9 +181,49 @@ interface dns
        } dns_srv_record;
 
        typedef [public] struct {
-               uint16     preference;
-               dns_string exchange;
-       } dns_mx_record;
+               uint16     option_code;
+               uint16     option_length;
+               uint8      option_data[option_length];
+       } dns_opt_record;
+
+       typedef [public] struct {
+               dns_string     algorithm;
+               uint32         inception;
+               uint32         expiration;
+               dns_tkey_mode  mode;
+               uint16         error;
+               uint16         key_size;
+               uint8          key_data[key_size];
+               uint16         other_size;
+               uint8          other_data[other_size];
+       } dns_tkey_record;
+
+       typedef [public] struct {
+               dns_string algorithm_name;
+               uint16     time_prefix; /* 0 until February 2106*/
+               uint32     time;
+               uint16     fudge;
+               uint16     mac_size;
+               uint8      mac[mac_size];
+               uint16     original_id;
+               uint16     error;
+               uint16     other_size;
+               uint8      other_data[other_size];
+       } dns_tsig_record;
+
+       typedef [flag(NDR_NOALIGN|NDR_BIG_ENDIAN|NDR_PAHEX),public] struct {
+               dns_string      name;
+               dns_qclass      rr_class;
+               uint32          ttl;
+               dns_string      algorithm_name;
+               uint16          time_prefix; /* 0 until February 2106*/
+               uint32          time;
+               uint16          fudge;
+               uint16          original_id;
+               uint16          error;
+               uint16          other_size;
+               uint8           other_data[other_size];
+       } dns_fake_tsig_rec;
 
        typedef [nodiscriminant,public,flag(NDR_NOALIGN)] union {
                [case(DNS_QTYPE_A)]     ipv4address      ipv4_record;
@@ -149,9 +231,15 @@ interface dns
                [case(DNS_QTYPE_CNAME)] dns_string       cname_record;
                [case(DNS_QTYPE_SOA)]   dns_soa_record   soa_record;
                [case(DNS_QTYPE_PTR)]   dns_string       ptr_record;
+               [case(DNS_QTYPE_HINFO)] dns_hinfo_record  hinfo_record;
                [case(DNS_QTYPE_MX)]    dns_mx_record    mx_record;
+               [case(DNS_QTYPE_TXT)]   dns_txt_record   txt_record;
+               [case(DNS_QTYPE_RP)]    dns_rp_record    rp_record;
                [case(DNS_QTYPE_AAAA)]  ipv6address      ipv6_record;
                [case(DNS_QTYPE_SRV)]   dns_srv_record   srv_record;
+               [case(DNS_QTYPE_OPT)]   dns_opt_record   opt_record;
+               [case(DNS_QTYPE_TSIG)]  dns_tsig_record  tsig_record;
+               [case(DNS_QTYPE_TKEY)]  dns_tkey_record  tkey_record;
                [default];
        } dns_rdata;
 
@@ -181,7 +269,7 @@ interface dns
         /*
           this is a convenience hook for ndrdump
        */
-       void decode_dns_name_packet(
+       [nopython] void decode_dns_name_packet(
                                    [in] dns_name_packet packet
                                   );
 }