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
b573aebc
Commit
b573aebc
authored
Apr 24, 2012
by
Giovanni Bajo
Committed by
Simon Kelley
Aug 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add skeleton for RSASHA256.
parent
d31d057a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
12 deletions
+39
-12
src/dnssec-crypto.h
src/dnssec-crypto.h
+1
-1
src/dnssec-openssl.c
src/dnssec-openssl.c
+37
-10
src/dnssec.c
src/dnssec.c
+1
-1
No files found.
src/dnssec-crypto.h
View file @
b573aebc
...
...
@@ -50,7 +50,7 @@ typedef struct
alg ## _verify \
}
/**/
/* Algorithm 5: RSASHA1 */
DEFINE_VALG
(
rsasha1
);
DEFINE_VALG
(
rsasha256
);
#endif
/* DNSSEC_CRYPTO_H */
src/dnssec-openssl.c
View file @
b573aebc
#include <string.h>
#include <openssl/evp.h>
struct
rsasha
1
_state
struct
rsasha_state
{
union
{
EVP_MD_CTX
hash
;
unsigned
char
digest
[
20
];
unsigned
char
digest
[
32
];
};
unsigned
char
*
sig
;
unsigned
siglen
;
}
RSASHA
1
;
}
RSASHA
;
int
rsasha1_set_signature
(
unsigned
char
*
data
,
unsigned
len
)
{
RSASHA1
.
sig
=
data
;
RSASHA1
.
siglen
=
len
;
RSASHA
.
sig
=
data
;
RSASHA
.
siglen
=
len
;
return
1
;
}
int
rsasha256_set_signature
(
unsigned
char
*
data
,
unsigned
len
)
{
RSASHA
.
sig
=
data
;
RSASHA
.
siglen
=
len
;
return
1
;
}
void
rsasha1_begin_data
(
void
)
{
EVP_MD_CTX_init
(
&
RSASHA1
.
hash
);
EVP_DigestInit_ex
(
&
RSASHA1
.
hash
,
EVP_sha1
(),
NULL
);
EVP_MD_CTX_init
(
&
RSASHA
.
hash
);
EVP_DigestInit_ex
(
&
RSASHA
.
hash
,
EVP_sha1
(),
NULL
);
}
void
rsasha256_begin_data
(
void
)
{
EVP_MD_CTX_init
(
&
RSASHA
.
hash
);
EVP_DigestInit_ex
(
&
RSASHA
.
hash
,
EVP_sha256
(),
NULL
);
}
void
rsasha1_add_data
(
void
*
data
,
unsigned
len
)
{
EVP_DigestUpdate
(
&
RSASHA1
.
hash
,
data
,
len
);
EVP_DigestUpdate
(
&
RSASHA
.
hash
,
data
,
len
);
}
void
rsasha256_add_data
(
void
*
data
,
unsigned
len
)
{
EVP_DigestUpdate
(
&
RSASHA
.
hash
,
data
,
len
);
}
void
rsasha1_end_data
(
void
)
{
unsigned
char
digest
[
20
];
EVP_DigestFinal
(
&
RSASHA1
.
hash
,
digest
,
NULL
);
memcpy
(
RSASHA1
.
digest
,
digest
,
20
);
EVP_DigestFinal
(
&
RSASHA
.
hash
,
digest
,
NULL
);
memcpy
(
RSASHA
.
digest
,
digest
,
20
);
}
void
rsasha256_end_data
(
void
)
{
unsigned
char
digest
[
32
];
EVP_DigestFinal
(
&
RSASHA
.
hash
,
digest
,
NULL
);
memcpy
(
RSASHA
.
digest
,
digest
,
32
);
}
int
rsasha1_verify
(
unsigned
char
*
key
,
unsigned
key_len
)
...
...
@@ -43,3 +65,8 @@ int rsasha1_verify(unsigned char *key, unsigned key_len)
return
0
;
}
int
rsasha256_verify
(
unsigned
char
*
key
,
unsigned
key_len
)
{
return
0
;
}
src/dnssec.c
View file @
b573aebc
...
...
@@ -23,7 +23,7 @@ static const VerifyAlg valgs[] =
VALG_VTABLE
(
rsasha1
),
/* 5: RSASHA1 */
{
0
,
0
,
0
,
0
,
0
},
/* 6: DSA-NSEC3-SHA1 */
{
0
,
0
,
0
,
0
,
0
},
/* 7: RSASHA1-NSEC3-SHA1 */
{
0
,
0
,
0
,
0
,
0
},
/* 8: RSASHA256 */
VALG_VTABLE
(
rsasha256
),
/* 8: RSASHA256 */
{
0
,
0
,
0
,
0
,
0
},
/* 9: unassigned */
{
0
,
0
,
0
,
0
,
0
},
/* 10: RSASHA512 */
{
0
,
0
,
0
,
0
,
0
},
/* 11: unassigned */
...
...
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