Commit ac62655e authored by Christopher Wood's avatar Christopher Wood

Merging outdated branches.

parent 2e747bc7
set(BASE_HDRS
librta_About.h
set(BASE_HDRS
librta_About.h
)
set(COMMON_HDRS
common/transport.h
common/ccnx_TransportConfig.h
common/transport_Message.h
common/transport_MetaMessage.h
common/ccnx_StackConfig.h
common/ccnx_ConnectionConfig.h
common/transport.h
common/ccnx_TransportConfig.h
common/transport_Message.h
common/transport_MetaMessage.h
common/ccnx_StackConfig.h
common/ccnx_ConnectionConfig.h
)
source_group(common FILES ${COMMON_HDRS})
......@@ -17,7 +17,7 @@ set(RTA_CORE_HDRS
transport_rta/rta_Transport.h
transport_rta/core/components.h
transport_rta/core/rta.h
transport_rta/core/rta_ComponentQueue.h
transport_rta/core/rta_ComponentQueue.h
transport_rta/core/rta_ComponentStats.h
transport_rta/core/rta_Connection.h
transport_rta/core/rta_ConnectionTable.h
......@@ -26,7 +26,7 @@ set(RTA_CORE_HDRS
transport_rta/core/rta_Framework_NonThreaded.h
transport_rta/core/rta_Framework_Services.h
transport_rta/core/rta_Framework_Threaded.h
transport_rta/core/rta_Framework_private.h
transport_rta/core/rta_Framework_private.h
transport_rta/core/rta_Logger.h
transport_rta/core/rta_ProtocolStack.h
test_tools/bent_pipe.h
......@@ -36,7 +36,7 @@ set(RTA_CORE_HDRS
source_group(core FILES ${RTA_CORE_HDRS})
set(TEST_TOOLS_HDRS
test_tools/bent_pipe.h
test_tools/bent_pipe.h
test_tools/traffic_tools.h
)
......@@ -52,17 +52,17 @@ set(RTA_COMMANDS_HDRS
source_group(rta_commands FILES ${RTA_COMMANDS_HDRS})
set(RTA_CONFIG_HDRS
transport_rta/config/config_ApiConnector.h
transport_rta/config/config_Codec_Tlv.h
transport_rta/config/config_CryptoCache.h
transport_rta/config/config_FlowControl_Vegas.h
transport_rta/config/config_Forwarder_Local.h
transport_rta/config/config_Forwarder_Metis.h
transport_rta/config/config_InMemoryVerifier.h
transport_rta/config/config_ProtocolStack.h
transport_rta/config/config_PublicKeySignerPkcs12Store.h
transport_rta/config/config_Signer.h
transport_rta/config/config_SymmetricKeySignerFileStore.h
transport_rta/config/config_ApiConnector.h
transport_rta/config/config_Codec_Tlv.h
transport_rta/config/config_CryptoCache.h
transport_rta/config/config_FlowControl_Vegas.h
transport_rta/config/config_Forwarder_Local.h
transport_rta/config/config_Forwarder_Metis.h
transport_rta/config/config_InMemoryVerifier.h
transport_rta/config/config_ProtocolStack.h
transport_rta/config/config_PublicKeySigner.h
transport_rta/config/config_Signer.h
transport_rta/config/config_SymmetricKeySigner.h
transport_rta/config/config_TestingComponent.h
)
......@@ -86,78 +86,78 @@ set(RTA_COMPONENTS_HDRS
source_group(rta_components FILES ${RTA_COMPONENTS_HDRS})
set(COMMON_SRCS
librta_About.c
common/transport.c
common/ccnx_TransportConfig.c
common/transport_Message.c
common/transport_MetaMessage.c
common/ccnx_StackConfig.c
set(COMMON_SRCS
librta_About.c
common/transport.c
common/ccnx_TransportConfig.c
common/transport_Message.c
common/transport_MetaMessage.c
common/ccnx_StackConfig.c
common/ccnx_ConnectionConfig.c
)
source_group(common FILES ${COMMON_SRCS})
set(RTA_CORE_SRCS
transport_rta/core/rta_ComponentStats.c
transport_rta/core/rta_Component.c
transport_rta/core/rta_Connection.c
transport_rta/core/rta_ConnectionTable.c
transport_rta/core/rta_Framework.c
transport_rta/core/rta_Framework_Commands.c
transport_rta/core/rta_Framework_Services.c
transport_rta/core/rta_Framework_Threaded.c
transport_rta/core/rta_Framework_NonThreaded.c
transport_rta/core/rta_Logger.c
transport_rta/core/rta_ProtocolStack.c
transport_rta/rta_Transport.c
test_tools/bent_pipe.c
set(RTA_CORE_SRCS
transport_rta/core/rta_ComponentStats.c
transport_rta/core/rta_Component.c
transport_rta/core/rta_Connection.c
transport_rta/core/rta_ConnectionTable.c
transport_rta/core/rta_Framework.c
transport_rta/core/rta_Framework_Commands.c
transport_rta/core/rta_Framework_Services.c
transport_rta/core/rta_Framework_Threaded.c
transport_rta/core/rta_Framework_NonThreaded.c
transport_rta/core/rta_Logger.c
transport_rta/core/rta_ProtocolStack.c
transport_rta/rta_Transport.c
test_tools/bent_pipe.c
test_tools/traffic_tools.c
)
source_group(core FILES ${RTA_CORE_SRCS})
set(RTA_COMMANDS_SRCS
transport_rta/commands/rta_Command.c
transport_rta/commands/rta_CommandCloseConnection.c
transport_rta/commands/rta_CommandCreateProtocolStack.c
transport_rta/commands/rta_CommandDestroyProtocolStack.c
transport_rta/commands/rta_CommandOpenConnection.c
transport_rta/commands/rta_Command.c
transport_rta/commands/rta_CommandCloseConnection.c
transport_rta/commands/rta_CommandCreateProtocolStack.c
transport_rta/commands/rta_CommandDestroyProtocolStack.c
transport_rta/commands/rta_CommandOpenConnection.c
transport_rta/commands/rta_CommandTransmitStatistics.c
)
source_group(rta_commands FILES ${RTA_COMMANDS_SRCS})
set(RTA_CONFIG_SRCS
transport_rta/config/config_ApiConnector.c
transport_rta/config/config_Codec_Tlv.c
transport_rta/config/config_FlowControl_Vegas.c
transport_rta/config/config_Forwarder_Local.c
transport_rta/config/config_Forwarder_Metis.c
transport_rta/config/config_TestingComponent.c
transport_rta/config/config_InMemoryVerifier.c
transport_rta/config/config_ProtocolStack.c
transport_rta/config/config_PublicKeySignerPkcs12Store.c
transport_rta/config/config_Signer.c
set(RTA_CONFIG_SRCS
transport_rta/config/config_ApiConnector.c
transport_rta/config/config_Codec_Tlv.c
transport_rta/config/config_FlowControl_Vegas.c
transport_rta/config/config_Forwarder_Local.c
transport_rta/config/config_Forwarder_Metis.c
transport_rta/config/config_TestingComponent.c
transport_rta/config/config_InMemoryVerifier.c
transport_rta/config/config_ProtocolStack.c
transport_rta/config/config_PublicKeySignerPkcs12Store.c
transport_rta/config/config_Signer.c
transport_rta/config/config_SymmetricKeySignerFileStore.c
)
source_group(rta_config FILES ${RTA_CONFIG_SRCS})
set(RTA_CONNECTORS_SRCS
transport_rta/connectors/connector_Api.c
transport_rta/connectors/rta_ApiConnection.c
transport_rta/connectors/connector_Forwarder_Local.c
set(RTA_CONNECTORS_SRCS
transport_rta/connectors/connector_Api.c
transport_rta/connectors/rta_ApiConnection.c
transport_rta/connectors/connector_Forwarder_Local.c
transport_rta/connectors/connector_Forwarder_Metis.c
)
source_group(rta_connectors FILES ${RTA_CONNECTORS_SRCS})
set(RTA_COMPONENTS_SRCS
transport_rta/components/codec_Signing.c
transport_rta/components/component_Codec_Tlv.c
transport_rta/components/Flowcontrol_Vegas/component_Vegas.c
transport_rta/components/Flowcontrol_Vegas/vegas_Session.c
set(RTA_COMPONENTS_SRCS
transport_rta/components/codec_Signing.c
transport_rta/components/component_Codec_Tlv.c
transport_rta/components/Flowcontrol_Vegas/component_Vegas.c
transport_rta/components/Flowcontrol_Vegas/vegas_Session.c
transport_rta/components/component_Testing.c
)
......@@ -166,10 +166,10 @@ source_group(rta_components FILES ${RTA_COMPONENTS_SRCS})
set(TRANSPORT_RTA_SOURCE_FILES
${BASE_HDRS}
${COMMON_HDRS}
${RTA_CORE_HDRS}
${RTA_CORE_HDRS}
${RTA_CONFIG_HDRS}
${RTA_COMPONENTS_HDRS}
${RTA_CONNECTORS_HDRS}
${RTA_CONNECTORS_HDRS}
${RTA_COMMANDS_HDRS}
${TEST_TOOLS_HDRS}
......@@ -184,9 +184,9 @@ set(TRANSPORT_RTA_SOURCE_FILES
add_library(ccnx_transport_rta STATIC ${TRANSPORT_RTA_SOURCE_FILES})
add_library(ccnx_transport_rta.shared SHARED ${TRANSPORT_RTA_SOURCE_FILES})
set_target_properties(ccnx_transport_rta.shared PROPERTIES
set_target_properties(ccnx_transport_rta.shared PROPERTIES
C_STANDARD 99
SOVERSION 1
SOVERSION 1
VERSION 1.0
OUTPUT_NAME ccnx_transport_rta )
......@@ -206,7 +206,7 @@ install(FILES ${TEST_TOOLS_HDRS} DESTINATION include/ccnx/transport/test_tools )
install(FILES ${RTA_CORE_HDRS} DESTINATION include/ccnx/transport/transport_rta )
install(FILES ${RTA_CONFIG_HDRS} DESTINATION include/ccnx/transport/transport_rta/config )
install(FILES ${RTA_COMMANDS_HDRS} DESTINATION include/ccnx/transport/transport_rta/commands )
add_subdirectory(common/test)
add_subdirectory(transport_rta/test)
add_subdirectory(transport_rta/commands/test)
......
......@@ -39,19 +39,10 @@
#include <ccnx/common/ccnx_NameSegmentNumber.h>
#include <ccnx/transport/transport_rta/core/rta_Component.h>
#include <parc/security/parc_PublicKeySignerPkcs12Store.h>
#include <parc/security/parc_Signer.h>
#include <ccnx/common/codec/schema_v1/ccnxCodecSchemaV1_TlvDictionary.h>
#include <ccnx/common/codec/schema_v1/testdata/v1_interest_nameA.h>
#include <ccnx/common/ccnx_WireFormatMessage.h>
#include <ccnx/common/internal/ccnx_InterestDefault.h>
#include <ccnx/common/ccnx_ContentObject.h>
#include <ccnx/common/ccnx_Interest.h>
#include <ccnx/api/control/cpi_ControlFacade.h>
/**
......@@ -127,7 +118,7 @@ trafficTools_ReadAndVerifySegment(PARCEventQueue *queue, CCNxName *basename, uin
CCNxContentObject *
trafficTools_CreateSignedContentObject()
{
CCNxName *name = ccnxName_CreateFromCString("lci:/hello/dolly");
CCNxName *name = ccnxName_CreateFromURI("lci:/hello/dolly");
PARCBuffer *payload = parcBuffer_WrapCString("hello");
CCNxContentObject *result = ccnxContentObject_CreateWithDataPayload(name, payload);
......@@ -151,7 +142,7 @@ trafficTools_CreateSignedContentObject()
CCNxContentObject *
trafficTools_CreateContentObjectWithPayload(PARCBuffer *contents)
{
CCNxName *name = ccnxName_CreateFromCString("lci:/hello/dolly");
CCNxName *name = ccnxName_CreateFromURI("lci:/hello/dolly");
CCNxContentObject *result = ccnxContentObject_CreateWithDataPayload(name, contents);
......@@ -202,7 +193,7 @@ trafficTools_CreateTransportMessageWithSignedContentObjectWithName(RtaConnection
CCNxInterest *
trafficTools_CreateInterest(void)
{
CCNxName *name = ccnxName_CreateFromCString("lci:/there/were/bells/on/the/hill");
CCNxName *name = ccnxName_CreateFromURI("lci:/there/were/bells/on/the/hill");
CCNxInterest *interest = ccnxInterest_CreateSimple(name);
ccnxName_Release(&name);
......@@ -212,7 +203,7 @@ trafficTools_CreateInterest(void)
CCNxTlvDictionary *
trafficTools_CreateDictionaryInterest(void)
{
CCNxName *name = ccnxName_CreateFromCString("lci:/there/were/bells/on/the/hill");
CCNxName *name = ccnxName_CreateFromURI("lci:/there/were/bells/on/the/hill");
CCNxTlvDictionary *interest = ccnxInterest_CreateSimple(name);
ccnxName_Release(&name);
......@@ -241,7 +232,7 @@ TransportMessage *
trafficTools_CreateTransportMessageWithDictionaryInterest(RtaConnection *connection, CCNxTlvDictionary_SchemaVersion schema)
{
CCNxTlvDictionary *interest;
CCNxName *name = ccnxName_CreateFromCString("lci:/lost/in/space");
CCNxName *name = ccnxName_CreateFromURI("lci:/lost/in/space");
CCNxInterestInterface *impl = NULL;
......
......@@ -35,8 +35,12 @@
#include <parc/algol/parc_Memory.h>
#include <parc/security/parc_PublicKeySignerPkcs12Store.h>
#include <parc/security/parc_SymmetricSignerFileStore.h>
#include <parc/security/parc_PublicKeySigner.h>
#include <parc/security/parc_Pkcs12KeyStore.h>
#include <parc/security/parc_SymmetricKeySigner.h>
#include <parc/security/parc_SymmetricKeyStore.h>
#include <parc/security/parc_KeyStore.h>
#include <parc/security/parc_Signer.h>
#include <parc/security/parc_CryptoHashType.h>
#include <ccnx/transport/transport_rta/config/config_Signer.h>
......@@ -50,22 +54,31 @@ component_Codec_GetSigner(RtaConnection *conn)
SignerType signertype = signer_GetImplementationType(rtaConnection_GetParameters(conn));
switch (signertype) {
case SIGNER_SymmetricKeySignerFileStore: {
case SignerType_SymmetricKeySigner: {
struct symmetrickeysigner_params params;
bool success = symmetricKeySignerFileStore_GetConnectionParams(rtaConnection_GetParameters(conn), &params);
assertTrue(success, "Could not retrieve publicKeySignerPkcs12Store_GetConnectionParams");
bool success = symmetricKeySigner_GetConnectionParams(rtaConnection_GetParameters(conn), &params);
assertTrue(success, "Could not retrieve symmetricKeySigner_GetConnectionParams");
signer = parcSigner_Create(parcSymmetricSignerFileStore_OpenFile(params.filename, params.password, PARC_HASH_SHA256));
PARCSymmetricKeyStore *symmetricKeyStore = parcSymmetricKeyStore_OpenFile(params.filename, params.password, PARC_HASH_SHA256);
PARCSymmetricKeySigner *symmetricKeySigner = parcSymmetricKeySigner_Create(symmetricKeyStore, PARC_HASH_SHA256);
parcSymmetricKeyStore_Release(&symmetricKeyStore);
signer = parcSigner_Create(symmetricKeySigner, PARCSymmetricKeySignerAsSigner);
assertNotNull(signer, "got null opening FileKeystore '%s'\n", params.filename);
break;
}
case SIGNER_PublicKeySignerPkcs12Store: {
case SignerType_PublicKeySigner: {
struct publickeysigner_params params;
bool success = publicKeySignerPkcs12Store_GetConnectionParams(rtaConnection_GetParameters(conn), &params);
assertTrue(success, "Could not retrieve publicKeySignerPkcs12Store_GetConnectionParams");
bool success = publicKeySigner_GetConnectionParams(rtaConnection_GetParameters(conn), &params);
assertTrue(success, "Could not retrieve publicKeySigner_GetConnectionParams");
PARCPkcs12KeyStore *pkcs12KeyStore = parcPkcs12KeyStore_Open(params.filename, params.password, PARC_HASH_SHA256);
PARCKeyStore *keyStore = parcKeyStore_Create(pkcs12KeyStore, PARCPkcs12KeyStoreAsKeyStore);
PARCPublicKeySigner *publicKeySigner = parcPublicKeySigner_Create(keyStore, PARCSigningAlgorithm_RSA, PARC_HASH_SHA256);
parcKeyStore_Release(&keyStore);
signer = parcSigner_Create(parcPublicKeySignerPkcs12Store_Open(params.filename, params.password, PARC_HASH_SHA256));
signer = parcSigner_Create(publicKeySigner, PARCPublicKeySignerAsSigner);
assertNotNull(signer, "got null opening FileKeystore '%s'\n", params.filename);
break;
}
......
......@@ -40,7 +40,6 @@
#include <inttypes.h>
#include <LongBow/runtime.h>
#include <LongBow/debugging.h>
#include <parc/algol/parc_Memory.h>
......@@ -51,21 +50,13 @@
#include <ccnx/transport/transport_rta/core/rta_Connection.h>
#include <ccnx/transport/transport_rta/core/rta_Component.h>
#include <parc/security/parc_PublicKeySignerPkcs12Store.h>
#include <parc/security/parc_SymmetricSignerFileStore.h>
#include <parc/security/parc_CryptoHashType.h>
#include <ccnx/common/codec/ccnxCodec_TlvPacket.h>
#include <ccnx/common/codec/schema_v1/ccnxCodecSchemaV1_TlvDictionary.h>
#include <ccnx/common/codec/schema_v1/ccnxCodecSchemaV1_PacketEncoder.h>
#include <ccnx/common/ccnx_WireFormatMessage.h>
#include "component_Codec.h"
#include "codec_Signing.h"
#include <ccnx/transport/transport_rta/config/config_Signer.h>
#include <ccnx/transport/transport_rta/config/config_Codec_Tlv.h>
// set to 3 or higher for memory dumps of packets
#ifndef DEBUG_OUTPUT
......
......@@ -38,6 +38,7 @@
#include <parc/algol/parc_SafeMemory.h>
#include <ccnx/api/control/cpi_ControlFacade.h>
#include <parc/security/parc_Pkcs12KeyStore.h>
#include <parc/security/parc_Security.h>
#include <ccnx/transport/transport_rta/config/config_All.h>
......@@ -77,10 +78,10 @@ codecTlv_CreateParams(const char *keystore_filename, const char *keystore_passwo
unlink(keystore_filename);
bool success = parcPublicKeySignerPkcs12Store_CreateFile(keystore_filename, keystore_password, "alice", 1024, 30);
assertTrue(success, "parcPublicKeySignerPkcs12Store_CreateFile() failed.");
bool success = parcPkcs12KeyStore_CreateFile(keystore_filename, keystore_password, "alice", 1024, 30);
assertTrue(success, "parcPkcs12KeyStore_CreateFile() failed.");
publicKeySignerPkcs12Store_ConnectionConfig(connConfig, keystore_filename, keystore_password);
publicKeySigner_ConnectionConfig(connConfig, keystore_filename, keystore_password);
CCNxTransportConfig *result = ccnxTransportConfig_Create(stackConfig, connConfig);
ccnxStackConfig_Release(&stackConfig);
......@@ -290,7 +291,7 @@ LONGBOW_TEST_CASE(Dictionary, component_Codec_Tlv_Upcall_Read_Control)
0, sizeof(v1_cpi_add_route_crc32c));
CCNxTlvDictionary *dictionary = ccnxWireFormatMessage_FromControlPacketType(CCNxTlvDictionary_SchemaVersion_V1, wireFormat);
parcBuffer_Release(&wireFormat);
// We have not set the message type or schema
TransportMessage *tm = transportMessage_CreateFromDictionary(dictionary);
transportMessage_SetInfo(tm, data->mock->connection, NULL);
......
......@@ -42,7 +42,7 @@
#define DEBUG_OUTPUT 0
#include <parc/security/parc_Security.h>
#include <parc/security/parc_SymmetricSignerFileStore.h>
#include <parc/security/parc_SymmetricKeyStore.h>
#include <ccnx/transport/transport_rta/config/config_All.h>
#include <ccnx/transport/transport_rta/core/rta_Framework.h>
......@@ -105,7 +105,7 @@ codecTlv_CreateParams(const char *keystore_name, const char *keystore_passwd)
tlvCodec_ConnectionConfig(connConfig);
testingLower_ConnectionConfig(connConfig);
symmetricKeySignerFileStore_ConnectionConfig(connConfig, keystore_name, keystore_passwd);
symmetricKeySigner_ConnectionConfig(connConfig, keystore_name, keystore_passwd);
CCNxTransportConfig *result = ccnxTransportConfig_Create(stackConfig, connConfig);
ccnxStackConfig_Release(&stackConfig);
return result;
......@@ -124,8 +124,8 @@ _commonSetup(void)
sprintf(data->keystore_password, "12345");
unlink(data->keystore_filename);
PARCBuffer *secret_key = parcSymmetricSignerFileStore_CreateKey(256);
parcSymmetricSignerFileStore_CreateFile(data->keystore_filename, data->keystore_password, secret_key);
PARCBuffer *secret_key = parcSymmetricKeyStore_CreateKey(256);
parcSymmetricKeyStore_CreateFile(data->keystore_filename, data->keystore_password, secret_key);
parcBuffer_Release(&secret_key);
CCNxTransportConfig *config = codecTlv_CreateParams(data->keystore_filename, data->keystore_password);
......
......@@ -52,10 +52,10 @@
#include <ccnx/transport/transport_rta/config/config_InMemoryVerifier.h>
#include <ccnx/transport/transport_rta/config/config_ProtocolStack.h>
#include <ccnx/transport/transport_rta/config/config_PublicKeySignerPkcs12Store.h>
#include <ccnx/transport/transport_rta/config/config_PublicKeySigner.h>
#include <ccnx/transport/transport_rta/config/config_Signer.h>
#include <ccnx/transport/transport_rta/config/config_SymmetricKeySignerFileStore.h>
#include <ccnx/transport/transport_rta/config/config_SymmetricKeySigner.h>
#include <ccnx/transport/transport_rta/config/config_TestingComponent.h>
#endif
......@@ -25,7 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//
// config_PublicKeySignerPkcs12Store.c
// config_PublicKeySigner.c
// Libccnx
//
// Created by Mosko, Marc <Marc.Mosko@parc.com> on 10/23/13.
......@@ -37,11 +37,11 @@
#include <stdio.h>
#include <parc/security/parc_Identity.h>
#include "config_PublicKeySignerPkcs12Store.h"
#include "config_PublicKeySigner.h"
#include <ccnx/transport/transport_rta/core/components.h>
static const char name[] = "publicKeySignerPkcs12Store";
static const char name[] = "publicKeySigner";
static const char param_KEYSTORE_NAME[] = "KEYSTORE_NAME";
static const char param_KEYSTORE_PASSWD[] = "KEYSTORE_PASSWD";
......@@ -50,26 +50,26 @@ static const char param_SIGNER[] = "SIGNER";
/**
* Generates:
*
* { "SIGNER" : "publicKeySignerPkcs12Store",
* "publicKeySignerPkcs12Store" : { "filename" : filename, "password" : password }
* { "SIGNER" : "publicKeySigner",
* "publicKeySigner" : { "filename" : filename, "password" : password }
* }
*/
CCNxConnectionConfig *
configPublicKeySignerPkcs12Store_SetIdentity(CCNxConnectionConfig *connConfig, const PARCIdentity *identity)
configPublicKeySigner_SetIdentity(CCNxConnectionConfig *connConfig, const PARCIdentity *identity)
{
return publicKeySignerPkcs12Store_ConnectionConfig(connConfig,
return publicKeySigner_ConnectionConfig(connConfig,
parcIdentity_GetFileName(identity),
parcIdentity_GetPassWord(identity));
}
CCNxConnectionConfig *
publicKeySignerPkcs12Store_ConnectionConfig(CCNxConnectionConfig *connConfig, const char *filename, const char *password)
publicKeySigner_ConnectionConfig(CCNxConnectionConfig *connConfig, const char *filename, const char *password)
{
assertNotNull(connConfig, "Parameter connConfig must be non-null");
assertNotNull(filename, "Parameter filename must be non-null");
assertNotNull(password, "Parameter password must be non-null");
PARCJSONValue *signerNameJson = parcJSONValue_CreateFromCString((char *) publicKeySignerPkcs12Store_GetName());
PARCJSONValue *signerNameJson = parcJSONValue_CreateFromCString((char *) publicKeySigner_GetName());
ccnxConnectionConfig_Add(connConfig, param_SIGNER, signerNameJson);
parcJSONValue_Release(&signerNameJson);
......@@ -79,13 +79,13 @@ publicKeySignerPkcs12Store_ConnectionConfig(CCNxConnectionConfig *connConfig, co
PARCJSONValue *value = parcJSONValue_CreateFromJSON(keystoreJson);
parcJSON_Release(&keystoreJson);
CCNxConnectionConfig *result = ccnxConnectionConfig_Add(connConfig, publicKeySignerPkcs12Store_GetName(), value);
CCNxConnectionConfig *result = ccnxConnectionConfig_Add(connConfig, publicKeySigner_GetName(), value);
parcJSONValue_Release(&value);
return result;
}
const char *
publicKeySignerPkcs12Store_GetName()
publicKeySigner_GetName()
{
return name;
}
......@@ -94,22 +94,22 @@ publicKeySignerPkcs12Store_GetName()
* If successful, return true and fill in the parameters in the output argument
*/
bool
publicKeySignerPkcs12Store_GetConnectionParams(PARCJSON *connectionJson, struct publickeysigner_params *output)
publicKeySigner_GetConnectionParams(PARCJSON *connectionJson, struct publickeysigner_params *output)
{
assertNotNull(connectionJson, "Parameter connectionJson must be non-null");
assertNotNull(output, "Parameter output must be non-null");
PARCJSONValue *value = parcJSON_GetValueByName(connectionJson, publicKeySignerPkcs12Store_GetName());
assertNotNull(value, "JSON key %s missing", publicKeySignerPkcs12Store_GetName());
PARCJSONValue *value = parcJSON_GetValueByName(connectionJson, publicKeySigner_GetName());
assertNotNull(value, "JSON key %s missing", publicKeySigner_GetName());
PARCJSON *keystoreJson = parcJSONValue_GetJSON(value);
value = parcJSON_GetValueByName(keystoreJson, param_KEYSTORE_NAME);
assertNotNull(value, "JSON key %s missing inside %s", param_KEYSTORE_NAME, publicKeySignerPkcs12Store_GetName());
assertNotNull(value, "JSON key %s missing inside %s", param_KEYSTORE_NAME, publicKeySigner_GetName());
PARCBuffer *sBuf = parcJSONValue_GetString(value);
output->filename = parcBuffer_Overlay(sBuf, 0);
value = parcJSON_GetValueByName(keystoreJson, param_KEYSTORE_PASSWD);
assertNotNull(value, "JSON key %s missing inside %s", param_KEYSTORE_PASSWD, publicKeySignerPkcs12Store_GetName());
assertNotNull(value, "JSON key %s missing inside %s", param_KEYSTORE_PASSWD, publicKeySigner_GetName());
sBuf = parcJSONValue_GetString(value);
output->password = parcBuffer_Overlay(sBuf, 0);
......
......@@ -25,7 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
* @file config_PublicKeySignerPkcs12Store.h
* @file config_PublicKeySigner.h
* @brief Generates stack and connection configuration information
*
* Each component in the protocol stack must have a configuration element.
......@@ -45,7 +45,7 @@
* tlvCodec_ProtocolStackConfig(stackConfig);
* tlvCodec_ConnectionConfig(connConfig);
*
* publicKeySignerPkcs12Store_ConnectionConfig(connConfig, "~/.ccnx/keystore.p12", "foobar password");
* publicKeySigner_ConnectionConfig(connConfig, "~/.ccnx/keystore.p12", "foobar password");
*
* metisForwarder_ProtocolStackConfig(stackConfig);
* metisForwarder_ConnectionConfig(connConfig, metisForwarder_GetDefaultPort());
......@@ -56,8 +56,8 @@
* @author Marc Mosko, Palo Alto Research Center (Xerox PARC)
* @copyright 2013-2015, Xerox Corporation (Xerox)and Palo Alto Research Center (PARC). All rights reserved.
*/
#ifndef Libccnx_config_PublicKeySignerPkcs12Store_h
#define Libccnx_config_PublicKeySignerPkcs12Store_h
#ifndef Libccnx_config_PublicKeySigner_h
#define Libccnx_config_PublicKeySigner_h
#include <stdbool.h>
#include <parc/security/parc_Identity.h>
......@@ -74,8 +74,8 @@ struct publickeysigner_params {
*
* Adds configuration elements to the `CCNxConnectionConfig`
*
* { "SIGNER" : "publicKeySignerPkcs12Store",
* "publicKeySignerPkcs12Store" : { "filename" : filename, "password" : password }
* { "SIGNER" : "publicKeySigner",
* "publicKeySigner" : { "filename" : filename, "password" : password }
* }
*
* @param [in] config A pointer to a valid CCNxConnectionConfig instance.
......@@ -87,15 +87,15 @@ struct publickeysigner_params {
* <#example#>
* @endcode
*/
CCNxConnectionConfig *publicKeySignerPkcs12Store_ConnectionConfig(CCNxConnectionConfig *config, const char *filename, const char *password);
CCNxConnectionConfig *publicKeySigner_ConnectionConfig(CCNxConnectionConfig *config, const char *filename, const char *password);
/**
* Generates the configuration settings included in the CCNxConnectionConfig for the identity of the configuration 'owner'
*
* Adds configuration elements to the `CCNxConnectionConfig`
*
* { "SIGNER" : "publicKeySignerPkcs12Store",
* "publicKeySignerPkcs12Store" : { "filename" : filename, "password" : password }
* { "SIGNER" : "publicKeySigner",
* "publicKeySigner" : { "filename" : filename, "password" : password }
* }
*
* @param [in] connConfig The pointer to a valid CCNxConnectionConfig instance.
......@@ -103,7 +103,7 @@ CCNxConnectionConfig *publicKeySignerPkcs12Store_ConnectionConfig(CCNxConnection
*
* @return non-null The modified `CCNxConnectionConfig`
*/
CCNxConnectionConfig *configPublicKeySignerPkcs12Store_SetIdentity(CCNxConnectionConfig *connConfig, const PARCIdentity *identity);
CCNxConnectionConfig *configPublicKeySigner_SetIdentity(CCNxConnectionConfig *connConfig, const PARCIdentity *identity);
/**
* Returns the text string for this component
......@@ -113,13 +113,13 @@ CCNxConnectionConfig *configPublicKeySignerPkcs12Store_SetIdentity(CCNxConnectio
* @return non-null A text string unique to this component
*
*/
const char *publicKeySignerPkcs12Store_GetName(void);
const char *publicKeySigner_GetName(void);
/**
* If successful, return true and fill in the parameters in the output argument
*
* Parses the JSON created by publicKeySignerPkcs12Store_ConnectionConfig() and fills in the
* Parses the JSON created by publicKeySigner_ConnectionConfig() and fills in the
* output parameter. The output parameter must be allocated by the caller.
*/
bool publicKeySignerPkcs12Store_GetConnectionParams(PARCJSON *connectionJson, struct publickeysigner_params *output);
#endif // Libccnx_config_PublicKeySignerPkcs12Store_h
bool publicKeySigner_GetConnectionParams(PARCJSON *connectionJson, struct publickeysigner_params *output);