Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
bc2e1f9
Add ability to choose key generation strategy.
am1kk Jul 26, 2016
c384b4d
User key strategy small fix.
Jul 27, 2016
21aacb8
Review fixes.
Aug 8, 2016
ba58c85
Add Objective-C code and description to "Your First Kaa Application" …
Aug 11, 2016
ed11f20
Review fixes, comment code.
Aug 12, 2016
da53961
Review fixes.
Aug 12, 2016
15aa274
One more review fixes.
Aug 12, 2016
f380388
Define upperTemperatureLimit and lowerTemperatureLimit as constants, …
Aug 12, 2016
8bb2c46
KAA-676 Cross-compilation guide for C SDK (Intel Edison) on Linux pla…
mlysenko Aug 17, 2016
0c7af59
KAA-676 Minor changes to the guide (after review).
mlysenko Aug 25, 2016
39115c2
CTL update of notifications
Kirill380 Aug 26, 2016
261766a
Notification documentation small fixes
Kirill380 Aug 26, 2016
da035b6
CTL update of configuration documentation
Kirill380 Aug 26, 2016
2278678
CTL update of data collection documentation
Kirill380 Aug 26, 2016
6c30dac
Merge branch 'develop' into feature/KAA-1340
Kirill380 Aug 26, 2016
6a41b06
Style: minor changes to document structure
mlysenko Aug 29, 2016
b86ed5d
KAA-1165: Endpoint ownerhsip - initial commit.
Aug 30, 2016
4843b34
Fix temperature limit.
Aug 30, 2016
66962b5
KAA-1165: Endpoint ownership - reviewed.
Aug 30, 2016
dfddbaa
KAA-1165: Endpoint ownership - fixed upon AK review.
Sep 6, 2016
2f0aa58
Merge branch 'develop' into feature/KAA-1340
Kirill380 Sep 9, 2016
558cd43
KAA-1407 Simplify git flow
rasendubi Sep 9, 2016
ebb28d2
Changed links to ctl creation
Kirill380 Sep 12, 2016
4a48763
Fix default key generation strategy.
Sep 13, 2016
0849ff4
Add documentation for new parameter.
Sep 13, 2016
1690d96
Changed jackson version in docs.
Polinaa Sep 14, 2016
ffdac54
KAA-1293: Move email and user existence check methods from Web UI to …
Pyshankov Sep 14, 2016
fad26a1
KAA-1431: Configuration parameter for default notification TTL
Pyshankov Sep 15, 2016
84845bc
KAA-1431: Configuration parameter for default notification TTL
Pyshankov Sep 15, 2016
b9dc0a7
add applied changes to documentation
Pyshankov Sep 15, 2016
3416a4a
add applied changes to documentation
Pyshankov Sep 15, 2016
719ee0a
Added a requirenment to build Boost and Avro for a host machine to cr…
mlysenko Sep 15, 2016
c2d7916
Fixed typos
mlysenko Sep 15, 2016
68020fa
KAA-1371: Update Programming guide -> Your first Kaa application
nocs00 Sep 15, 2016
6879012
Fixed shell commands
mlysenko Sep 16, 2016
b14e9bb
Fix problem with log delivery time
Kirill380 Sep 16, 2016
351421c
Merge pull request #1065 from Polinaa/feature/KAA-1374
ikulikov Sep 16, 2016
01c1dd1
Merge pull request #1079 from Kirill380/feature/KAA-1220
ikulikov Sep 16, 2016
44f8ace
Merge pull request #1075 from nocs00/KAA-1371
ikulikov Sep 16, 2016
fc79da2
KAA-1436: Fixed REST for fetching credentials status
Sep 16, 2016
12e7252
KAA-1114 C SDK porting guide
rasendubi Sep 18, 2016
68ee499
Fixed typos
mlysenko Sep 19, 2016
4ea908b
Merge pull request #984 from mlysenko/KAA-676
vadimol Sep 19, 2016
b1aaf4e
Merge pull request #1078 from mlysenko/KAA-1356
vadimol Sep 19, 2016
cb58f0c
Merge branch 'develop' into feature/KAA-1340
Kirill380 Sep 19, 2016
e630439
Merge pull request #1082 from rasendubi/KAA-1114
vadimol Sep 19, 2016
48a432a
Changed description about log schema creation
Kirill380 Sep 19, 2016
ef94116
Small content fixes
Kirill380 Sep 19, 2016
b37c8a2
Configuration parameter for default notification TTL
Pyshankov Sep 19, 2016
1754512
KAA-1157 - Delete explorer_icons.png
dr3amf4ll Jul 15, 2016
49f27d2
KAA-1157 - Add files via upload
dr3amf4ll Jul 15, 2016
d773263
KAA-1157 - Rest api images url fix
dr3amf4ll Jul 15, 2016
8d2217f
KAA-1157 - Add blockquote.note class
dr3amf4ll Jul 25, 2016
3ee1669
KAA-1157 - Update styles.css
dr3amf4ll Jul 25, 2016
9eb1f7b
KAA-1157 - Update styles.css
dr3amf4ll Jul 25, 2016
c2044e8
KAA-1418 Obj-C Podspec updated. License updated (+1 squashed commit)
vilimets Sep 15, 2016
830ed0f
Fix with C++ event generation
Kirill380 Sep 19, 2016
529bb67
KAA-1419: Fix status file management logic
Sep 20, 2016
c27a6b0
Merge pull request #1086 from GamovCoder/KAA-1419
rasendubi Sep 20, 2016
ff9a76b
Merge pull request #1085 from Kirill380/feature/KAA-1439
ikulikov Sep 20, 2016
8bb5c05
KAA-1436: Remove unused variable in method KaaClient.getCredentialsSt…
Sep 20, 2016
8bfaf25
Merge pull request #1022 from Kirill380/feature/KAA-1340
ikulikov Sep 20, 2016
ab05613
Merge pull request #1081 from Rib47/kaa-1436
ikulikov Sep 20, 2016
66f0d2f
Fixed C++ examples.
Acarus Sep 20, 2016
478093e
KAA-1444: Method 'editUser' fixed.
Sep 20, 2016
7488ab7
Merge pull request #1089 from chv348/KAA-1444
ikulikov Sep 21, 2016
57422cd
KAA-1375 [C++ SDK] Failed to parse or compile schema: Input stream is…
vadimol Sep 20, 2016
168ca0d
Merge pull request #900 from sparadiuk/develop
vadimol Sep 21, 2016
ec0fad1
Merge pull request #1 from Acarus/kaa-1165-EPownership-review
hunch7 Sep 21, 2016
54975ed
Fixed uuids at rest api.
Acarus Sep 21, 2016
3f5d31c
Merge pull request #1090 from vadimol/KAA-1375
vadimol Sep 21, 2016
4e5e579
KAA-1293: Move email and user existence check methods from Web UI to …
Pyshankov Sep 21, 2016
da28141
Merge pull request #1084 from vilimets/KAA-1418
rasendubi Sep 21, 2016
64bb80d
KAA-1293: Move email and user existence check methods from Web UI to …
Pyshankov Sep 21, 2016
5290902
KAA-1371: Your first Kaa application (updated with CTL info).
Sep 21, 2016
1105a30
Merge pull request #1069 from Pyshankov/KAA-1293
ikulikov Sep 22, 2016
b57823d
KAA-1340: Data collection - Minor rewording.
Sep 22, 2016
a57590e
KAA-1371: Your first Kaa application - fixed upon developer review.
Sep 22, 2016
c828f17
KAA-1340: Endpoint profiles - fixed upon developer review.
Sep 22, 2016
6aadc7c
Merge pull request #1097 from hunch7/kaa-1340-EPprofiles-CTLupdate
ikulikov Sep 22, 2016
933a72b
Merge pull request #1095 from hunch7/kaa-1340-CTLupdate
ikulikov Sep 22, 2016
4558d3e
Merge pull request #1093 from hunch7/kaa-1371-kaaplication-CTLupdate
ikulikov Sep 22, 2016
7989b79
KAA-1168: Events - initial commit.
Sep 22, 2016
2223024
KAA-1166: Configuration management - typo fixed.
Sep 22, 2016
43c3708
Merge pull request #1098 from hunch7/kaa-1166-configuration-review
ikulikov Sep 22, 2016
af43446
KAA-1310: Add validation of endpoint state while receiving events
ashvayka Sep 22, 2016
e2d7182
KAA-1364: [C SDK] Fix undefined references when encryption is disabled
RostakaGmfun Aug 19, 2016
4a5daab
KAA-1401: added assisted attachment sample Java code
nocs00 Sep 22, 2016
d08c50f
Merge pull request #2 from nocs00/KAA-1401_review
hunch7 Sep 22, 2016
b8dd0bd
KAA-1168: Events - interim commit.
Sep 22, 2016
314ed14
KAA-1208: Same response comes again from Server
ashvayka Sep 22, 2016
00eed4e
Merge pull request #1099 from ashvayka/bug/KAA-1310
ikulikov Sep 22, 2016
977dcb3
KAA-1135: Using Kaa endpoint SDKs - reviewed.
Sep 22, 2016
565570c
Fixed an inappropriate work with arrays in injectUuidsFromJsonNodes.
Acarus Sep 23, 2016
964eae0
KAA-1442: editUser() fixed sending email with temp password
nocs00 Sep 22, 2016
c802d8d
KAA-1442: configuration for mocking MessagingService
nocs00 Sep 22, 2016
1930c83
Merge pull request #1004 from RostakaGmfun/KAA-1364
vadimol Sep 23, 2016
edfaffa
KAA-1168: Events - interim commit.
Sep 23, 2016
a3fe68c
Merge pull request #1092 from Acarus/bug/KAA-1446
ikulikov Sep 23, 2016
57bd832
KAA-1208: Test fix
ashvayka Sep 23, 2016
5891f2f
KAA-1168: Events - reviewed.
Sep 23, 2016
ef2c2e8
Merge pull request #1100 from ashvayka/bug/KAA-1208
ikulikov Sep 23, 2016
d3af4ca
KAA-1418 Obj-C CocoaLumberjack pod version specified
vilimets Sep 23, 2016
28c5326
Merge pull request #963 from am1kk/KAA-1222
rasendubi Sep 23, 2016
5c2c665
KAA-1147: Using Kaa endpoint SDKs, C++ - reviewed.
Sep 23, 2016
564ca77
KAA-1147: Using endpoint SDKs, C++ - small fix (TOC added).
Sep 23, 2016
13ab145
KAA-1401: changed java sample for assisted attachment
nocs00 Sep 23, 2016
135ba45
Merge pull request #1103 from vilimets/KAA-1418
vadimol Sep 23, 2016
0994cae
Merge pull request #3 from nocs00/KAA-1401_review2
hunch7 Sep 23, 2016
ee93fbe
KAA-1328: Update log appenders documentation according to data collec…
sashadidukh Sep 23, 2016
85c8c28
Merge pull request #1055 from rasendubi/KAA-1407
rasendubi Sep 24, 2016
e685c81
Merge pull request #902 from dr3amf4ll/patch-2
rasendubi Sep 24, 2016
bf3aeaa
Merge pull request #1102 from nocs00/KAA-1442
ikulikov Sep 26, 2016
45a68a6
Merge pull request #1106 from sashadidukh/bug/KAA-1328
ikulikov Sep 26, 2016
ba00092
Merge pull request #1028 from hunch7/kaa-1165-EPownership-review
ikulikov Sep 26, 2016
2a1eba9
Merge pull request #1105 from hunch7/kaa-1168-events-review
ikulikov Sep 26, 2016
d6a9c6c
Configuration parameter for default notification TTL
Pyshankov Sep 26, 2016
40f4946
Merge pull request #1076 from Pyshankov/KAA-1431
ikulikov Sep 26, 2016
8af2f75
Merge pull request #918 from am1kk/KAA-1234
vadimol Sep 26, 2016
89bc704
Merge pull request #1101 from hunch7/kaa-1135-endpointSDKs-review
ikulikov Sep 26, 2016
b1f2422
Merge pull request #1104 from hunch7/kaa-1147-endpointSDKs-cpp
ikulikov Sep 26, 2016
3476b77
KAA-1393: Remove unfinished low-priority documentation pages
ashvayka Sep 26, 2016
cf0483b
Documentation - Data collection - minor markup fix.
Sep 26, 2016
3ffdffd
KAA-1393: Removes incomplete low-priority documentation pages
ashvayka Sep 26, 2016
f1b3d58
Merge pull request #1110 from hunch7/kaa-datacollection-fix
ikulikov Sep 26, 2016
553909f
Your first Kaa application - fixed upon QA review.
Sep 27, 2016
af53e5f
Merge pull request #1114 from hunch7/kaa-yourfirstapp-fixes
ikulikov Sep 27, 2016
5308a2d
Merge pull request #1111 from ashvayka/task/KAA-1393
rasendubi Sep 27, 2016
e81871a
Fixed all C++ code samples in new Documentation
sparadiuk Aug 25, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions client/client-multi/client-c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ set(KAA_SOURCE_FILES
${KAA_SRC_FOLDER}/avro_src/io.c
${KAA_SRC_FOLDER}/avro_src/encoding_binary.c
${KAA_SRC_FOLDER}/collections/kaa_list.c
${KAA_SRC_FOLDER}/utilities/kaa_aes_rsa.c
${KAA_SRC_FOLDER}/utilities/kaa_log.c
${KAA_SRC_FOLDER}/utilities/kaa_mem.c
${KAA_SRC_FOLDER}/utilities/kaa_buffer.c
Expand All @@ -178,27 +177,38 @@ set(KAA_SOURCE_FILES
${KAA_SRC_FOLDER}/kaa.c
${KAA_SRC_FOLDER}/kaa_extension.c
${KAA_SRC_FOLDER}/platform-impl/common/kaa_htonll.c
)
)

if(WITH_ENCRYPTION)
set(KAA_SOURCE_FILES
${KAA_SOURCE_FILES}
${KAA_SRC_FOLDER}/utilities/kaa_aes_rsa.c
${KAA_SRC_FOLDER}/platform-impl/common/encryption_utils.c)
endif(WITH_ENCRYPTION)


# Includes auto-generated Cmake's scripts.
include(${CMAKE_CURRENT_LIST_DIR}/listfiles/CMakeGen.cmake)

# Kaa include directories
set(KAA_INCLUDE_DIRS
${KAA_INCLUDE_PATHS} # Provided by platform cmake
${KAA_INCLUDE_PATHS}
${CMAKE_CURRENT_LIST_DIR}/src
${CMAKE_CURRENT_LIST_DIR}/thirdparty/mbedtls
${KAA_SRC_FOLDER}
${KAA_THIRDPARTY_INCLUDE_DIR})

# Build unit tests.
include(${CMAKE_CURRENT_LIST_DIR}/listfiles/UnitTest.cmake)

include_directories(SYSTEM ${KAA_INCLUDE_PATHS})

# This already includes mbedtls
add_subdirectory(tools/kaa_encryption/rsa_key_gen)

# Build Kaa libraries.
add_library(kaac ${KAA_SOURCE_FILES})
target_include_directories(kaac PUBLIC ${KAA_INCLUDE_DIRS})
target_link_libraries(kaac PRIVATE ${KAA_THIRDPARTY_LIBRARIES})
target_link_libraries(kaac PRIVATE ${KAA_THIRDPARTY_LIBRARIES} mbedtls)

message("BOOTSTRAP ENABLED")
include(${CMAKE_CURRENT_LIST_DIR}/src/extensions/bootstrap/CMakeLists.txt)
Expand Down Expand Up @@ -281,7 +291,6 @@ if(${KAA_PLATFORM} STREQUAL "posix")
if(${KAA_RUNTIME_KEY_GENERATION})
add_definitions(-DKAA_RUNTIME_KEY_GENERATION)
endif()
add_subdirectory(tools/kaa_encryption/rsa_key_gen)
target_link_libraries(kaac PUBLIC rsa_keygen)
else()
add_dependencies(kaac kaa_rsa_keygen)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ set(ESP8266_SRC
${ESP8266_SRC_FOLDER}/status.c
${ESP8266_SRC_FOLDER}/tcp_utils.c
${ESP8266_SRC_FOLDER}/time.c
${KAA_SRC_FOLDER}/platform-impl/common/key_utils.c
${ESP8266_SRC_FOLDER}/exit.c
${ESP8266_SRC_FOLDER}/snprintf.c
${KAA_SRC_FOLDER}/platform-impl/common/sha.c
${KAA_SRC_FOLDER}/platform-impl/common/kaa_failover_strategy.c
${KAA_SRC_FOLDER}/platform-impl/common/ext_log_storage_memory.c
${KAA_SRC_FOLDER}/platform-impl/common/ext_log_upload_strategies.c
${KAA_SRC_FOLDER}/platform-impl/common/key_utils.c
${KAA_SRC_FOLDER}/platform-impl/common/kaa_tcp_channel.c
${KAA_SRC_FOLDER}/kaa_protocols/kaa_tcp/kaatcp_parser.c
${KAA_SRC_FOLDER}/kaa_protocols/kaa_tcp/kaatcp_request.c
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
set(KAA_SOURCE_FILES
${KAA_SOURCE_FILES}
${KAA_SRC_FOLDER}/platform-impl/posix/kaa_client.c
${KAA_SRC_FOLDER}/platform-impl/posix/key_utils.c
${KAA_SRC_FOLDER}/platform-impl/posix/logger.c
${KAA_SRC_FOLDER}/platform-impl/posix/file_utils.c
${KAA_SRC_FOLDER}/platform-impl/posix/status.c
Expand All @@ -26,6 +25,7 @@ set(KAA_SOURCE_FILES
${KAA_SRC_FOLDER}/platform-impl/common/kaa_failover_strategy.c
${KAA_SRC_FOLDER}/platform-impl/common/ext_log_storage_memory.c
${KAA_SRC_FOLDER}/platform-impl/common/ext_log_upload_strategies.c
${KAA_SRC_FOLDER}/platform-impl/common/key_utils.c
)

if(NOT KAA_WITHOUT_TCP_CHANNEL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <string.h>
#include <inttypes.h>
#include <sys/types.h>
#include <assert.h>
#include "platform/stdio.h"
#include "platform/sock.h"
#include "platform/time.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ kaa_error_t kaa_profile_request_get_size(kaa_profile_manager_t *self, size_t *ex

if (!self->status->is_registered) {
if (!self->extension_data->public_key.buffer) {
ext_get_endpoint_public_key((uint8_t **)&self->extension_data->public_key.buffer,
ext_get_endpoint_public_key((const uint8_t **)&self->extension_data->public_key.buffer,
(size_t *)&self->extension_data->public_key.size);
}

Expand Down
24 changes: 24 additions & 0 deletions client/client-multi/client-c/src/kaa/kaa.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
#include "kaa_defaults.h"
#include "platform/ext_key_utils.h"

#ifdef KAA_ENCRYPTION
#include "platform/ext_encryption_utils.h"
#endif

#include <kaa_extension.h>

#ifndef KAA_DISABLE_FEATURE_PROFILE
Expand Down Expand Up @@ -111,6 +115,26 @@ static kaa_error_t kaa_context_destroy(kaa_context_t *context)
return KAA_ERR_NONE;
}

static kaa_error_t kaa_init_keys(void)
{
kaa_error_t error = kaa_init_rsa_keypair();
if (error) {
return error;
}
#ifdef KAA_ENCRYPTION
error = kaa_init_session_key();
if (error) {
return error;
}
#endif
return error;
}

static void kaa_deinit_keys(void)
{
kaa_deinit_rsa_keypair();
}

kaa_error_t kaa_init(kaa_context_t **kaa_context_p)
{
KAA_RETURN_IF_NIL(kaa_context_p, KAA_ERR_BADPARAM);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
/*
* Copyright 2014-2016 CyberVision, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "platform/ext_encryption_utils.h"
#include "platform/ext_key_utils.h"

#include <stdbool.h>
#include <string.h>

#include <utilities/kaa_aes_rsa.h>

#include <mbedtls/pk.h>
#include <mbedtls/entropy.h>
#include <mbedtls/ctr_drbg.h>
#include <mbedtls/md.h>

#define ENCRYPTED_SESSION_KEY_LENGTH 256
#define KAA_SIGNATURE_LENGTH 256
#define AES_ECB_ENCRYPTION_CHUNK_SIZE 16

extern mbedtls_pk_context kaa_pk_context_;

/**
* Contains Endpoint keys.
*
* The main purpose of the structure is
* caching calculated keys.
*/
static struct {
uint8_t session_key[KAA_SESSION_KEY_LENGTH];
uint8_t encrypted_session_key[ENCRYPTED_SESSION_KEY_LENGTH];
uint8_t signature[KAA_SIGNATURE_LENGTH];
size_t session_key_length;
} keys;

kaa_error_t kaa_init_session_key(void)
{
/* Initialization should be performed only once */
static bool initialized = false;
if (!initialized) {
/* Generate session key */
if (init_aes_key(keys.session_key, KAA_SESSION_KEY_LENGTH)) {
return KAA_ERR_BADDATA;
}

keys.session_key_length = KAA_SESSION_KEY_LENGTH;
initialized = true;
}

return KAA_ERR_NONE;
}

void ext_get_endpoint_session_key(const uint8_t **buffer, size_t *buffer_size)
{
if (buffer == NULL || buffer_size == 0) {
return;
}
*buffer = keys.session_key;
*buffer_size = keys.session_key_length;
}

/* Get encrypted session key (enctypted with remote key) */
kaa_error_t ext_get_encrypted_session_key(uint8_t **buffer, size_t *buffer_size,
const uint8_t *remote_key, size_t remote_key_size)
{
if (buffer == NULL || buffer_size == NULL || remote_key == NULL || remote_key_size == 0) {
return KAA_ERR_BADPARAM;
}

kaa_error_t err = rsa_encrypt(remote_key, remote_key_size, keys.session_key,
KAA_SESSION_KEY_LENGTH, keys.encrypted_session_key);
if (err) {
return err;
}

*buffer = keys.encrypted_session_key;
*buffer_size = ENCRYPTED_SESSION_KEY_LENGTH;

return err;
}
size_t ext_get_encrypted_data_size(size_t input_size)
{
if (input_size == 0) {
return 0;
}

return input_size + AES_ECB_ENCRYPTION_CHUNK_SIZE -
(input_size % AES_ECB_ENCRYPTION_CHUNK_SIZE);
}

kaa_error_t ext_encrypt_data(const uint8_t *input, size_t payload_size, uint8_t *output)
{
if (input == NULL || payload_size == 0 || output == NULL) {
return KAA_ERR_BADPARAM;
}

/* Adding PKCS7 padding */
size_t enc_data_size = ext_get_encrypted_data_size(payload_size);
uint8_t padding = enc_data_size - payload_size;
memset(output + payload_size, padding, padding);

return aes_encrypt_decrypt(MBEDTLS_AES_ENCRYPT, input, enc_data_size,
output, keys.session_key);
}

kaa_error_t ext_decrypt_data(const uint8_t *input, size_t input_size,
uint8_t *output, size_t *output_size)
{
if (input == NULL || input_size == 0 || output == NULL || output_size == 0) {
return KAA_ERR_BADPARAM;
}

if (aes_encrypt_decrypt(MBEDTLS_AES_DECRYPT, input, input_size,
output, keys.session_key)) {
return KAA_ERR_BADPARAM;
}

/* Reduce PKCS7 padding */
uint8_t padding_length = *(output+input_size - 1);
*output_size = input_size - padding_length;

return KAA_ERR_NONE;
}

kaa_error_t ext_get_signature(const uint8_t *input, size_t input_size,
uint8_t **output, size_t *output_size)
{
if (!input || !input_size || !output || !output_size) {
return KAA_ERR_BADPARAM;
}

kaa_error_t error = rsa_sign(&kaa_pk_context_, input, input_size, keys.signature, output_size);

if (error) {
return KAA_ERR_BADDATA;
}
*output = keys.signature;
*output_size = KAA_SIGNATURE_LENGTH;

return KAA_ERR_NONE;
}

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "platform/ext_system_logger.h"
#include <platform/time.h>
#include "kaa_platform_common.h"
#include "platform/ext_key_utils.h"
#include "platform/ext_encryption_utils.h"
#include "kaa_tcp_channel.h"
#include "kaa_context.h"
#include "kaa_channel_manager.h"
Expand Down
Loading