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

Side by Side Diff: openssl/crypto/sha/sha1_one.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « openssl/crypto/sha/sha.h ('k') | openssl/crypto/sha/sha1dgst.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* crypto/sha/sha1_one.c */ 1 /* crypto/sha/sha1_one.c */
2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * This package is an SSL implementation written 5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com). 6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL. 7 * The implementation was written so as to conform with Netscapes SSL.
8 * 8 *
9 * This library is free for commercial and non-commercial use as long as 9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions 10 * the following conditions are aheared to. The following conditions
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 * derivative of this code cannot be changed. i.e. this code cannot simply be 54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence 55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59 #include <stdio.h> 59 #include <stdio.h>
60 #include <string.h> 60 #include <string.h>
61 #include <openssl/sha.h> 61 #include <openssl/sha.h>
62 #include <openssl/crypto.h> 62 #include <openssl/crypto.h>
63 63
64 #if !defined(OPENSSL_NO_SHA1) 64 #ifndef OPENSSL_NO_SHA1
65 unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md) 65 unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md)
66 { 66 {
67 SHA_CTX c; 67 SHA_CTX c;
68 static unsigned char m[SHA_DIGEST_LENGTH]; 68 static unsigned char m[SHA_DIGEST_LENGTH];
69 69
70 if (md == NULL) md=m; 70 if (md == NULL) md=m;
71 if (!SHA1_Init(&c)) 71 if (!SHA1_Init(&c))
72 return NULL; 72 return NULL;
73 SHA1_Update(&c,d,n); 73 SHA1_Update(&c,d,n);
74 SHA1_Final(md,&c); 74 SHA1_Final(md,&c);
75 OPENSSL_cleanse(&c,sizeof(c)); 75 OPENSSL_cleanse(&c,sizeof(c));
76 return(md); 76 return(md);
77 } 77 }
78 #endif 78 #endif
OLDNEW
« no previous file with comments | « openssl/crypto/sha/sha.h ('k') | openssl/crypto/sha/sha1dgst.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698