aboutsummaryrefslogtreecommitdiffstats
path: root/libparc/parc/security/parc_Signer.c
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2019-02-06 12:05:58 +0100
committerAlberto Compagno <acompagn+fdio@cisco.com>2019-02-06 12:05:58 +0100
commitb77148ddc3def71e6c412c3afb5f1c20be2d77cd (patch)
tree53e6db3aa4f3fa6cb5cb5bd4e219cd0d50d7c0f4 /libparc/parc/security/parc_Signer.c
parent4e710f08b38954194e1a67159403f31b10ad7afb (diff)
[CICN-14] Removed copy of signature in libparc. The api now accepts a pointer to a buf where it stores the computed signature
Change-Id: I4427a6399b5e74197303bade4f96ea74b370b07b Signed-off-by: Alberto Compagno <acompagn+fdio@cisco.com>
Diffstat (limited to 'libparc/parc/security/parc_Signer.c')
-rw-r--r--libparc/parc/security/parc_Signer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libparc/parc/security/parc_Signer.c b/libparc/parc/security/parc_Signer.c
index 70b8f616..2d3c7465 100644
--- a/libparc/parc/security/parc_Signer.c
+++ b/libparc/parc/security/parc_Signer.c
@@ -108,16 +108,16 @@ parcSigner_GetCryptoHasher(const PARCSigner *signer)
}
PARCSignature *
-parcSigner_SignDigest(const PARCSigner *signer, const PARCCryptoHash *parcDigest)
+parcSigner_SignDigest(const PARCSigner *signer, const PARCCryptoHash *parcDigest, uint8_t * signature, uint32_t sig_len)
{
parcSigner_OptionalAssertValid(signer);
parcAssertNotNull(parcDigest, "parcDigest to sign must not be null");
- return signer->interface->SignDigest(signer->instance, parcDigest);
+ return signer->interface->SignDigest(signer->instance, parcDigest, signature, sig_len);
}
PARCSignature *
-parcSigner_SignBuffer(const PARCSigner *signer, const PARCBuffer *buffer)
+parcSigner_SignBuffer(const PARCSigner *signer, const PARCBuffer *buffer, uint8_t * signature_buf, uint32_t sig_len)
{
parcSigner_OptionalAssertValid(signer);
parcAssertNotNull(buffer, "buffer to sign must not be null");
@@ -129,7 +129,7 @@ parcSigner_SignBuffer(const PARCSigner *signer, const PARCBuffer *buffer)
PARCCryptoHash *hash = parcCryptoHasher_Finalize(hasher);
parcCryptoHasher_Release(&hasher);
- PARCSignature *signature = parcSigner_SignDigest(signer, hash);
+ PARCSignature *signature = parcSigner_SignDigest(signer, hash, signature_buf, sig_len);
parcCryptoHash_Release(&hash);
return signature;