Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
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
savoirfairelinux
opendht
Commits
f82c68a8
Commit
f82c68a8
authored
2 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
crypto: remove support for GnuTLS < 3.4
parent
3f4235da
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/crypto.cpp
+0
-18
0 additions, 18 deletions
src/crypto.cpp
with
0 additions
and
18 deletions
src/crypto.cpp
+
0
−
18
View file @
f82c68a8
...
...
@@ -43,18 +43,6 @@ static std::uniform_int_distribution<int> rand_byte{ 0, std::numeric_limits<uint
static
std
::
uniform_int_distribution
<
uint8_t
>
rand_byte
;
#endif
// support for GnuTLS < 3.4.
#if GNUTLS_VERSION_NUMBER < 0x030400
#define GNUTLS_PKCS_PKCS12_3DES GNUTLS_PKCS_USE_PKCS12_3DES
#define GNUTLS_PKCS_PKCS12_ARCFOUR GNUTLS_PKCS_USE_PKCS12_ARCFOUR
#define GNUTLS_PKCS_PKCS12_RC2_40 GNUTLS_PKCS_USE_PKCS12_RC2_40
#define GNUTLS_PKCS_PBES2_3DES GNUTLS_PKCS_USE_PBES2_3DES
#define GNUTLS_PKCS_PBES2_AES_128 GNUTLS_PKCS_USE_PBES2_AES_128
#define GNUTLS_PKCS_PBES2_AES_192 GNUTLS_PKCS_USE_PBES2_AES_192
#define GNUTLS_PKCS_PBES2_AES_256 GNUTLS_PKCS_USE_PBES2_AES_256
#endif
#define DHT_AES_LEGACY_ENCRYPT 0
#define DHT_AES_LEGACY_DECRYPT 1
namespace
dht
{
...
...
@@ -110,10 +98,6 @@ Blob aesEncrypt(const uint8_t* data, size_t data_length, const Blob& key)
struct
gcm_aes_ctx
aes
;
gcm_aes_set_key
(
&
aes
,
key
.
size
(),
key
.
data
());
gcm_aes_set_iv
(
&
aes
,
GCM_IV_SIZE
,
ret
.
data
());
#if DHT_AES_LEGACY_ENCRYPT
gcm_aes_update
(
&
aes
,
data_length
,
data
);
#endif
gcm_aes_encrypt
(
&
aes
,
data_length
,
ret
.
data
()
+
GCM_IV_SIZE
,
data
);
gcm_aes_digest
(
&
aes
,
GCM_DIGEST_SIZE
,
ret
.
data
()
+
GCM_IV_SIZE
+
data_length
);
return
ret
;
...
...
@@ -1771,10 +1755,8 @@ std::ostream& operator<< (std::ostream& o, const TrustList::VerifyResult& h)
o
<<
"* Certificate has expired"
<<
std
::
endl
;
if
(
h
.
result
&
GNUTLS_CERT_UNEXPECTED_OWNER
)
o
<<
"* The owner is not the expected one"
<<
std
::
endl
;
#if GNUTLS_VERSION_NUMBER >= 0x030401
if
(
h
.
result
&
GNUTLS_CERT_PURPOSE_MISMATCH
)
o
<<
"* Certificate or an intermediate does not match the intended purpose"
<<
std
::
endl
;
#endif
if
(
h
.
result
&
GNUTLS_CERT_MISMATCH
)
o
<<
"* Certificate presented isn't the expected one"
<<
std
::
endl
;
}
else
{
...
...
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