OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 | 4 |
5 #ifdef FREEBL_NO_DEPEND | 5 #ifdef FREEBL_NO_DEPEND |
6 #include "stubs.h" | 6 #include "stubs.h" |
7 #endif | 7 #endif |
8 | 8 |
9 #include "prerr.h" | 9 #include "prerr.h" |
10 #include "secerr.h" | 10 #include "secerr.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 191 |
192 #define inBuf u.b | 192 #define inBuf u.b |
193 | 193 |
194 SECStatus | 194 SECStatus |
195 MD5_Hash(unsigned char *dest, const char *src) | 195 MD5_Hash(unsigned char *dest, const char *src) |
196 { | 196 { |
197 return MD5_HashBuf(dest, (const unsigned char *)src, PORT_Strlen(src)); | 197 return MD5_HashBuf(dest, (const unsigned char *)src, PORT_Strlen(src)); |
198 } | 198 } |
199 | 199 |
200 SECStatus | 200 SECStatus |
201 MD5_HashBuf(unsigned char *dest, const unsigned char *src, uint32 src_length) | 201 MD5_HashBuf(unsigned char *dest, const unsigned char *src, PRUint32 src_length) |
202 { | 202 { |
203 unsigned int len; | 203 unsigned int len; |
204 MD5Context cx; | 204 MD5Context cx; |
205 | 205 |
206 MD5_Begin(&cx); | 206 MD5_Begin(&cx); |
207 MD5_Update(&cx, src, src_length); | 207 MD5_Update(&cx, src, src_length); |
208 MD5_End(&cx, dest, &len, MD5_HASH_LEN); | 208 MD5_End(&cx, dest, &len, MD5_HASH_LEN); |
209 memset(&cx, 0, sizeof cx); | 209 memset(&cx, 0, sizeof cx); |
210 return SECSuccess; | 210 return SECSuccess; |
211 } | 211 } |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 void MD5_Clone(MD5Context *dest, MD5Context *src) | 585 void MD5_Clone(MD5Context *dest, MD5Context *src) |
586 { | 586 { |
587 memcpy(dest, src, sizeof *dest); | 587 memcpy(dest, src, sizeof *dest); |
588 } | 588 } |
589 | 589 |
590 void | 590 void |
591 MD5_TraceState(MD5Context *cx) | 591 MD5_TraceState(MD5Context *cx) |
592 { | 592 { |
593 PORT_SetError(PR_NOT_IMPLEMENTED_ERROR); | 593 PORT_SetError(PR_NOT_IMPLEMENTED_ERROR); |
594 } | 594 } |
OLD | NEW |