mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 07:32:09 -04:00
4276. [protocol] Add support for SMIMEA. [RT #40513]
This commit is contained in:
parent
27bc16fcdc
commit
322e6b5be7
10 changed files with 287 additions and 16 deletions
2
CHANGES
2
CHANGES
|
|
@ -1,3 +1,5 @@
|
|||
4276. [protocol] Add support for SMIMEA. [RT #40513]
|
||||
|
||||
4275. [performance] Lazily initialize dns_compress->table only when
|
||||
compression is enabled. [RT #41189]
|
||||
|
||||
|
|
|
|||
|
|
@ -329,6 +329,11 @@ tlsa TLSA ( 1 1 2 92003ba34942dc74152e2f2c408d29ec
|
|||
1b177615d466f6c4b71c216a50292bd5
|
||||
8c9ebdd2f74e38fe51ffd48c43326cbc )
|
||||
|
||||
smimea SMIMEA ( 1 1 2 92003ba34942dc74152e2f2c408d29ec
|
||||
a5a520e7f2e06bb944f4dca346baf63c
|
||||
1b177615d466f6c4b71c216a50292bd5
|
||||
8c9ebdd2f74e38fe51ffd48c43326cbc )
|
||||
|
||||
nid NID 10 0014:4fff:ff20:ee64
|
||||
|
||||
l32 L32 10 1.2.3.4
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ DHCID
|
|||
NSEC3
|
||||
NSEC3PARAM
|
||||
TLSA
|
||||
SMIMEA
|
||||
HIP
|
||||
NINFO
|
||||
RKEY
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ rt02.example. 3600 IN RT 65535 .
|
|||
rrsig01.example. 3600 IN RRSIG NSEC 1 3 3600 20000102030405 19961211100908 2143 foo.nil. MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgiWCn/GxHhai6V AuHAoNUz4YoU1tVfSCSqQYn6//11U6Nld80jEeC8aTrO+KKmCaY=
|
||||
sink01.example. 3600 IN SINK 1 0 0
|
||||
sink02.example. 3600 IN SINK 8 0 2 l4ik
|
||||
smimea.example. 3600 IN SMIMEA 1 1 2 92003BA34942DC74152E2F2C408D29ECA5A520E7F2E06BB944F4DCA3 46BAF63C1B177615D466F6C4B71C216A50292BD58C9EBDD2F74E38FE 51FFD48C43326CBC
|
||||
srv01.example. 3600 IN SRV 0 0 0 .
|
||||
srv02.example. 3600 IN SRV 65535 65535 65535 old-slow-box.example.
|
||||
ta.example. 3600 IN TA 30795 1 1 310D27F4D82C1FC2400704EA9939FE6E1CEAA3B9
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ rt02.example. 3600 IN RT 65535 .
|
|||
rrsig01.example. 3600 IN RRSIG NSEC 1 3 3600 20000102030405 19961211100908 2143 foo.nil. MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgiWCn/GxHhai6V AuHAoNUz4YoU1tVfSCSqQYn6//11U6Nld80jEeC8aTrO+KKmCaY=
|
||||
sink01.example. 3600 IN SINK 1 0 0
|
||||
sink02.example. 3600 IN SINK 8 0 2 l4ik
|
||||
smimea.example. 3600 IN SMIMEA 1 1 2 92003BA34942DC74152E2F2C408D29ECA5A520E7F2E06BB944F4DCA3 46BAF63C1B177615D466F6C4B71C216A50292BD58C9EBDD2F74E38FE 51FFD48C43326CBC
|
||||
srv01.example. 3600 IN SRV 0 0 0 .
|
||||
srv02.example. 3600 IN SRV 65535 65535 65535 old-slow-box.example.
|
||||
ta.example. 3600 IN TA 30795 1 1 310D27F4D82C1FC2400704EA9939FE6E1CEAA3B9
|
||||
|
|
|
|||
|
|
@ -14073,6 +14073,18 @@ view external {
|
|||
</para>
|
||||
</entry>
|
||||
</row>
|
||||
<row rowsep="0">
|
||||
<entry colname="1">
|
||||
<para>
|
||||
SMIMEA
|
||||
</para>
|
||||
</entry>
|
||||
<entry colname="2">
|
||||
<para>
|
||||
The S/MIME Security Certificate Association.
|
||||
</para>
|
||||
</entry>
|
||||
</row>
|
||||
<row rowsep="0">
|
||||
<entry colname="1">
|
||||
<para>
|
||||
|
|
|
|||
|
|
@ -279,6 +279,24 @@ generic_fromwire_ds(ARGS_FROMWIRE);
|
|||
static isc_result_t
|
||||
generic_fromstruct_ds(ARGS_FROMSTRUCT);
|
||||
|
||||
static isc_result_t
|
||||
generic_fromtext_tlsa(ARGS_FROMTEXT);
|
||||
|
||||
static isc_result_t
|
||||
generic_totext_tlsa(ARGS_TOTEXT);
|
||||
|
||||
static isc_result_t
|
||||
generic_fromwire_tlsa(ARGS_FROMWIRE);
|
||||
|
||||
static isc_result_t
|
||||
generic_fromstruct_tlsa(ARGS_FROMSTRUCT);
|
||||
|
||||
static isc_result_t
|
||||
generic_tostruct_tlsa(ARGS_TOSTRUCT);
|
||||
|
||||
static void
|
||||
generic_freestruct_tlsa(ARGS_FREESTRUCT);
|
||||
|
||||
/*% INT16 Size */
|
||||
#define NS_INT16SZ 2
|
||||
/*% IPv6 Address Size */
|
||||
|
|
|
|||
161
lib/dns/rdata/generic/smimea_53.c
Normal file
161
lib/dns/rdata/generic/smimea_53.c
Normal file
|
|
@ -0,0 +1,161 @@
|
|||
/*
|
||||
* Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef RDATA_GENERIC_SMIMEA_53_C
|
||||
#define RDATA_GENERIC_SMIMEA_53_C
|
||||
|
||||
#define RRTYPE_SMIMEA_ATTRIBUTES 0
|
||||
|
||||
static inline isc_result_t
|
||||
fromtext_smimea(ARGS_FROMTEXT) {
|
||||
|
||||
REQUIRE(type == dns_rdatatype_smimea);
|
||||
|
||||
return (generic_fromtext_tlsa(rdclass, type, lexer, origin, options,
|
||||
target, callbacks));
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
totext_smimea(ARGS_TOTEXT) {
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_smimea);
|
||||
|
||||
return (generic_totext_tlsa(rdata, tctx, target));
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
fromwire_smimea(ARGS_FROMWIRE) {
|
||||
|
||||
REQUIRE(type == dns_rdatatype_smimea);
|
||||
|
||||
return (generic_fromwire_tlsa(rdclass, type, source, dctx, options,
|
||||
target));
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
towire_smimea(ARGS_TOWIRE) {
|
||||
isc_region_t sr;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_smimea);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
||||
UNUSED(cctx);
|
||||
|
||||
dns_rdata_toregion(rdata, &sr);
|
||||
return (mem_tobuffer(target, sr.base, sr.length));
|
||||
}
|
||||
|
||||
static inline int
|
||||
compare_smimea(ARGS_COMPARE) {
|
||||
isc_region_t r1;
|
||||
isc_region_t r2;
|
||||
|
||||
REQUIRE(rdata1->type == rdata2->type);
|
||||
REQUIRE(rdata1->rdclass == rdata2->rdclass);
|
||||
REQUIRE(rdata1->type == dns_rdatatype_smimea);
|
||||
REQUIRE(rdata1->length != 0);
|
||||
REQUIRE(rdata2->length != 0);
|
||||
|
||||
dns_rdata_toregion(rdata1, &r1);
|
||||
dns_rdata_toregion(rdata2, &r2);
|
||||
return (isc_region_compare(&r1, &r2));
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
fromstruct_smimea(ARGS_FROMSTRUCT) {
|
||||
|
||||
REQUIRE(type == dns_rdatatype_smimea);
|
||||
|
||||
return (generic_fromstruct_tlsa(rdclass, type, source, target));
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
tostruct_smimea(ARGS_TOSTRUCT) {
|
||||
dns_rdata_txt_t *txt = target;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_smimea);
|
||||
REQUIRE(target != NULL);
|
||||
|
||||
txt->common.rdclass = rdata->rdclass;
|
||||
txt->common.rdtype = rdata->type;
|
||||
ISC_LINK_INIT(&txt->common, link);
|
||||
|
||||
return (generic_tostruct_tlsa(rdata, target, mctx));
|
||||
}
|
||||
|
||||
static inline void
|
||||
freestruct_smimea(ARGS_FREESTRUCT) {
|
||||
dns_rdata_txt_t *txt = source;
|
||||
|
||||
REQUIRE(source != NULL);
|
||||
REQUIRE(txt->common.rdtype == dns_rdatatype_smimea);
|
||||
|
||||
generic_freestruct_tlsa(source);
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
additionaldata_smimea(ARGS_ADDLDATA) {
|
||||
REQUIRE(rdata->type == dns_rdatatype_smimea);
|
||||
|
||||
UNUSED(rdata);
|
||||
UNUSED(add);
|
||||
UNUSED(arg);
|
||||
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
digest_smimea(ARGS_DIGEST) {
|
||||
isc_region_t r;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_smimea);
|
||||
|
||||
dns_rdata_toregion(rdata, &r);
|
||||
|
||||
return ((digest)(arg, &r));
|
||||
}
|
||||
|
||||
static inline isc_boolean_t
|
||||
checkowner_smimea(ARGS_CHECKOWNER) {
|
||||
|
||||
REQUIRE(type == dns_rdatatype_smimea);
|
||||
|
||||
UNUSED(name);
|
||||
UNUSED(type);
|
||||
UNUSED(rdclass);
|
||||
UNUSED(wildcard);
|
||||
|
||||
return (ISC_TRUE);
|
||||
}
|
||||
|
||||
static inline isc_boolean_t
|
||||
checknames_smimea(ARGS_CHECKNAMES) {
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_smimea);
|
||||
|
||||
UNUSED(rdata);
|
||||
UNUSED(owner);
|
||||
UNUSED(bad);
|
||||
|
||||
return (ISC_TRUE);
|
||||
}
|
||||
|
||||
static inline int
|
||||
casecompare_smimea(ARGS_COMPARE) {
|
||||
return (compare_smimea(rdata1, rdata2));
|
||||
}
|
||||
|
||||
#endif /* RDATA_GENERIC_SMIMEA_53_C */
|
||||
22
lib/dns/rdata/generic/smimea_53.h
Normal file
22
lib/dns/rdata/generic/smimea_53.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (C) 2015 Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifndef GENERIC_SMIMEA_53_H
|
||||
#define GENERIC_SMIMEA_53_H 1
|
||||
|
||||
typedef struct dns_rdata_tlsa dns_rdata_smimea_t;
|
||||
|
||||
#endif /* GENERIC_SMIMEA_53_H */
|
||||
|
|
@ -14,8 +14,6 @@
|
|||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* rfc6698.txt */
|
||||
|
||||
#ifndef RDATA_GENERIC_TLSA_52_C
|
||||
|
|
@ -24,11 +22,9 @@
|
|||
#define RRTYPE_TLSA_ATTRIBUTES 0
|
||||
|
||||
static inline isc_result_t
|
||||
fromtext_tlsa(ARGS_FROMTEXT) {
|
||||
generic_fromtext_tlsa(ARGS_FROMTEXT) {
|
||||
isc_token_t token;
|
||||
|
||||
REQUIRE(type == dns_rdatatype_tlsa);
|
||||
|
||||
UNUSED(type);
|
||||
UNUSED(rdclass);
|
||||
UNUSED(origin);
|
||||
|
|
@ -69,12 +65,11 @@ fromtext_tlsa(ARGS_FROMTEXT) {
|
|||
}
|
||||
|
||||
static inline isc_result_t
|
||||
totext_tlsa(ARGS_TOTEXT) {
|
||||
generic_totext_tlsa(ARGS_TOTEXT) {
|
||||
isc_region_t sr;
|
||||
char buf[sizeof("64000 ")];
|
||||
unsigned int n;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_tlsa);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
||||
UNUSED(tctx);
|
||||
|
|
@ -122,11 +117,9 @@ totext_tlsa(ARGS_TOTEXT) {
|
|||
}
|
||||
|
||||
static inline isc_result_t
|
||||
fromwire_tlsa(ARGS_FROMWIRE) {
|
||||
generic_fromwire_tlsa(ARGS_FROMWIRE) {
|
||||
isc_region_t sr;
|
||||
|
||||
REQUIRE(type == dns_rdatatype_tlsa);
|
||||
|
||||
UNUSED(type);
|
||||
UNUSED(rdclass);
|
||||
UNUSED(dctx);
|
||||
|
|
@ -141,6 +134,32 @@ fromwire_tlsa(ARGS_FROMWIRE) {
|
|||
return (mem_tobuffer(target, sr.base, sr.length));
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
fromtext_tlsa(ARGS_FROMTEXT) {
|
||||
|
||||
REQUIRE(type == dns_rdatatype_tlsa);
|
||||
|
||||
return (generic_fromtext_tlsa(rdclass, type, lexer, origin, options,
|
||||
target, callbacks));
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
totext_tlsa(ARGS_TOTEXT) {
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_tlsa);
|
||||
|
||||
return (generic_totext_tlsa(rdata, tctx, target));
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
fromwire_tlsa(ARGS_FROMWIRE) {
|
||||
|
||||
REQUIRE(type == dns_rdatatype_tlsa);
|
||||
|
||||
return (generic_fromwire_tlsa(rdclass, type, source, dctx, options,
|
||||
target));
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
towire_tlsa(ARGS_TOWIRE) {
|
||||
isc_region_t sr;
|
||||
|
|
@ -171,10 +190,9 @@ compare_tlsa(ARGS_COMPARE) {
|
|||
}
|
||||
|
||||
static inline isc_result_t
|
||||
fromstruct_tlsa(ARGS_FROMSTRUCT) {
|
||||
generic_fromstruct_tlsa(ARGS_FROMSTRUCT) {
|
||||
dns_rdata_tlsa_t *tlsa = source;
|
||||
|
||||
REQUIRE(type == dns_rdatatype_tlsa);
|
||||
REQUIRE(source != NULL);
|
||||
REQUIRE(tlsa->common.rdtype == type);
|
||||
REQUIRE(tlsa->common.rdclass == rdclass);
|
||||
|
|
@ -190,11 +208,10 @@ fromstruct_tlsa(ARGS_FROMSTRUCT) {
|
|||
}
|
||||
|
||||
static inline isc_result_t
|
||||
tostruct_tlsa(ARGS_TOSTRUCT) {
|
||||
generic_tostruct_tlsa(ARGS_TOSTRUCT) {
|
||||
dns_rdata_tlsa_t *tlsa = target;
|
||||
isc_region_t region;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_tlsa);
|
||||
REQUIRE(target != NULL);
|
||||
REQUIRE(rdata->length != 0);
|
||||
|
||||
|
|
@ -221,11 +238,10 @@ tostruct_tlsa(ARGS_TOSTRUCT) {
|
|||
}
|
||||
|
||||
static inline void
|
||||
freestruct_tlsa(ARGS_FREESTRUCT) {
|
||||
generic_freestruct_tlsa(ARGS_FREESTRUCT) {
|
||||
dns_rdata_tlsa_t *tlsa = source;
|
||||
|
||||
REQUIRE(tlsa != NULL);
|
||||
REQUIRE(tlsa->common.rdtype == dns_rdatatype_tlsa);
|
||||
|
||||
if (tlsa->mctx == NULL)
|
||||
return;
|
||||
|
|
@ -235,6 +251,38 @@ freestruct_tlsa(ARGS_FREESTRUCT) {
|
|||
tlsa->mctx = NULL;
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
fromstruct_tlsa(ARGS_FROMSTRUCT) {
|
||||
|
||||
REQUIRE(type == dns_rdatatype_tlsa);
|
||||
|
||||
return (generic_fromstruct_tlsa(rdclass, type, source, target));
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
tostruct_tlsa(ARGS_TOSTRUCT) {
|
||||
dns_rdata_txt_t *txt = target;
|
||||
|
||||
REQUIRE(rdata->type == dns_rdatatype_tlsa);
|
||||
REQUIRE(target != NULL);
|
||||
|
||||
txt->common.rdclass = rdata->rdclass;
|
||||
txt->common.rdtype = rdata->type;
|
||||
ISC_LINK_INIT(&txt->common, link);
|
||||
|
||||
return (generic_tostruct_tlsa(rdata, target, mctx));
|
||||
}
|
||||
|
||||
static inline void
|
||||
freestruct_tlsa(ARGS_FREESTRUCT) {
|
||||
dns_rdata_txt_t *txt = source;
|
||||
|
||||
REQUIRE(source != NULL);
|
||||
REQUIRE(txt->common.rdtype == dns_rdatatype_tlsa);
|
||||
|
||||
generic_freestruct_tlsa(source);
|
||||
}
|
||||
|
||||
static inline isc_result_t
|
||||
additionaldata_tlsa(ARGS_ADDLDATA) {
|
||||
REQUIRE(rdata->type == dns_rdatatype_tlsa);
|
||||
|
|
|
|||
Loading…
Reference in a new issue