projects
/
platform
/
core
/
security
/
yaca.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3e2ead0
)
Fix assert vs error codes usage in get_sign_output_length()
84/69984/2
author
Lukasz Pawelczyk
<l.pawelczyk@samsung.com>
Tue, 17 May 2016 13:07:18 +0000
(15:07 +0200)
committer
Dariusz Michaluk
<d.michaluk@samsung.com>
Wed, 18 May 2016 07:16:05 +0000
(
00:16
-0700)
Change-Id: Ieca2200d6f844590ed16b0dc314e56a4572c5dfa
src/sign.c
patch
|
blob
|
history
diff --git
a/src/sign.c
b/src/sign.c
index
7dd2a73
..
3ad2279
100644
(file)
--- a/
src/sign.c
+++ b/
src/sign.c
@@
-60,9
+60,14
@@
static int get_sign_output_length(const yaca_ctx_h ctx, size_t input_len, size_t
{
struct yaca_sign_ctx_s *c = get_sign_ctx(ctx);
- if (c == NULL
|| c->mdctx == NULL || c->mdctx->pctx == NULL
)
+ if (c == NULL)
return YACA_ERROR_INVALID_ARGUMENT;
+ assert(c->mdctx != NULL);
+
+ if (c->mdctx->pctx == NULL)
+ return YACA_ERROR_INTERNAL;
+
EVP_PKEY *pkey = EVP_PKEY_CTX_get0_pkey(c->mdctx->pctx);
if (pkey == NULL) {
ERROR_DUMP(YACA_ERROR_INVALID_ARGUMENT);