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
e9adff9d
Commit
e9adff9d
authored
8 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
crypto: add CRL move operator, export as DER
parent
bfd58a20
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/opendht/crypto.h
+3
-0
3 additions, 0 deletions
include/opendht/crypto.h
src/crypto.cpp
+1
-1
1 addition, 1 deletion
src/crypto.cpp
with
4 additions
and
1 deletion
include/opendht/crypto.h
+
3
−
0
View file @
e9adff9d
...
...
@@ -327,8 +327,11 @@ class OPENDHT_PUBLIC RevocationList
public:
RevocationList
();
RevocationList
(
const
Blob
&
b
);
RevocationList
(
RevocationList
&&
o
)
:
crl
(
o
.
crl
)
{
o
.
crl
=
nullptr
;
}
~
RevocationList
();
RevocationList
&
operator
=
(
RevocationList
&&
o
)
{
crl
=
o
.
crl
;
o
.
crl
=
nullptr
;
return
*
this
;
}
void
pack
(
Blob
&
b
)
const
;
void
unpack
(
const
uint8_t
*
dat
,
size_t
dat_size
);
Blob
getPacked
()
const
{
...
...
This diff is collapsed.
Click to expand it.
src/crypto.cpp
+
1
−
1
View file @
e9adff9d
...
...
@@ -865,7 +865,7 @@ void
RevocationList
::
pack
(
Blob
&
b
)
const
{
gnutls_datum_t
gdat
{
nullptr
,
0
};
if
(
auto
err
=
gnutls_x509_crl_export2
(
crl
,
GNUTLS_X509_FMT_
PEM
,
&
gdat
))
{
if
(
auto
err
=
gnutls_x509_crl_export2
(
crl
,
GNUTLS_X509_FMT_
DER
,
&
gdat
))
{
throw
CryptoException
(
std
::
string
(
"Can't export CRL: "
)
+
gnutls_strerror
(
err
));
}
b
.
insert
(
b
.
end
(),
gdat
.
data
,
gdat
.
data
+
gdat
.
size
);
...
...
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