aboutsummaryrefslogtreecommitdiffstats
path: root/libparc/parc/security
diff options
context:
space:
mode:
Diffstat (limited to 'libparc/parc/security')
-rwxr-xr-xlibparc/parc/security/parc_Identity.c2
-rwxr-xr-xlibparc/parc/security/parc_Identity.h2
-rw-r--r--libparc/parc/security/parc_IdentityFile.c7
-rw-r--r--libparc/parc/security/parc_IdentityFile.h2
4 files changed, 6 insertions, 7 deletions
diff --git a/libparc/parc/security/parc_Identity.c b/libparc/parc/security/parc_Identity.c
index a132964a..da68fbd2 100755
--- a/libparc/parc/security/parc_Identity.c
+++ b/libparc/parc/security/parc_Identity.c
@@ -101,7 +101,7 @@ parcIdentity_GetPassWord(const PARCIdentity *identity)
PARCSigner *
parcIdentity_CreateSigner(const PARCIdentity *identity, PARCCryptoSuite suite)
{
- return identity->interface->GetSigner(identity->instance, suite);
+ return identity->interface->GetSigner(identity->instance, parcCryptoSuite_GetSigningAlgorithm(suite));
}
void
diff --git a/libparc/parc/security/parc_Identity.h b/libparc/parc/security/parc_Identity.h
index 32b9b179..2cdcbad3 100755
--- a/libparc/parc/security/parc_Identity.h
+++ b/libparc/parc/security/parc_Identity.h
@@ -74,7 +74,7 @@ typedef struct parc_identity_interface {
/**
* @see parcIdentity_CreateSigner
*/
- PARCSigner *(*GetSigner)(const void *identity, PARCCryptoSuite suite);
+ PARCSigner *(*GetSigner)(const void *identity, PARCCryptoHashType hash);
/**
* @see parcIdentity_Equals
diff --git a/libparc/parc/security/parc_IdentityFile.c b/libparc/parc/security/parc_IdentityFile.c
index 38d3637c..0d22a51e 100644
--- a/libparc/parc/security/parc_IdentityFile.c
+++ b/libparc/parc/security/parc_IdentityFile.c
@@ -42,7 +42,7 @@ PARCIdentityInterface *PARCIdentityFileAsPARCIdentity = &(PARCIdentityInterface)
.Release = (void (*)(void **))parcIdentityFile_Release,
.GetPassWord = (void *(*)(const void *))parcIdentityFile_GetPassWord,
.GetFileName = (void *(*)(const void *))parcIdentityFile_GetFileName,
- .GetSigner = (PARCSigner * (*)(const void *, PARCCryptoSuite))parcIdentityFile_CreateSigner,
+ .GetSigner = (PARCSigner * (*)(const void *, PARCCryptoHashType))parcIdentityFile_CreateSigner,
.Equals = (bool (*)(const void *, const void *))parcIdentityFile_Equals,
.Display = (void (*)(const void *, size_t))parcIdentityFile_Display
};
@@ -104,7 +104,7 @@ parcIdentityFile_GetPassWord(const PARCIdentityFile *identity)
}
PARCSigner *
-parcIdentityFile_CreateSigner(const PARCIdentityFile *identity, PARCCryptoSuite suite)
+parcIdentityFile_CreateSigner(const PARCIdentityFile *identity, PARCCryptoHashType hash)
{
PARCPkcs12KeyStore *keyStore = parcPkcs12KeyStore_Open(identity->fileName, identity->passWord, PARCCryptoHashType_SHA256);
PARCKeyStore *publicKeyStore = parcKeyStore_Create(keyStore, PARCPkcs12KeyStoreAsKeyStore);
@@ -112,8 +112,7 @@ parcIdentityFile_CreateSigner(const PARCIdentityFile *identity, PARCCryptoSuite
PARCSigningAlgorithm signAlgo = parcKeyStore_getSigningAlgorithm(publicKeyStore);
- if (signAlgo != parcCryptoSuite_GetSigningAlgorithm(suite))
- return NULL;
+ PARCCryptoSuite suite = parcCryptoSuite_GetFromSigningHash(signAlgo, hash);
PARCPublicKeySigner *signer = parcPublicKeySigner_Create(publicKeyStore, suite);
PARCSigner *pkSigner = parcSigner_Create(signer, PARCPublicKeySignerAsSigner);
diff --git a/libparc/parc/security/parc_IdentityFile.h b/libparc/parc/security/parc_IdentityFile.h
index c125ffb2..46ff87cb 100644
--- a/libparc/parc/security/parc_IdentityFile.h
+++ b/libparc/parc/security/parc_IdentityFile.h
@@ -205,7 +205,7 @@ const char *parcIdentityFile_GetPassWord(const PARCIdentityFile *identity);
* }
* @endcode
*/
-PARCSigner *parcIdentityFile_CreateSigner(const PARCIdentityFile *identity, PARCCryptoSuite suite);
+PARCSigner *parcIdentityFile_CreateSigner(const PARCIdentityFile *identity, PARCCryptoHashType hash);
/**
* Determine if two PARCIdentityFiles are equal.