MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / MD5Final

Function MD5Final

md5.c:170–193  ·  view source on GitHub ↗

MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. unsigned char digest[16] - message digest MD5_CTX *context - context */

Source from the content-addressed store, hash-verified

168 MD5_CTX *context - context
169 */
170void MD5Final (char digest[16], MD5_CTX *context)
171{
172 unsigned char bits[8];
173 unsigned int index, padLen;
174
175 /* Save number of bits */
176 Encode (bits, context->count, 8);
177
178 /* Pad out to 56 mod 64.
179*/
180 index = (unsigned int)((context->count[0] >> 3) & 0x3f);
181 padLen = (index < 56) ? (56 - index) : (120 - index);
182 MD5Update (context, (const char *)PADDING, padLen);
183
184 /* Append length (before padding) */
185 MD5Update (context, (const char *)bits, 8);
186
187 /* Store state in digest */
188 Encode ((unsigned char *)digest, context->state, 16);
189
190 /* Zeroize sensitive information.
191*/
192 MD5_memset ((POINTER)context, 0, sizeof (*context));
193}
194
195/* MD5 basic transformation. Transforms state based on block.
196 */

Callers 9

MD5StringArrayFunction · 0.85
MD5FileFunction · 0.85
compute_md5Function · 0.85
dr_reload_data_headFunction · 0.85
trie_reload_data_headFunction · 0.85
digest_calc_HA1Function · 0.85
digest_calc_HA1sessFunction · 0.85
digest_calc_HA2Function · 0.85
_digest_calc_responseFunction · 0.85

Calls 3

EncodeFunction · 0.85
MD5UpdateFunction · 0.85
MD5_memsetFunction · 0.85

Tested by

no test coverage detected