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
38aa86de
Commit
38aa86de
authored
8 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
crypto/crl: add getIssuerName, getIssuerUID
parent
fdf476a3
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
+6
-0
6 additions, 0 deletions
include/opendht/crypto.h
src/crypto.cpp
+26
-0
26 additions, 0 deletions
src/crypto.cpp
with
32 additions
and
0 deletions
include/opendht/crypto.h
+
6
−
0
View file @
38aa86de
...
...
@@ -213,6 +213,12 @@ public:
*/
Blob
getNumber
()
const
;
/** Read CRL issuer Common Name (CN) */
std
::
string
getIssuerName
()
const
;
/** Read CRL issuer User ID (UID) */
std
::
string
getIssuerUID
()
const
;
time_point
getUpdateTime
()
const
;
time_point
getNextUpdateTime
()
const
;
...
...
This diff is collapsed.
Click to expand it.
src/crypto.cpp
+
26
−
0
View file @
38aa86de
...
...
@@ -962,6 +962,32 @@ RevocationList::revoke(const Certificate& crt, std::chrono::system_clock::time_p
throw
CryptoException
(
std
::
string
(
"Can't revoke certificate: "
)
+
gnutls_strerror
(
err
));
}
static
std
::
string
getCRLIssuerDN
(
gnutls_x509_crl_t
cert
,
const
char
*
oid
)
{
std
::
string
dn
;
dn
.
resize
(
512
);
size_t
dn_sz
=
dn
.
size
();
int
ret
=
gnutls_x509_crl_get_issuer_dn_by_oid
(
cert
,
oid
,
0
,
0
,
&
(
*
dn
.
begin
()),
&
dn_sz
);
if
(
ret
!=
GNUTLS_E_SUCCESS
)
return
{};
dn
.
resize
(
dn_sz
);
return
dn
;
}
std
::
string
RevocationList
::
getIssuerName
()
const
{
return
getCRLIssuerDN
(
crl
,
GNUTLS_OID_X520_COMMON_NAME
);
}
/** Read CRL issuer User ID (UID) */
std
::
string
RevocationList
::
getIssuerUID
()
const
{
return
getCRLIssuerDN
(
crl
,
GNUTLS_OID_LDAP_UID
);
}
RevocationList
::
time_point
RevocationList
::
getNextUpdateTime
()
const
{
...
...
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