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

Side by Side Diff: openssl/crypto/sha/shatest.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_locl.h ('k') | openssl/crypto/sparccpuid.S » ('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/shatest.c */ 1 /* crypto/sha/shatest.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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 ebcdic2ascii(test[0], test[0], strlen(test[0])); 116 ebcdic2ascii(test[0], test[0], strlen(test[0]));
117 ebcdic2ascii(test[1], test[1], strlen(test[1])); 117 ebcdic2ascii(test[1], test[1], strlen(test[1]));
118 #endif 118 #endif
119 119
120 EVP_MD_CTX_init(&c); 120 EVP_MD_CTX_init(&c);
121 P=test; 121 P=test;
122 R=ret; 122 R=ret;
123 i=1; 123 i=1;
124 while (*P != NULL) 124 while (*P != NULL)
125 { 125 {
126 » » EVP_Digest(*P,strlen((char *)*P),md,NULL,EVP_sha(), NULL); 126 » » EVP_Digest(*P,strlen(*P),md,NULL,EVP_sha(), NULL);
127 p=pt(md); 127 p=pt(md);
128 » » if (strcmp(p,(char *)*R) != 0) 128 » » if (strcmp(p,*R) != 0)
129 { 129 {
130 printf("error calculating SHA on '%s'\n",*P); 130 printf("error calculating SHA on '%s'\n",*P);
131 printf("got %s instead of %s\n",p,*R); 131 printf("got %s instead of %s\n",p,*R);
132 err++; 132 err++;
133 } 133 }
134 else 134 else
135 printf("test %d ok\n",i); 135 printf("test %d ok\n",i);
136 i++; 136 i++;
137 R++; 137 R++;
138 P++; 138 P++;
(...skipping 30 matching lines...) Expand all
169 static char *pt(unsigned char *md) 169 static char *pt(unsigned char *md)
170 { 170 {
171 int i; 171 int i;
172 static char buf[80]; 172 static char buf[80];
173 173
174 for (i=0; i<SHA_DIGEST_LENGTH; i++) 174 for (i=0; i<SHA_DIGEST_LENGTH; i++)
175 sprintf(&(buf[i*2]),"%02x",md[i]); 175 sprintf(&(buf[i*2]),"%02x",md[i]);
176 return(buf); 176 return(buf);
177 } 177 }
178 #endif 178 #endif
OLDNEW
« no previous file with comments | « openssl/crypto/sha/sha_locl.h ('k') | openssl/crypto/sparccpuid.S » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698