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
79e266aa
Commit
79e266aa
authored
8 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
crypto: don't build getLongID() with old gnutls
parent
9d75ed14
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/opendht/crypto.h
+4
-0
4 additions, 0 deletions
include/opendht/crypto.h
include/opendht/securedht.h
+2
-1
2 additions, 1 deletion
include/opendht/securedht.h
src/crypto.cpp
+4
-0
4 additions, 0 deletions
src/crypto.cpp
with
10 additions
and
1 deletion
include/opendht/crypto.h
+
4
−
0
View file @
79e266aa
...
...
@@ -83,7 +83,9 @@ struct OPENDHT_PUBLIC PublicKey
PublicKey
&
operator
=
(
PublicKey
&&
o
)
noexcept
;
InfoHash
getId
()
const
;
#if GNUTLS_VERSION_NUMBER >= 0x030401
PkId
getLongId
()
const
;
#endif
bool
checkSignature
(
const
Blob
&
data
,
const
Blob
&
signature
)
const
;
Blob
encrypt
(
const
Blob
&
)
const
;
...
...
@@ -362,7 +364,9 @@ struct OPENDHT_PUBLIC Certificate {
/** Same as getPublicKey().getId() */
InfoHash
getId
()
const
;
#if GNUTLS_VERSION_NUMBER >= 0x030401
PkId
getLongId
()
const
;
#endif
/** Read certificate Common Name (CN) */
std
::
string
getName
()
const
;
...
...
This diff is collapsed.
Click to expand it.
include/opendht/securedht.h
+
2
−
1
View file @
79e266aa
...
...
@@ -51,10 +51,11 @@ public:
InfoHash
getId
()
const
{
return
key_
?
key_
->
getPublicKey
().
getId
()
:
InfoHash
();
}
#if GNUTLS_VERSION_NUMBER >= 0x030401
PkId
getLongId
()
const
{
return
key_
?
key_
->
getPublicKey
().
getLongId
()
:
PkId
();
}
#endif
ValueType
secureType
(
ValueType
&&
type
);
ValueType
secureType
(
const
ValueType
&
type
)
{
...
...
This diff is collapsed.
Click to expand it.
src/crypto.cpp
+
4
−
0
View file @
79e266aa
...
...
@@ -532,6 +532,7 @@ PublicKey::getId() const
return
id
;
}
#if GNUTLS_VERSION_NUMBER >= 0x030401
PkId
PublicKey
::
getLongId
()
const
{
...
...
@@ -541,6 +542,7 @@ PublicKey::getLongId() const
return
{};
return
h
;
}
#endif
Certificate
::
Certificate
(
const
Blob
&
certData
)
:
cert
(
nullptr
)
{
...
...
@@ -646,6 +648,7 @@ Certificate::getId() const
return
id
;
}
#if GNUTLS_VERSION_NUMBER >= 0x030401
PkId
Certificate
::
getLongId
()
const
{
...
...
@@ -657,6 +660,7 @@ Certificate::getLongId() const
throw
CryptoException
(
"Can't get certificate public key ID."
);
return
id
;
}
#endif
static
std
::
string
getDN
(
gnutls_x509_crt_t
cert
,
const
char
*
oid
,
bool
issuer
=
false
)
...
...
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