2 * Copyright (c) 2014 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "StringTlvEncoder.h"
20 #include "AsmHelper.h"
21 #include "AuthnrTypes.h"
23 StringTlvEncoder::StringTlvEncoder(void) {}
26 StringTlvEncoder::encode(const void *strTlv)
32 StringTlvEncoder::decode(const uint8_t *rawData)
34 _INFO("StringTlvEncoder start");
36 RET_IF_FAIL(rawData != NULL, NULL);
38 tlv_s *tlv = tlv_decode(rawData);
39 RET_IF_FAIL(tlv != NULL, NULL);
41 tlv->val = (uint8_t*)realloc(tlv->val, tlv->len + 1);
42 char *val = (char *)tlv->val;
48 _INFO("StringTlvEncoder end");