diff options
Diffstat (limited to 'src/lib/libcrypto/evp/encode.c')
-rw-r--r-- | src/lib/libcrypto/evp/encode.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/evp/encode.c b/src/lib/libcrypto/evp/encode.c index 5921f0d710..33e540087d 100644 --- a/src/lib/libcrypto/evp/encode.c +++ b/src/lib/libcrypto/evp/encode.c | |||
@@ -129,14 +129,14 @@ void EVP_EncodeInit(EVP_ENCODE_CTX *ctx) | |||
129 | } | 129 | } |
130 | 130 | ||
131 | void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, | 131 | void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, |
132 | const unsigned char *in, int inl) | 132 | unsigned char *in, int inl) |
133 | { | 133 | { |
134 | int i,j; | 134 | int i,j; |
135 | unsigned int total=0; | 135 | unsigned int total=0; |
136 | 136 | ||
137 | *outl=0; | 137 | *outl=0; |
138 | if (inl == 0) return; | 138 | if (inl == 0) return; |
139 | OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data)); | 139 | OPENSSL_assert(ctx->length <= sizeof ctx->enc_data); |
140 | if ((ctx->num+inl) < ctx->length) | 140 | if ((ctx->num+inl) < ctx->length) |
141 | { | 141 | { |
142 | memcpy(&(ctx->enc_data[ctx->num]),in,inl); | 142 | memcpy(&(ctx->enc_data[ctx->num]),in,inl); |
@@ -233,7 +233,7 @@ void EVP_DecodeInit(EVP_ENCODE_CTX *ctx) | |||
233 | * 1 for full line | 233 | * 1 for full line |
234 | */ | 234 | */ |
235 | int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, | 235 | int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, |
236 | const unsigned char *in, int inl) | 236 | unsigned char *in, int inl) |
237 | { | 237 | { |
238 | int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,n,ln,tmp2,exp_nl; | 238 | int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,n,ln,tmp2,exp_nl; |
239 | unsigned char *d; | 239 | unsigned char *d; |
@@ -259,7 +259,7 @@ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, | |||
259 | /* only save the good data :-) */ | 259 | /* only save the good data :-) */ |
260 | if (!B64_NOT_BASE64(v)) | 260 | if (!B64_NOT_BASE64(v)) |
261 | { | 261 | { |
262 | OPENSSL_assert(n < (int)sizeof(ctx->enc_data)); | 262 | OPENSSL_assert(n < sizeof ctx->enc_data); |
263 | d[n++]=tmp; | 263 | d[n++]=tmp; |
264 | ln++; | 264 | ln++; |
265 | } | 265 | } |
@@ -323,8 +323,8 @@ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, | |||
323 | if (n > 0) | 323 | if (n > 0) |
324 | { | 324 | { |
325 | v=EVP_DecodeBlock(out,d,n); | 325 | v=EVP_DecodeBlock(out,d,n); |
326 | n=0; | ||
327 | if (v < 0) { rv=0; goto end; } | 326 | if (v < 0) { rv=0; goto end; } |
327 | n=0; | ||
328 | ret+=(v-eof); | 328 | ret+=(v-eof); |
329 | } | 329 | } |
330 | else | 330 | else |