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
5c328419
Commit
5c328419
authored
May 02, 2012
by
Giovanni Bajo
Committed by
Simon Kelley
Aug 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement RSA-SHA512.
parent
ccd1d32c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
src/dnssec-crypto.h
src/dnssec-crypto.h
+2
-1
src/dnssec-openssl.c
src/dnssec-openssl.c
+12
-4
No files found.
src/dnssec-crypto.h
View file @
5c328419
...
@@ -41,7 +41,7 @@ struct VerifyAlgCtx
...
@@ -41,7 +41,7 @@ struct VerifyAlgCtx
const
VerifyAlg
*
vtbl
;
const
VerifyAlg
*
vtbl
;
unsigned
char
*
sig
;
unsigned
char
*
sig
;
size_t
siglen
;
size_t
siglen
;
unsigned
char
digest
[
32
];
unsigned
char
digest
[
64
];
/* TODO: if memory problems, use VLA */
};
};
int
verifyalg_supported
(
int
algo
);
int
verifyalg_supported
(
int
algo
);
...
@@ -55,6 +55,7 @@ int verifyalg_algonum(VerifyAlgCtx *a);
...
@@ -55,6 +55,7 @@ int verifyalg_algonum(VerifyAlgCtx *a);
#define DIGESTALG_SHA1 1
#define DIGESTALG_SHA1 1
#define DIGESTALG_SHA256 2
#define DIGESTALG_SHA256 2
#define DIGESTALG_MD5 256
#define DIGESTALG_MD5 256
#define DIGESTALG_SHA512 257
int
digestalg_supported
(
int
algo
);
int
digestalg_supported
(
int
algo
);
int
digestalg_begin
(
int
algo
);
int
digestalg_begin
(
int
algo
);
...
...
src/dnssec-openssl.c
View file @
5c328419
...
@@ -107,6 +107,11 @@ static int rsasha256_verify(VerifyAlgCtx *ctx, struct keydata *key_data, unsigne
...
@@ -107,6 +107,11 @@ static int rsasha256_verify(VerifyAlgCtx *ctx, struct keydata *key_data, unsigne
return
rsa_verify
(
ctx
,
key_data
,
key_len
,
NID_sha256
,
32
);
return
rsa_verify
(
ctx
,
key_data
,
key_len
,
NID_sha256
,
32
);
}
}
static
int
rsasha512_verify
(
VerifyAlgCtx
*
ctx
,
struct
keydata
*
key_data
,
unsigned
key_len
)
{
return
rsa_verify
(
ctx
,
key_data
,
key_len
,
NID_sha512
,
64
);
}
static
int
dsasha1_verify
(
VerifyAlgCtx
*
ctx
,
struct
keydata
*
key_data
,
unsigned
key_len
)
static
int
dsasha1_verify
(
VerifyAlgCtx
*
ctx
,
struct
keydata
*
key_data
,
unsigned
key_len
)
{
{
static
unsigned
char
asn1_signature
[]
=
static
unsigned
char
asn1_signature
[]
=
...
@@ -159,11 +164,11 @@ static const VerifyAlg valgs[] =
...
@@ -159,11 +164,11 @@ static const VerifyAlg valgs[] =
VALG_VTABLE
(
dsasha1
,
DIGESTALG_SHA1
),
/* 3: DSA */
VALG_VTABLE
(
dsasha1
,
DIGESTALG_SHA1
),
/* 3: DSA */
VALG_UNSUPPORTED
(),
/* 4: ECC */
VALG_UNSUPPORTED
(),
/* 4: ECC */
VALG_VTABLE
(
rsasha1
,
DIGESTALG_SHA1
),
/* 5: RSASHA1 */
VALG_VTABLE
(
rsasha1
,
DIGESTALG_SHA1
),
/* 5: RSASHA1 */
VALG_
UNSUPPORTED
(),
/* 6: DSA-NSEC3-SHA1 */
VALG_
VTABLE
(
dsasha1
,
DIGESTALG_SHA1
),
/* 6: DSA-NSEC3-SHA1 */
VALG_VTABLE
(
rsasha1
,
DIGESTALG_SHA1
),
/* 7: RSASHA1-NSEC3-SHA1 */
VALG_VTABLE
(
rsasha1
,
DIGESTALG_SHA1
),
/* 7: RSASHA1-NSEC3-SHA1 */
VALG_VTABLE
(
rsasha256
,
DIGESTALG_SHA256
),
/* 8: RSASHA256 */
VALG_VTABLE
(
rsasha256
,
DIGESTALG_SHA256
),
/* 8: RSASHA256 */
VALG_UNSUPPORTED
(),
/* 9: unassigned */
VALG_UNSUPPORTED
(),
/* 9: unassigned */
VALG_
UNSUPPORTED
(),
/* 10: RSASHA512 */
VALG_
VTABLE
(
rsasha512
,
DIGESTALG_SHA512
),
/* 10: RSASHA512 */
VALG_UNSUPPORTED
(),
/* 11: unassigned */
VALG_UNSUPPORTED
(),
/* 11: unassigned */
VALG_UNSUPPORTED
(),
/* 12: ECC-GOST */
VALG_UNSUPPORTED
(),
/* 12: ECC-GOST */
VALG_UNSUPPORTED
(),
/* 13: ECDSAP256SHA256 */
VALG_UNSUPPORTED
(),
/* 13: ECDSAP256SHA256 */
...
@@ -184,7 +189,7 @@ static const int valgctx_size[] =
...
@@ -184,7 +189,7 @@ static const int valgctx_size[] =
sizeof
(
VerifyAlgCtx
),
/* 7: RSASHA1-NSEC3-SHA1 */
sizeof
(
VerifyAlgCtx
),
/* 7: RSASHA1-NSEC3-SHA1 */
sizeof
(
VerifyAlgCtx
),
/* 8: RSASHA256 */
sizeof
(
VerifyAlgCtx
),
/* 8: RSASHA256 */
0
,
/* 9: unassigned */
0
,
/* 9: unassigned */
0
,
/* 10: RSASHA512 */
sizeof
(
VerifyAlgCtx
),
/* 10: RSASHA512 */
0
,
/* 11: unassigned */
0
,
/* 11: unassigned */
0
,
/* 12: ECC-GOST */
0
,
/* 12: ECC-GOST */
0
,
/* 13: ECDSAP256SHA256 */
0
,
/* 13: ECDSAP256SHA256 */
...
@@ -246,7 +251,8 @@ int digestalg_supported(int algo)
...
@@ -246,7 +251,8 @@ int digestalg_supported(int algo)
{
{
return
(
algo
==
DIGESTALG_SHA1
||
return
(
algo
==
DIGESTALG_SHA1
||
algo
==
DIGESTALG_SHA256
||
algo
==
DIGESTALG_SHA256
||
algo
==
DIGESTALG_MD5
);
algo
==
DIGESTALG_MD5
||
algo
==
DIGESTALG_SHA512
);
}
}
int
digestalg_begin
(
int
algo
)
int
digestalg_begin
(
int
algo
)
...
@@ -256,6 +262,8 @@ int digestalg_begin(int algo)
...
@@ -256,6 +262,8 @@ int digestalg_begin(int algo)
EVP_DigestInit_ex
(
&
digctx
,
EVP_sha1
(),
NULL
);
EVP_DigestInit_ex
(
&
digctx
,
EVP_sha1
(),
NULL
);
else
if
(
algo
==
DIGESTALG_SHA256
)
else
if
(
algo
==
DIGESTALG_SHA256
)
EVP_DigestInit_ex
(
&
digctx
,
EVP_sha256
(),
NULL
);
EVP_DigestInit_ex
(
&
digctx
,
EVP_sha256
(),
NULL
);
else
if
(
algo
==
DIGESTALG_SHA512
)
EVP_DigestInit_ex
(
&
digctx
,
EVP_sha512
(),
NULL
);
else
if
(
algo
==
DIGESTALG_MD5
)
else
if
(
algo
==
DIGESTALG_MD5
)
EVP_DigestInit_ex
(
&
digctx
,
EVP_md5
(),
NULL
);
EVP_DigestInit_ex
(
&
digctx
,
EVP_md5
(),
NULL
);
else
else
...
...
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