diff options
Diffstat (limited to 'src/lib/libcrypto/pem/pem_seal.c')
-rw-r--r-- | src/lib/libcrypto/pem/pem_seal.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libcrypto/pem/pem_seal.c b/src/lib/libcrypto/pem/pem_seal.c index 59690b56ae..b6b4e13498 100644 --- a/src/lib/libcrypto/pem/pem_seal.c +++ b/src/lib/libcrypto/pem/pem_seal.c | |||
@@ -96,7 +96,8 @@ int PEM_SealInit(PEM_ENCODE_SEAL_CTX *ctx, EVP_CIPHER *type, EVP_MD *md_type, | |||
96 | EVP_EncodeInit(&ctx->encode); | 96 | EVP_EncodeInit(&ctx->encode); |
97 | 97 | ||
98 | EVP_MD_CTX_init(&ctx->md); | 98 | EVP_MD_CTX_init(&ctx->md); |
99 | EVP_SignInit(&ctx->md,md_type); | 99 | if (!EVP_SignInit(&ctx->md,md_type)) |
100 | goto err; | ||
100 | 101 | ||
101 | EVP_CIPHER_CTX_init(&ctx->cipher); | 102 | EVP_CIPHER_CTX_init(&ctx->cipher); |
102 | ret=EVP_SealInit(&ctx->cipher,type,ek,ekl,iv,pubk,npubk); | 103 | ret=EVP_SealInit(&ctx->cipher,type,ek,ekl,iv,pubk,npubk); |
@@ -163,7 +164,8 @@ int PEM_SealFinal(PEM_ENCODE_SEAL_CTX *ctx, unsigned char *sig, int *sigl, | |||
163 | goto err; | 164 | goto err; |
164 | } | 165 | } |
165 | 166 | ||
166 | EVP_EncryptFinal_ex(&ctx->cipher,s,(int *)&i); | 167 | if (!EVP_EncryptFinal_ex(&ctx->cipher,s,(int *)&i)) |
168 | goto err; | ||
167 | EVP_EncodeUpdate(&ctx->encode,out,&j,s,i); | 169 | EVP_EncodeUpdate(&ctx->encode,out,&j,s,i); |
168 | *outl=j; | 170 | *outl=j; |
169 | out+=j; | 171 | out+=j; |