Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP OpenSSL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP OpenSSL
Commits
a87a0a6e
Commit
a87a0a6e
authored
9 years ago
by
Richard Levitte
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup: fix all sources that used HMAC_CTX_init
Reviewed-by:
Rich Salz
<
rsalz@openssl.org
>
parent
dc0099e1
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
crypto/evp/p5_crpt2.c
+2
-2
2 additions, 2 deletions
crypto/evp/p5_crpt2.c
crypto/hmac/hmac.c
+2
-2
2 additions, 2 deletions
crypto/hmac/hmac.c
test/hmactest.c
+2
-2
2 additions, 2 deletions
test/hmactest.c
with
6 additions
and
6 deletions
crypto/evp/p5_crpt2.c
+
2
−
2
View file @
a87a0a6e
...
...
@@ -134,7 +134,7 @@ int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
HMAC_CTX_free
(
hctx_tpl
);
return
0
;
}
HMAC_CTX_
ini
t
(
hctx
);
HMAC_CTX_
rese
t
(
hctx
);
memcpy
(
p
,
digtmp
,
cplen
);
for
(
j
=
1
;
j
<
iter
;
j
++
)
{
if
(
!
HMAC_CTX_copy
(
hctx
,
hctx_tpl
))
{
...
...
@@ -148,7 +148,7 @@ int PKCS5_PBKDF2_HMAC(const char *pass, int passlen,
HMAC_CTX_free
(
hctx_tpl
);
return
0
;
}
HMAC_CTX_
ini
t
(
hctx
);
HMAC_CTX_
rese
t
(
hctx
);
for
(
k
=
0
;
k
<
cplen
;
k
++
)
p
[
k
]
^=
digtmp
[
k
];
}
...
...
This diff is collapsed.
Click to expand it.
crypto/hmac/hmac.c
+
2
−
2
View file @
a87a0a6e
...
...
@@ -131,7 +131,7 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
int
HMAC_Init
(
HMAC_CTX
*
ctx
,
const
void
*
key
,
int
len
,
const
EVP_MD
*
md
)
{
if
(
key
&&
md
)
HMAC_CTX_
ini
t
(
ctx
);
HMAC_CTX_
rese
t
(
ctx
);
return
HMAC_Init_ex
(
ctx
,
key
,
len
,
md
,
NULL
);
}
#endif
...
...
@@ -225,7 +225,7 @@ int HMAC_CTX_reset(HMAC_CTX *ctx)
int
HMAC_CTX_copy
(
HMAC_CTX
*
dctx
,
HMAC_CTX
*
sctx
)
{
if
(
!
HMAC_CTX_
ini
t
(
dctx
))
if
(
!
HMAC_CTX_
rese
t
(
dctx
))
goto
err
;
if
(
!
EVP_MD_CTX_copy_ex
(
dctx
->
i_ctx
,
sctx
->
i_ctx
))
goto
err
;
...
...
This diff is collapsed.
Click to expand it.
test/hmactest.c
+
2
−
2
View file @
a87a0a6e
...
...
@@ -193,7 +193,7 @@ int main(int argc, char *argv[])
}
printf
(
"test 4 ok
\n
"
);
test5:
HMAC_CTX_
ini
t
(
ctx
);
HMAC_CTX_
rese
t
(
ctx
);
if
(
HMAC_Init_ex
(
ctx
,
test
[
4
].
key
,
test
[
4
].
key_len
,
NULL
,
NULL
))
{
printf
(
"Should fail to initialise HMAC with empty MD (test 5)
\n
"
);
err
++
;
...
...
@@ -282,7 +282,7 @@ test5:
printf
(
"test 5 ok
\n
"
);
}
test6:
HMAC_CTX_
ini
t
(
ctx
);
HMAC_CTX_
rese
t
(
ctx
);
ctx2
=
HMAC_CTX_new
();
if
(
ctx2
==
NULL
)
{
printf
(
"HMAC malloc failure (test 6)
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment