aboutsummaryrefslogtreecommitdiffstats
path: root/libparc/parc/security/parc_SymmetricKeySigner.c
diff options
context:
space:
mode:
authorAlberto Compagno <acompagn+fdio@cisco.com>2018-04-16 15:28:53 +0000
committerGerrit Code Review <gerrit@fd.io>2018-04-16 15:28:53 +0000
commit07d0a90b6f52fa920ab3a4a9984b0ba1fbb7f9f8 (patch)
treef3810af54c63c0f1bb5226e84897411c41b40d03 /libparc/parc/security/parc_SymmetricKeySigner.c
parentd609ef19bac231a47b65cf5a6a797c142ebc625d (diff)
parent799484812a3fdd9d5d6e71c5fc4b483043347bca (diff)
Merge "Added method to retrieve the signature length from the signer. Fixed bug on parc-publickey" into cframework/master
Diffstat (limited to 'libparc/parc/security/parc_SymmetricKeySigner.c')
-rw-r--r--libparc/parc/security/parc_SymmetricKeySigner.c13
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
};