Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
Dnsmasq
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Dnsmasq
Commits
b6e9e7c3
Commit
b6e9e7c3
authored
Jan 08, 2014
by
Simon Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle digest lengths greater than 1 block.
parent
0435d041
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
src/blockdata.c
src/blockdata.c
+8
-2
src/dnsmasq.h
src/dnsmasq.h
+1
-1
src/dnssec.c
src/dnssec.c
+3
-2
No files found.
src/blockdata.c
View file @
b6e9e7c3
...
...
@@ -96,18 +96,24 @@ void blockdata_free(struct blockdata *blocks)
}
}
void
blockdata_retrieve
(
struct
blockdata
*
block
,
size_t
len
,
void
*
data
)
/* copy blocks into data[], return 1 if data[] unchanged by so doing */
int
blockdata_retrieve
(
struct
blockdata
*
block
,
size_t
len
,
void
*
data
)
{
size_t
blen
;
struct
blockdata
*
b
;
int
match
=
1
;
for
(
b
=
block
;
len
>
0
&&
b
;
b
=
b
->
next
)
{
blen
=
len
>
KEYBLOCK_LEN
?
KEYBLOCK_LEN
:
len
;
if
(
memcmp
(
data
,
b
->
key
,
blen
)
!=
0
)
match
=
0
;
memcpy
(
data
,
b
->
key
,
blen
);
data
+=
blen
;
len
-=
blen
;
}
return
match
;
}
#endif
src/dnsmasq.h
View file @
b6e9e7c3
...
...
@@ -993,7 +993,7 @@ struct crec *cache_enumerate(int init);
void
blockdata_report
(
void
);
struct
blockdata
*
blockdata_alloc
(
char
*
data
,
size_t
len
);
size_t
blockdata_walk
(
struct
blockdata
**
key
,
unsigned
char
**
p
,
size_t
cnt
);
void
blockdata_retrieve
(
struct
blockdata
*
block
,
size_t
len
,
void
*
data
);
int
blockdata_retrieve
(
struct
blockdata
*
block
,
size_t
len
,
void
*
data
);
void
blockdata_free
(
struct
blockdata
*
blocks
);
#endif
...
...
src/dnssec.c
View file @
b6e9e7c3
...
...
@@ -617,8 +617,8 @@ int dnssec_validate_by_ds(time_t now, struct dns_header *header, size_t plen, ch
from_wire
(
name
);
/* TODO fragented digest */
if
(
memcmp
(
digestalg_final
(),
recp1
->
addr
.
key
.
keydata
->
key
,
digestalg_len
())
==
0
&&
if
(
recp1
->
uid
==
digestalg_len
()
&&
blockdata_retrieve
(
recp1
->
addr
.
key
.
keydata
,
recp1
->
uid
,
digestalg_final
())
&&
validate_rrset
(
now
,
header
,
plen
,
class
,
T_DNSKEY
,
name
,
keyname
,
key
,
rdlen
-
4
,
algo
,
keytag
))
{
struct
all_addr
a
;
...
...
@@ -717,6 +717,7 @@ int dnssec_validate_ds(time_t now, struct dns_header *header, size_t plen, char
crecp
->
addr
.
key
.
keydata
=
key
;
crecp
->
addr
.
key
.
algo
=
algo
;
crecp
->
addr
.
key
.
keytag
=
keytag
;
crecp
->
uid
=
rdlen
-
4
;
}
else
return
STAT_INSECURE
;
/* cache problem */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment