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
262ac851
Commit
262ac851
authored
Apr 27, 2012
by
Giovanni Bajo
Committed by
Simon Kelley
Aug 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
verify() function must take a keydata chained buffer for input key.
parent
4c70046d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
23 deletions
+7
-23
src/dnssec-crypto.h
src/dnssec-crypto.h
+3
-1
src/dnssec-openssl.c
src/dnssec-openssl.c
+3
-3
src/dnssec.c
src/dnssec.c
+1
-19
No files found.
src/dnssec-crypto.h
View file @
262ac851
#ifndef DNSSEC_CRYPTO_H
#ifndef DNSSEC_CRYPTO_H
#define DNSSEC_CRYPTO_H
#define DNSSEC_CRYPTO_H
struct
keydata
;
/*
/*
* vtable for a signature verification algorithm.
* vtable for a signature verification algorithm.
*
*
...
@@ -34,7 +36,7 @@ typedef struct
...
@@ -34,7 +36,7 @@ typedef struct
void
(
*
begin_data
)(
VerifyAlgCtx
*
ctx
);
void
(
*
begin_data
)(
VerifyAlgCtx
*
ctx
);
void
(
*
add_data
)(
VerifyAlgCtx
*
ctx
,
void
*
data
,
unsigned
len
);
void
(
*
add_data
)(
VerifyAlgCtx
*
ctx
,
void
*
data
,
unsigned
len
);
void
(
*
end_data
)(
VerifyAlgCtx
*
ctx
);
void
(
*
end_data
)(
VerifyAlgCtx
*
ctx
);
int
(
*
verify
)(
VerifyAlgCtx
*
ctx
,
unsigned
char
*
key
,
unsigned
key_len
);
int
(
*
verify
)(
VerifyAlgCtx
*
ctx
,
struct
keydata
*
key
,
unsigned
key_len
);
}
VerifyAlg
;
}
VerifyAlg
;
struct
VerifyAlgCtx
struct
VerifyAlgCtx
...
...
src/dnssec-openssl.c
View file @
262ac851
...
@@ -90,13 +90,13 @@ static void rsasha256_end_data(VerifyAlgCtx *ctx_)
...
@@ -90,13 +90,13 @@ static void rsasha256_end_data(VerifyAlgCtx *ctx_)
memcpy
(
ctx
->
digest
,
digest
,
32
);
memcpy
(
ctx
->
digest
,
digest
,
32
);
}
}
static
int
rsasha1_verify
(
VerifyAlgCtx
*
ctx_
,
unsigned
char
*
key
,
unsigned
key_len
)
static
int
rsasha1_verify
(
VerifyAlgCtx
*
ctx_
,
struct
keydata
*
key_data
,
unsigned
key_len
)
{
{
VACTX_rsasha1
*
ctx
=
(
VACTX_rsasha1
*
)
ctx_
;
VACTX_rsasha1
*
ctx
=
(
VACTX_rsasha1
*
)
ctx_
;
return
0
;
return
0
;
}
}
static
int
rsasha256_verify
(
VerifyAlgCtx
*
ctx_
,
unsigned
char
*
key
,
unsigned
key_len
)
static
int
rsasha256_verify
(
VerifyAlgCtx
*
ctx_
,
struct
keydata
*
key
,
unsigned
key_len
)
{
{
VACTX_rsasha256
*
ctx
=
(
VACTX_rsasha256
*
)
ctx_
;
VACTX_rsasha256
*
ctx
=
(
VACTX_rsasha256
*
)
ctx_
;
return
0
;
return
0
;
...
@@ -107,7 +107,7 @@ static int rsasha256_verify(VerifyAlgCtx *ctx_, unsigned char *key, unsigned key
...
@@ -107,7 +107,7 @@ static int rsasha256_verify(VerifyAlgCtx *ctx_, unsigned char *key, unsigned key
void alg ## _begin_data(VerifyAlgCtx *ctx); \
void alg ## _begin_data(VerifyAlgCtx *ctx); \
void alg ## _add_data(VerifyAlgCtx *ctx, void *data, unsigned len); \
void alg ## _add_data(VerifyAlgCtx *ctx, void *data, unsigned len); \
void alg ## _end_data(VerifyAlgCtx *ctx); \
void alg ## _end_data(VerifyAlgCtx *ctx); \
int alg ## _verify(VerifyAlgCtx *ctx,
unsigned char
*key, unsigned key_len) \
int alg ## _verify(VerifyAlgCtx *ctx,
struct keydata
*key, unsigned key_len) \
/**/
/**/
#define VALG_VTABLE(alg) { \
#define VALG_VTABLE(alg) { \
...
...
src/dnssec.c
View file @
262ac851
...
@@ -285,25 +285,7 @@ int dnssec_parsekey(struct dns_header *header, size_t pktlen, char *owner, unsig
...
@@ -285,25 +285,7 @@ int dnssec_parsekey(struct dns_header *header, size_t pktlen, char *owner, unsig
if
(
!
(
flags
&
0x100
))
if
(
!
(
flags
&
0x100
))
return
0
;
return
0
;
switch
(
alg
)
key
=
keydata_alloc
(
rdata
,
rdlen
);
{
case
5
:
/* RSASHA1 */
CHECKED_GETCHAR
(
explen
,
rdata
,
rdlen
);
if
(
explen
==
0
)
{
printf
(
"DNSKEY: RSASHA1: Unsupported huge exponents
\n
"
);
return
0
;
}
if
(
rdlen
<
explen
)
return
0
;
key
=
keydata_alloc
(
rdata
,
rdlen
);
break
;
default:
printf
(
"DNSKEY: Unsupported algorithm: %d
\n
"
,
alg
);
return
0
;
}
/* TODO: time(0) is correct here? */
/* TODO: time(0) is correct here? */
crecp
=
cache_insert
(
owner
,
NULL
,
time
(
0
),
ttl
,
F_FORWARD
|
F_DNSKEY
);
crecp
=
cache_insert
(
owner
,
NULL
,
time
(
0
),
ttl
,
F_FORWARD
|
F_DNSKEY
);
...
...
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