Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
f1051fd4
Commit
f1051fd4
authored
Aug 10, 2019
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix constants to be consistent with SHA-256.
Also rename DIGEST_LEN to MAX_DIGEST_LEN.
parent
9688b688
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
hmac.c
hmac.c
+2
-2
hmac.h
hmac.h
+1
-3
No files found.
hmac.c
View file @
f1051fd4
...
...
@@ -226,7 +226,7 @@ add_hmac(struct buffered *buf, struct interface *ifp,
}
src
=
ifp
->
ll
[
0
];
if
(
buf
->
len
+
2
+
DIGEST_LEN
>
buf
->
size
)
{
if
(
buf
->
len
+
2
+
MAX_
DIGEST_LEN
>
buf
->
size
)
{
fprintf
(
stderr
,
"Buffer overflow in add_hmac.
\n
"
);
return
-
1
;
}
...
...
@@ -248,7 +248,7 @@ compare_hmac(const unsigned char *src, const unsigned char *dst,
const
unsigned
char
*
packet
,
int
bodylen
,
const
unsigned
char
*
hmac
,
int
hmaclen
)
{
unsigned
char
true_hmac
[
DIGEST_LEN
];
unsigned
char
true_hmac
[
MAX_
DIGEST_LEN
];
int
true_hmaclen
;
int
i
;
for
(
i
=
0
;
i
<
numkeys
;
i
++
)
{
...
...
hmac.h
View file @
f1051fd4
...
...
@@ -20,9 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#define DIGEST_LEN 20
#define SHA1_BLOCK_SIZE 64
#define RIPEMD160_BLOCK_SIZE 64
#define MAX_DIGEST_LEN 32
struct
key
*
find_key
(
const
char
*
id
);
struct
key
*
retain_key
(
struct
key
*
key
);
...
...
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