Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: openssl/crypto/evp/e_xcbc_d.c

Issue 9254031: Upgrade chrome's OpenSSL to same version Android ships with. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/openssl/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « openssl/crypto/evp/e_seed.c ('k') | openssl/crypto/evp/enc_min.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: openssl/crypto/evp/e_xcbc_d.c
===================================================================
--- openssl/crypto/evp/e_xcbc_d.c (revision 105093)
+++ openssl/crypto/evp/e_xcbc_d.c (working copy)
@@ -63,12 +63,13 @@
#include <openssl/evp.h>
#include <openssl/objects.h>
+#include "evp_locl.h"
#include <openssl/des.h>
static int desx_cbc_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key,
const unsigned char *iv,int enc);
static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
- const unsigned char *in, unsigned int inl);
+ const unsigned char *in, size_t inl);
typedef struct
@@ -113,13 +114,25 @@
}
static int desx_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
- const unsigned char *in, unsigned int inl)
+ const unsigned char *in, size_t inl)
{
- DES_xcbc_encrypt(in,out,inl,&data(ctx)->ks,
+ while (inl>=EVP_MAXCHUNK)
+ {
+ DES_xcbc_encrypt(in,out,(long)EVP_MAXCHUNK,&data(ctx)->ks,
(DES_cblock *)&(ctx->iv[0]),
&data(ctx)->inw,
&data(ctx)->outw,
ctx->encrypt);
+ inl-=EVP_MAXCHUNK;
+ in +=EVP_MAXCHUNK;
+ out+=EVP_MAXCHUNK;
+ }
+ if (inl)
+ DES_xcbc_encrypt(in,out,(long)inl,&data(ctx)->ks,
+ (DES_cblock *)&(ctx->iv[0]),
+ &data(ctx)->inw,
+ &data(ctx)->outw,
+ ctx->encrypt);
return 1;
}
#endif
« no previous file with comments | « openssl/crypto/evp/e_seed.c ('k') | openssl/crypto/evp/enc_min.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698