diff --git a/include/opendht/crypto.h b/include/opendht/crypto.h index 9bba9ffd82a7ee8814eab5f425baf790ced85a93..d4cf548e810b08645fcbe62ae4d44f8c7b7f4e3b 100644 --- a/include/opendht/crypto.h +++ b/include/opendht/crypto.h @@ -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 { diff --git a/src/crypto.cpp b/src/crypto.cpp index 4a3c13c6debf99859a9c0e56ba313b6d882322df..fc1fedbad0a0c8ed83bed02778464b43922b4b7d 100644 --- a/src/crypto.cpp +++ b/src/crypto.cpp @@ -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);