Skip to content
Snippets Groups Projects
Commit e9adff9d authored by Adrien Béraud's avatar Adrien Béraud
Browse files

crypto: add CRL move operator, export as DER

parent bfd58a20
Branches
Tags
No related merge requests found
......@@ -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 {
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment