summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Swierczek <t.swierczek@samsung.com>2020-09-11 14:39:10 +0200
committerTomasz Swierczek <t.swierczek@samsung.com>2020-09-11 14:39:10 +0200
commit022a7fc40a6f04858498b77aab240388d4047d19 (patch)
tree42839311a15b20a7e50a5ddbe0eef54465685760
parentfe1840be4019209ea54141667665d4a1c2c298bd (diff)
downloadlibcryptsvc-022a7fc40a6f04858498b77aab240388d4047d19.tar.gz
libcryptsvc-022a7fc40a6f04858498b77aab240388d4047d19.tar.bz2
libcryptsvc-022a7fc40a6f04858498b77aab240388d4047d19.zip
Add error checking of PKCS5_PBKDF2_HMAC_SHA1 function
Change-Id: I937c1bf7764d2de16ddecf6c540ef3d88ac5c225
-rw-r--r--srcs/SecCryptoSvc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/srcs/SecCryptoSvc.c b/srcs/SecCryptoSvc.c
index 95861de..d5452e3 100644
--- a/srcs/SecCryptoSvc.c
+++ b/srcs/SecCryptoSvc.c
@@ -1,7 +1,7 @@
/*
* libcryptsvc - device unique key
*
- * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) 2000 - 2020 Samsung Electronics Co., Ltd All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -233,7 +233,10 @@ char *GetDuid(int idSize)
goto exit;
}
- PKCS5_PBKDF2_HMAC_SHA1(info, 8, pKey, idSize, 1, idSize, pDuid);
+ if (!PKCS5_PBKDF2_HMAC_SHA1(info, 8, pKey, idSize, 1, idSize, pDuid)) {
+ SLOGE("Error in PKCS5_PBKDF2_HMAC_SHA1");
+ goto exit;
+ }
if (!(pId = Base64Encoding((char *)pDuid, idSize))) {
SLOGE("Failed to convert to base64 string");