diff options
author | Devel <acompagn+fdio@cisco.com> | 2018-04-16 16:52:31 +0200 |
---|---|---|
committer | Alberto Compagno <acompagn+fdio@cisco.com> | 2018-04-16 15:23:49 +0000 |
commit | 799484812a3fdd9d5d6e71c5fc4b483043347bca (patch) | |
tree | 40993aeb725715bbb97bc353351e718639ba0d53 /libparc/parc/security/parc_SymmetricKeySigner.c | |
parent | e4fcd260cb99434033a8ccfba12eee12dab190b9 (diff) |
Added method to retrieve the signature length from the signer. Fixed bug on parc-publickey
Change-Id: If188601e83d0cebf42d2e868e1dce430eabfa1f2
Signed-off-by: Devel <acompagn+fdio@cisco.com>
Diffstat (limited to 'libparc/parc/security/parc_SymmetricKeySigner.c')
-rw-r--r-- | libparc/parc/security/parc_SymmetricKeySigner.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libparc/parc/security/parc_SymmetricKeySigner.c b/libparc/parc/security/parc_SymmetricKeySigner.c index aeacb30f..5cde896b 100644 --- a/libparc/parc/security/parc_SymmetricKeySigner.c +++ b/libparc/parc/security/parc_SymmetricKeySigner.c @@ -240,6 +240,18 @@ _getKeyStore(PARCSymmetricKeySigner *signer) return signer->generalKeyStore; } +static size_t +_GetSignatureSize(PARCSymmetricKeySigner *signer) +{ + assertNotNull(signer, "Parameter must be non-null CCNxFileKeystore"); + + // TODO: what is the best way to expose this? + PARCSymmetricKeyStore *keyStore = signer->keyStore; + PARCBuffer *secretKeyBuffer = parcSymmetricKeyStore_GetKey(keyStore); + + return parcBuffer_Limit(secretKeyBuffer); +} + // ================================================== // implementation @@ -265,4 +277,5 @@ PARCSigningInterface *PARCSymmetricKeySignerAsSigner = &(PARCSigningInterface) { .SignDigest = (PARCSignature * (*)(void *, const PARCCryptoHash *))_signDigest, .GetSigningAlgorithm = (PARCSigningAlgorithm (*)(void *))_getSigningAlgorithm, .GetKeyStore = (PARCKeyStore * (*)(void *))_getKeyStore, + .GetSignatureSize = (size_t (*)(void *))_GetSignatureSize }; |