net: lwm2m: Use the actual data size when provisioning PSK ID
"Public Key or Identity" resource is of opaque data type, therefore it's not correct to assume it will be a NULL terminated string (the existing servers, for instance Leshan, does not include NULL terminator). Use the actual size associated with the resource instead. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
f223d0a86f
commit
f35d88503a
1 changed files with 0 additions and 5 deletions
|
@ -4255,11 +4255,6 @@ static int load_tls_credential(struct lwm2m_ctx *client_ctx, uint16_t res_id,
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* Set correct PSK_ID length */
|
||||
if (type == TLS_CREDENTIAL_PSK_ID) {
|
||||
cred_len = strlen(cred);
|
||||
}
|
||||
|
||||
ret = tls_credential_add(client_ctx->tls_tag, type, cred, cred_len);
|
||||
if (ret < 0) {
|
||||
LOG_ERR("Error setting cred tag %d type %d: Error %d",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue