diff options
author | Alberto Compagno <acompagn+fdio@cisco.com> | 2019-02-06 12:05:58 +0100 |
---|---|---|
committer | Alberto Compagno <acompagn+fdio@cisco.com> | 2019-02-06 12:05:58 +0100 |
commit | b77148ddc3def71e6c412c3afb5f1c20be2d77cd (patch) | |
tree | 53e6db3aa4f3fa6cb5cb5bd4e219cd0d50d7c0f4 /libparc/parc/security/parc_SymmetricKeySigner.c | |
parent | 4e710f08b38954194e1a67159403f31b10ad7afb (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_SymmetricKeySigner.c')
-rw-r--r-- | libparc/parc/security/parc_SymmetricKeySigner.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libparc/parc/security/parc_SymmetricKeySigner.c b/libparc/parc/security/parc_SymmetricKeySigner.c index 9f760326..5f87b945 100644 --- a/libparc/parc/security/parc_SymmetricKeySigner.c +++ b/libparc/parc/security/parc_SymmetricKeySigner.c @@ -261,11 +261,11 @@ _GetSignatureSize(PARCSymmetricKeySigner *signer) * @param hashToSign is the HMAC computed by the our PARCCryptoHasher. */ static PARCSignature * -_signDigest(PARCSymmetricKeySigner *interfaceContext, const PARCCryptoHash *hashToSign) +_signDigest(PARCSymmetricKeySigner *interfaceContext, const PARCCryptoHash *hashToSign, uint8_t * signature, uint32_t sig_len) { // The digest computed via our hash function (hmac) is the actual signature. // just need to wrap it up with the right parameters. - PARCBuffer *signatureBits = parcBuffer_Copy(parcCryptoHash_GetDigest(hashToSign)); + PARCBuffer *signatureBits = parcBuffer_Wrap(signature, sig_len, 0, sig_len);//parcBuffer_Copy(parcCryptoHash_GetDigest(hashToSign)); PARCSignature *result = parcSignature_Create(_getSigningAlgorithm(interfaceContext), parcCryptoHash_GetDigestType(hashToSign), signatureBits); parcBuffer_Release(&signatureBits); return result; @@ -274,7 +274,7 @@ _signDigest(PARCSymmetricKeySigner *interfaceContext, const PARCCryptoHash *hash PARCSigningInterface *PARCSymmetricKeySignerAsSigner = &(PARCSigningInterface) { .GetCryptoHashType = (PARCCryptoHashType (*)(void *))_getCryptoHashType, .GetCryptoHasher = (PARCCryptoHasher * (*)(void *))_getCryptoHasher, - .SignDigest = (PARCSignature * (*)(void *, const PARCCryptoHash *))_signDigest, + .SignDigest = (PARCSignature * (*)(void *, const PARCCryptoHash *, uint8_t *, uint32_t))_signDigest, .GetSigningAlgorithm = (PARCSigningAlgorithm (*)(void *))_getSigningAlgorithm, .GetKeyStore = (PARCKeyStore * (*)(void *))_getKeyStore, .GetSignatureSize = (size_t (*)(void *))_GetSignatureSize |