Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C++ Interface
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
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
WZL-IQS-Public
Sensor Interfacing Language (SOIL)
C++ Interface
Commits
a30a00b9
Unverified
Commit
a30a00b9
authored
1 year ago
by
Tim Heß
Browse files
Options
Downloads
Patches
Plain Diff
use new ssl/tls openssh toolkit
Fixes
#647
parent
b47dcfda
No related branches found
No related tags found
1 merge request
!1
use new ssl/tls openssh toolkit
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/SIGN/Hasher.cpp
+8
-9
8 additions, 9 deletions
src/SIGN/Hasher.cpp
with
8 additions
and
9 deletions
src/SIGN/Hasher.cpp
+
8
−
9
View file @
a30a00b9
#include
"Hasher.h"
#include
<openssl/
sha
.h>
#include
<openssl/
evp
.h>
#include
<sstream>
#include
<iomanip>
std
::
vector
<
unsigned
char
>
SIGN
::
Hasher
::
sha256
(
const
unsigned
char
*
data
,
size_t
length
)
{
SHA256_CTX
context
;
SHA256_Init
(
&
context
);
SHA256_Update
(
&
context
,
data
,
length
);
std
::
vector
<
unsigned
char
>
buffer
(
SHA256_DIGEST_LENGTH
);
SHA256_Final
(
buffer
.
data
(),
&
context
);
EVP_MD_CTX
*
context
=
EVP_MD_CTX_new
();
EVP_DigestInit_ex
(
context
,
EVP_sha256
(),
NULL
);
EVP_DigestUpdate
(
context
,
data
,
length
);
std
::
vector
<
unsigned
char
>
buffer
(
EVP_MD_size
(
EVP_sha256
()));
EVP_DigestFinal_ex
(
context
,
buffer
.
data
(),
NULL
);
EVP_MD_CTX_free
(
context
);
return
buffer
;
}
SIGN
::
Hasher
::
Hasher
()
...
...
@@ -37,7 +36,7 @@ void SIGN::Hasher::reset()
size_t
SIGN
::
Hasher
::
size
(
void
)
{
return
SHA256_DIGEST_LENGTH
;
;
return
EVP_MD_size
(
EVP_sha256
())
;
}
std
::
string
SIGN
::
Hasher
::
print
(
std
::
vector
<
unsigned
char
>
bytes
,
bool
uppercase
)
...
...
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