diff options
author | Devel <acompagn+fdio@cisco.com> | 2018-04-13 13:28:31 +0200 |
---|---|---|
committer | Devel <acompagn+fdio@cisco.com> | 2018-04-13 13:28:51 +0200 |
commit | 9439750179b4541c91c7d9ad1b6179baada8f141 (patch) | |
tree | 5f1f4a668648a873e9e3e55defc93982a9812217 /libccnx-common/ccnx/common | |
parent | ed721c097187deece705ae663c6bffb1fc107c6d (diff) |
Updated library according to the latest changes about security in libparc
Change-Id: I04e53c986f6cb17679edc60e24c8c7c42fc9aad3
Signed-off-by: Devel <acompagn+fdio@cisco.com>
Diffstat (limited to 'libccnx-common/ccnx/common')
5 files changed, 9 insertions, 9 deletions
diff --git a/libccnx-common/ccnx/common/ccnx_KeystoreUtilities.c b/libccnx-common/ccnx/common/ccnx_KeystoreUtilities.c index aac2ddd0..1ba0c617 100755 --- a/libccnx-common/ccnx/common/ccnx_KeystoreUtilities.c +++ b/libccnx-common/ccnx/common/ccnx_KeystoreUtilities.c @@ -94,7 +94,7 @@ ccnxKeystoreUtilities_OpenFromPath(const char *path, const char *password) PARCPkcs12KeyStore *keyStore = parcPkcs12KeyStore_Open(path, password, PARCCryptoHashType_SHA256); PARCKeyStore *publicKeyStore = parcKeyStore_Create(keyStore, PARCPkcs12KeyStoreAsKeyStore); parcPkcs12KeyStore_Release(&keyStore); - PARCPublicKeySigner *pksigner = parcPublicKeySigner_Create(publicKeyStore, PARCSigningAlgorithm_RSA, PARCCryptoHashType_SHA256); + PARCPublicKeySigner *pksigner = parcPublicKeySigner_Create(publicKeyStore, PARCCryptoSuite_RSA_SHA256); PARCSigner *signer = parcSigner_Create(pksigner, PARCPublicKeySignerAsSigner); parcPublicKeySigner_Release(&pksigner); @@ -114,12 +114,12 @@ ccnxKeystoreUtilities_CreateInPath(const char *path, const char *password, int k { KeystoreParams *params = NULL; - bool success = parcPkcs12KeyStore_CreateFile(path, password, "ccnxuser", keystoreBits, keystoreDays); + bool success = parcPkcs12KeyStore_CreateFile(path, password, "ccnxuser", PARCSigningAlgorithm_RSA, keystoreBits, keystoreDays); if (success) { PARCPkcs12KeyStore *keyStore = parcPkcs12KeyStore_Open(path, password, PARCCryptoHashType_SHA256); PARCKeyStore *publicKeyStore = parcKeyStore_Create(keyStore, PARCPkcs12KeyStoreAsKeyStore); parcPkcs12KeyStore_Release(&keyStore); - PARCPublicKeySigner *pksigner = parcPublicKeySigner_Create(publicKeyStore, PARCSigningAlgorithm_RSA, PARCCryptoHashType_SHA256); + PARCPublicKeySigner *pksigner = parcPublicKeySigner_Create(publicKeyStore, PARCCryptoSuite_RSA_SHA256); PARCSigner *signer = parcSigner_Create(pksigner, PARCPublicKeySignerAsSigner); parcPublicKeySigner_Release(&pksigner); diff --git a/libccnx-common/ccnx/common/codec/test/test_ccnxCodec_NetworkBuffer.c b/libccnx-common/ccnx/common/codec/test/test_ccnxCodec_NetworkBuffer.c index aec3018e..0b6fd116 100755 --- a/libccnx-common/ccnx/common/codec/test/test_ccnxCodec_NetworkBuffer.c +++ b/libccnx-common/ccnx/common/codec/test/test_ccnxCodec_NetworkBuffer.c @@ -178,7 +178,7 @@ LONGBOW_TEST_CASE(Global, ccnxCodecNetworkBuffer_ComputeSignature) PARCPkcs12KeyStore *publicKeyStore = parcPkcs12KeyStore_Open("test_rsa.p12", "blueberry", PARCCryptoHashType_SHA256); PARCKeyStore *keyStore = parcKeyStore_Create(publicKeyStore, PARCPkcs12KeyStoreAsKeyStore); parcPkcs12KeyStore_Release(&publicKeyStore); - PARCPublicKeySigner *publicKeySigner = parcPublicKeySigner_Create(keyStore, PARCSigningAlgorithm_RSA, PARCCryptoHashType_SHA256); + PARCPublicKeySigner *publicKeySigner = parcPublicKeySigner_Create(keyStore, PARCCryptoSuite_RSA_SHA256); PARCSigner *signer = parcSigner_Create(publicKeySigner, PARCPublicKeySignerAsSigner); parcPublicKeySigner_Release(&publicKeySigner); diff --git a/libccnx-common/ccnx/common/test/test_ccnx_KeystoreUtilities.c b/libccnx-common/ccnx/common/test/test_ccnx_KeystoreUtilities.c index 0ab770a5..39bc778c 100644 --- a/libccnx-common/ccnx/common/test/test_ccnx_KeystoreUtilities.c +++ b/libccnx-common/ccnx/common/test/test_ccnx_KeystoreUtilities.c @@ -211,7 +211,7 @@ LONGBOW_TEST_CASE(Local, ccnxKeystoreUtilities_OpenFromHomeDirectory_Oldfile) mkdir(ccnxdir, 0700); char *path = ccnxKeystoreUtilities_ConstructPath(ccnxdir, ".ccnx_keystore"); - bool success = parcPkcs12KeyStore_CreateFile(path, "1234", "ccnxuser", 1024, 365); + bool success = parcPkcs12KeyStore_CreateFile(path, "1234", "ccnxuser", PARCSigningAlgorithm_RSA, 1024, 365); assertTrue(success, "parcPkcs12KeyStore_CreateFile() failed."); KeystoreParams *signer = ccnxKeystoreUtilities_OpenFromHomeDirectory("1234"); @@ -233,7 +233,7 @@ LONGBOW_TEST_CASE(Local, ccnxKeystoreUtilities_OpenFromHomeDirectory_Newfile) mkdir(ccnxdir, 0700); char *path = ccnxKeystoreUtilities_ConstructPath(ccnxdir, ".ccnx_keystore.p12"); - bool success = parcPkcs12KeyStore_CreateFile(path, "1234", "ccnxuser", 1024, 365); + bool success = parcPkcs12KeyStore_CreateFile(path, "1234", "ccnxuser", PARCSigningAlgorithm_RSA, 1024, 365); assertTrue(success, "parcPkcs12KeyStore_CreateFile() failed."); KeystoreParams *signer = ccnxKeystoreUtilities_OpenFromHomeDirectory("1234"); diff --git a/libccnx-common/ccnx/common/validation/ccnxValidation_EcSecp256K1.c b/libccnx-common/ccnx/common/validation/ccnxValidation_EcSecp256K1.c index d40a8378..1940b1d4 100755 --- a/libccnx-common/ccnx/common/validation/ccnxValidation_EcSecp256K1.c +++ b/libccnx-common/ccnx/common/validation/ccnxValidation_EcSecp256K1.c @@ -47,7 +47,7 @@ ccnxValidationEcSecp256K1_Set(CCNxTlvDictionary *message, const PARCBuffer *keyi bool success = true; switch (ccnxTlvDictionary_GetSchemaVersion(message)) { case CCNxTlvDictionary_SchemaVersion_V1: { - success &= ccnxTlvDictionary_PutInteger(message, CCNxCodecSchemaV1TlvDictionary_ValidationFastArray_CRYPTO_SUITE, PARCCryptoSuite_EC_SECP_256K1); + success &= ccnxTlvDictionary_PutInteger(message, CCNxCodecSchemaV1TlvDictionary_ValidationFastArray_CRYPTO_SUITE, PARCCryptoSuite_ECDSA_SHA256); if (keyid) { success &= ccnxTlvDictionary_PutBuffer(message, CCNxCodecSchemaV1TlvDictionary_ValidationFastArray_KEYID, keyid); @@ -69,7 +69,7 @@ ccnxValidationEcSecp256K1_Test(const CCNxTlvDictionary *message) { if (ccnxTlvDictionary_IsValueInteger(message, CCNxCodecSchemaV1TlvDictionary_ValidationFastArray_CRYPTO_SUITE)) { uint64_t cryptosuite = ccnxTlvDictionary_GetInteger(message, CCNxCodecSchemaV1TlvDictionary_ValidationFastArray_CRYPTO_SUITE); - return (cryptosuite == PARCCryptoSuite_EC_SECP_256K1); + return (cryptosuite == PARCCryptoSuite_ECDSA_SHA256); } return false; } diff --git a/libccnx-common/ccnx/common/validation/test/test_ccnxValidation_EcSecp256K1.c b/libccnx-common/ccnx/common/validation/test/test_ccnxValidation_EcSecp256K1.c index 8fe00f35..68176723 100755 --- a/libccnx-common/ccnx/common/validation/test/test_ccnxValidation_EcSecp256K1.c +++ b/libccnx-common/ccnx/common/validation/test/test_ccnxValidation_EcSecp256K1.c @@ -87,7 +87,7 @@ LONGBOW_TEST_CASE(Global, ccnxValidationEcSecp256K1_DictionaryCryptoSuiteValue) NULL); ccnxValidationEcSecp256K1_Set(dictionary, data->keyid, NULL); uint64_t cryptosuite = ccnxTlvDictionary_GetInteger(dictionary, CCNxCodecSchemaV1TlvDictionary_ValidationFastArray_CRYPTO_SUITE); - assertTrue(cryptosuite == PARCCryptoSuite_EC_SECP_256K1, "Unexpected PARCCryptoSuite value in dictionary"); + assertTrue(cryptosuite == PARCCryptoSuite_ECDSA_SHA256, "Unexpected PARCCryptoSuite value in dictionary"); ccnxTlvDictionary_Release(&dictionary); } |