mirror of
https://github.com/monero-project/monero.git
synced 2025-08-18 02:40:34 -04:00
update unbound from upstream
This commit is contained in:
parent
b0151de601
commit
1f49833d4f
155 changed files with 5482 additions and 3440 deletions
2
external/unbound/util/data/dname.c
vendored
2
external/unbound/util/data/dname.c
vendored
|
@ -45,7 +45,7 @@
|
|||
#include "util/data/msgparse.h"
|
||||
#include "util/log.h"
|
||||
#include "util/storage/lookup3.h"
|
||||
#include "ldns/sbuffer.h"
|
||||
#include "sldns/sbuffer.h"
|
||||
|
||||
/* determine length of a dname in buffer, no compression pointers allowed */
|
||||
size_t
|
||||
|
|
2
external/unbound/util/data/msgencode.c
vendored
2
external/unbound/util/data/msgencode.c
vendored
|
@ -47,7 +47,7 @@
|
|||
#include "util/log.h"
|
||||
#include "util/regional.h"
|
||||
#include "util/net_help.h"
|
||||
#include "ldns/sbuffer.h"
|
||||
#include "sldns/sbuffer.h"
|
||||
|
||||
/** return code that means the function ran out of memory. negative so it does
|
||||
* not conflict with DNS rcodes. */
|
||||
|
|
8
external/unbound/util/data/msgparse.c
vendored
8
external/unbound/util/data/msgparse.c
vendored
|
@ -42,10 +42,10 @@
|
|||
#include "util/data/packed_rrset.h"
|
||||
#include "util/storage/lookup3.h"
|
||||
#include "util/regional.h"
|
||||
#include "ldns/rrdef.h"
|
||||
#include "ldns/sbuffer.h"
|
||||
#include "ldns/parseutil.h"
|
||||
#include "ldns/wire2str.h"
|
||||
#include "sldns/rrdef.h"
|
||||
#include "sldns/sbuffer.h"
|
||||
#include "sldns/parseutil.h"
|
||||
#include "sldns/wire2str.h"
|
||||
|
||||
/** smart comparison of (compressed, valid) dnames from packet */
|
||||
static int
|
||||
|
|
4
external/unbound/util/data/msgparse.h
vendored
4
external/unbound/util/data/msgparse.h
vendored
|
@ -63,8 +63,8 @@
|
|||
#ifndef UTIL_DATA_MSGPARSE_H
|
||||
#define UTIL_DATA_MSGPARSE_H
|
||||
#include "util/storage/lruhash.h"
|
||||
#include "ldns/pkthdr.h"
|
||||
#include "ldns/rrdef.h"
|
||||
#include "sldns/pkthdr.h"
|
||||
#include "sldns/rrdef.h"
|
||||
struct sldns_buffer;
|
||||
struct rrset_parse;
|
||||
struct rr_parse;
|
||||
|
|
11
external/unbound/util/data/msgreply.c
vendored
11
external/unbound/util/data/msgreply.c
vendored
|
@ -50,8 +50,8 @@
|
|||
#include "util/regional.h"
|
||||
#include "util/data/msgparse.h"
|
||||
#include "util/data/msgencode.h"
|
||||
#include "ldns/sbuffer.h"
|
||||
#include "ldns/wire2str.h"
|
||||
#include "sldns/sbuffer.h"
|
||||
#include "sldns/wire2str.h"
|
||||
|
||||
/** MAX TTL default for messages and rrsets */
|
||||
time_t MAX_TTL = 3600 * 24 * 10; /* ten days */
|
||||
|
@ -87,6 +87,7 @@ construct_reply_info_base(struct regional* region, uint16_t flags, size_t qd,
|
|||
/* rrset_count-1 because the first ref is part of the struct. */
|
||||
size_t s = sizeof(struct reply_info) - sizeof(struct rrset_ref) +
|
||||
sizeof(struct ub_packed_rrset_key*) * total;
|
||||
if(total >= RR_COUNT_MAX) return NULL; /* sanity check on numRRS*/
|
||||
if(region)
|
||||
rep = (struct reply_info*)regional_alloc(region, s);
|
||||
else rep = (struct reply_info*)malloc(s +
|
||||
|
@ -277,7 +278,11 @@ parse_create_rrset(sldns_buffer* pkt, struct rrset_parse* pset,
|
|||
struct packed_rrset_data** data, struct regional* region)
|
||||
{
|
||||
/* allocate */
|
||||
size_t s = sizeof(struct packed_rrset_data) +
|
||||
size_t s;
|
||||
if(pset->rr_count > RR_COUNT_MAX || pset->rrsig_count > RR_COUNT_MAX ||
|
||||
pset->size > RR_COUNT_MAX)
|
||||
return 0; /* protect against integer overflow */
|
||||
s = sizeof(struct packed_rrset_data) +
|
||||
(pset->rr_count + pset->rrsig_count) *
|
||||
(sizeof(size_t)+sizeof(uint8_t*)+sizeof(time_t)) +
|
||||
pset->size;
|
||||
|
|
6
external/unbound/util/data/packed_rrset.c
vendored
6
external/unbound/util/data/packed_rrset.c
vendored
|
@ -47,9 +47,9 @@
|
|||
#include "util/alloc.h"
|
||||
#include "util/regional.h"
|
||||
#include "util/net_help.h"
|
||||
#include "ldns/rrdef.h"
|
||||
#include "ldns/sbuffer.h"
|
||||
#include "ldns/wire2str.h"
|
||||
#include "sldns/rrdef.h"
|
||||
#include "sldns/sbuffer.h"
|
||||
#include "sldns/wire2str.h"
|
||||
|
||||
void
|
||||
ub_packed_rrset_parsedelete(struct ub_packed_rrset_key* pkey,
|
||||
|
|
6
external/unbound/util/data/packed_rrset.h
vendored
6
external/unbound/util/data/packed_rrset.h
vendored
|
@ -58,6 +58,12 @@ typedef uint64_t rrset_id_t;
|
|||
* from the SOA in the answer section from a direct SOA query or ANY query. */
|
||||
#define PACKED_RRSET_SOA_NEG 0x4
|
||||
|
||||
/** number of rrs and rrsets for integer overflow protection. More than
|
||||
* this is not really possible (64K packet has much less RRs and RRsets) in
|
||||
* a message. And this is small enough that also multiplied there is no
|
||||
* integer overflow. */
|
||||
#define RR_COUNT_MAX 0xffffff
|
||||
|
||||
/**
|
||||
* The identifying information for an RRset.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue