aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/includes/hicn/transport/auth
diff options
context:
space:
mode:
Diffstat (limited to 'libtransport/includes/hicn/transport/auth')
-rw-r--r--libtransport/includes/hicn/transport/auth/crypto_hash.h4
-rw-r--r--libtransport/includes/hicn/transport/auth/signer.h8
-rw-r--r--libtransport/includes/hicn/transport/auth/verifier.h16
3 files changed, 14 insertions, 14 deletions
diff --git a/libtransport/includes/hicn/transport/auth/crypto_hash.h b/libtransport/includes/hicn/transport/auth/crypto_hash.h
index 3c734fee3..29ea27114 100644
--- a/libtransport/includes/hicn/transport/auth/crypto_hash.h
+++ b/libtransport/includes/hicn/transport/auth/crypto_hash.h
@@ -62,7 +62,7 @@ class CryptoHash {
void computeDigest(const utils::MemBuf *buffer);
// Return the computed hash
- std::vector<uint8_t> getDigest() const;
+ const utils::MemBuf::Ptr &getDigest() const;
// Return the computed hash as a string
std::string getStringDigest() const;
@@ -94,7 +94,7 @@ class CryptoHash {
private:
CryptoHashType digest_type_;
- std::vector<uint8_t> digest_;
+ utils::MemBuf::Ptr digest_;
std::size_t digest_size_;
};
diff --git a/libtransport/includes/hicn/transport/auth/signer.h b/libtransport/includes/hicn/transport/auth/signer.h
index 5a7598991..e1b3cae5c 100644
--- a/libtransport/includes/hicn/transport/auth/signer.h
+++ b/libtransport/includes/hicn/transport/auth/signer.h
@@ -46,9 +46,9 @@ class Signer {
virtual void signBuffer(const utils::MemBuf *buffer);
// Return the signature.
- std::vector<uint8_t> getSignature() const;
+ const utils::MemBuf::Ptr &getSignature() const;
- // Return the signature as a string
+ // Return the signature as a string.
std::string getStringSignature() const;
// Return the signature size in bytes.
@@ -65,12 +65,12 @@ class Signer {
// Return the hash algorithm associated to the signer.
CryptoHashType getHashType() const;
- // Print signature to stdout
+ // Print signature to stdout.
void display();
protected:
CryptoSuite suite_;
- std::vector<uint8_t> signature_;
+ utils::MemBuf::Ptr signature_;
std::size_t signature_len_;
std::shared_ptr<EVP_PKEY> key_;
CryptoHash key_id_;
diff --git a/libtransport/includes/hicn/transport/auth/verifier.h b/libtransport/includes/hicn/transport/auth/verifier.h
index 677a1efe4..c89138339 100644
--- a/libtransport/includes/hicn/transport/auth/verifier.h
+++ b/libtransport/includes/hicn/transport/auth/verifier.h
@@ -55,10 +55,10 @@ class Verifier {
// Verify a single packet or buffer.
virtual bool verifyPacket(PacketPtr packet);
virtual bool verifyBuffer(const std::vector<uint8_t> &buffer,
- const std::vector<uint8_t> &signature,
+ const utils::MemBuf::Ptr &signature,
CryptoHashType hash_type) = 0;
virtual bool verifyBuffer(const utils::MemBuf *buffer,
- const std::vector<uint8_t> &signature,
+ const utils::MemBuf::Ptr &signature,
CryptoHashType hash_type) = 0;
// Verify a batch of packets. Return a mapping from packet suffixes to their
@@ -111,10 +111,10 @@ class VoidVerifier : public Verifier {
public:
bool verifyPacket(PacketPtr packet) override;
bool verifyBuffer(const std::vector<uint8_t> &buffer,
- const std::vector<uint8_t> &signature,
+ const utils::MemBuf::Ptr &signature,
CryptoHashType hash_type) override;
bool verifyBuffer(const utils::MemBuf *buffer,
- const std::vector<uint8_t> &signature,
+ const utils::MemBuf::Ptr &signature,
CryptoHashType hash_type) override;
PolicyMap verifyPackets(const std::vector<PacketPtr> &packets) override;
@@ -144,10 +144,10 @@ class AsymmetricVerifier : public Verifier {
void useCertificate(std::shared_ptr<X509> cert);
bool verifyBuffer(const std::vector<uint8_t> &buffer,
- const std::vector<uint8_t> &signature,
+ const utils::MemBuf::Ptr &signature,
CryptoHashType hash_type) override;
bool verifyBuffer(const utils::MemBuf *buffer,
- const std::vector<uint8_t> &signature,
+ const utils::MemBuf::Ptr &signature,
CryptoHashType hash_type) override;
private:
@@ -167,10 +167,10 @@ class SymmetricVerifier : public Verifier {
void setPassphrase(const std::string &passphrase);
bool verifyBuffer(const std::vector<uint8_t> &buffer,
- const std::vector<uint8_t> &signature,
+ const utils::MemBuf::Ptr &signature,
CryptoHashType hash_type) override;
bool verifyBuffer(const utils::MemBuf *buffer,
- const std::vector<uint8_t> &signature,
+ const utils::MemBuf::Ptr &signature,
CryptoHashType hash_type) override;
protected: