diff options
| author | miod <> | 2014-04-13 15:16:40 +0000 |
|---|---|---|
| committer | miod <> | 2014-04-13 15:16:40 +0000 |
| commit | 52628ee3f51f011b463aaedb1a28aa0524b43cb3 (patch) | |
| tree | 4bd2adeac981051908ec5756401424bbb4e57d6a /src/lib/libcrypto/pem/pem_seal.c | |
| parent | 40c22d3625a3818690c889ed6216fedf2be522c9 (diff) | |
| download | openbsd-52628ee3f51f011b463aaedb1a28aa0524b43cb3.tar.gz openbsd-52628ee3f51f011b463aaedb1a28aa0524b43cb3.tar.bz2 openbsd-52628ee3f51f011b463aaedb1a28aa0524b43cb3.zip | |
Import OpenSSL 1.0.1g
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; |
