Fetch cryptocore_ae_decrypt body to header. 58/137058/1
authoru.harbuz <u.harbuz@samsung.com>
Thu, 18 May 2017 14:06:56 +0000 (16:06 +0200)
committerLukasz Kostyra <l.kostyra@samsung.com>
Tue, 4 Jul 2017 08:26:52 +0000 (10:26 +0200)
Change-Id: If5bbc0b8937074acf3d7057e96c832e3139d829a

.cproject
build/TEEStub/subdir.mk
simulatordaemon/src/TAInstance.cpp
ssflib/dep/uci/include/uci_cryptocore.h
ssflib/dep/uci/source/uci_cryptocore.c

index 2e304b4..2814223 100644 (file)
--- a/.cproject
+++ b/.cproject
                                </extensions>
                        </storageModule>
                        <storageModule moduleId="cdtBuildSystem" version="4.0.0">
-                               <configuration buildProperties="" description="" id="0.2061892542" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
+                               <configuration artifactName="simulator" buildProperties="" description="" id="0.2061892542" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
                                        <folderInfo id="0.2061892542." name="/" resourcePath="">
                                                <toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.863250730" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
                                                        <targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.863250730.1083387452" name=""/>
-                                                       <builder id="org.eclipse.cdt.build.core.settings.default.builder.1174681342" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
+                                                       <builder arguments="buildall ~/Path \&quot;\&quot;" command="./simulator/build/build.sh" enableCleanBuild="true" enabledIncrementalBuild="true" id="org.eclipse.cdt.build.core.settings.default.builder.1174681342" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
                                                        <tool id="org.eclipse.cdt.build.core.settings.holder.libs.891674801" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
                                                        <tool id="org.eclipse.cdt.build.core.settings.holder.339047950" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
                                                                <inputType id="org.eclipse.cdt.build.core.settings.holder.inType.781182995" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
                </scannerConfigBuildInfo>
        </storageModule>
        <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+       <storageModule moduleId="refreshScope" versionNumber="2">
+               <configuration configurationName="Default">
+                       <resource resourceType="PROJECT" workspacePath="/simulator"/>
+               </configuration>
+       </storageModule>
+       <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
 </cproject>
index 0502a59..ff324bd 100755 (executable)
@@ -13,7 +13,7 @@ CPP_DEPS += \
 %.o: $(TEESTUB_SOURCE)/%.cpp
        @echo 'Building file: $<'
        @echo 'Invoking: GCC C++ Compiler'
-       $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/TEEStub/../ssflib/inc" -I"$(HOME)/TEEStub" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<"
+       $(TOOLCHAIN)g++ -I"$(HOME)/include/include" -I"$(HOME)/log" -I"$(HOME)/osal" -I"$(HOME)/TEEStub/../ssflib/inc" -I"$(HOME)/TEEStub" -I$(INCLUDE) -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "$@" "$<" -g
        @echo 'Finished building: $<'
        @echo ' '
 
index f8733a7..d11ebb7 100755 (executable)
@@ -176,7 +176,7 @@ TEEC_Result TAInstance::connecttoTA(std::stringstream& str) {
                LOGD(SIM_DAEMON, "Connect to TEEStub");
                // Try to connect to TA RETRY_COUNT number of times
                while (error && (retry_count < RETRY_COUNT)) {
-#if 0
+#if 0 
                        LOGD(SIM_DAEMON, "Trying to connect to TEEStub");
                        LOGE(SIM_DAEMON, "Response returned with error code %d", error.value());
                        LOGE(SIM_DAEMON, "Response returned with error code %s",
index 1e83215..3323971 100755 (executable)
@@ -295,7 +295,7 @@ int cryptocore_ae_decrypt(UCI_HANDLE oh, unsigned char * input,
  * @retvla UCI_ERROR    other error occured.
  */
 int cryptocore_ae_decryptbycrt(UCI_HANDLE oh, unsigned char * input,
-    unsigned int input_len, unsigned char * output, size_t* output_len);
+    unsigned int input_len, unsigned char * output, size_t * output_len);
 
 /**
  * @brief      generate signature for given value
index f695180..a0e1a1b 100755 (executable)
@@ -774,7 +774,7 @@ int cryptocore_ae_decrypt(UCI_HANDLE oh, unsigned char *input,
 }
 
 int cryptocore_ae_decryptbycrt(UCI_HANDLE oh, unsigned char *input,
-    unsigned int input_len, unsigned char *output, unsigned int *output_len) {
+    unsigned int input_len, unsigned char *output, size_t *output_len) {
 
        int ret;
        uci_context_s *pctx = (uci_context_s*)oh;
@@ -789,8 +789,10 @@ int cryptocore_ae_decryptbycrt(UCI_HANDLE oh, unsigned char *input,
 
        //  ctr=(CryptoCoreContainer *)(pctx->imp);
        //  ctr->MD_update(ctr,msg,msg_len);
+       cc_u32 output_len32 = (cc_u32)(*output_len);
        ret = ((CryptoCoreContainer *)pctx->imp)->AE_decryptByCRT(
-           ((CryptoCoreContainer*)pctx->imp), input, input_len, output, output_len);
+           ((CryptoCoreContainer*)pctx->imp), input, input_len, output, &output_len32);
+       *output_len = (size_t)output_len32;
        if (ret == CRYPTO_MSG_TOO_LONG) {
                return UCI_MSG_TOO_LONG;
        }