Ignore:
Timestamp:
May 11, 2007 10:37:14 AM (17 years ago)
Author:
bennylp
Message:

Fixed missing padding when calculating MESSAGE-INTEGRITY in STUN

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib-util/include/pjlib-util/hmac_md5.h

    r1001 r1265  
    3030 
    3131#include <pj/types.h> 
     32#include <pjlib-util/md5.h> 
    3233 
    3334PJ_BEGIN_DECL 
     
    4142 * for Message Authentication, as described in RFC 2104 
    4243 */ 
     44 
     45/** 
     46 * The HMAC-MD5 context used in the incremental HMAC calculation. 
     47 */ 
     48typedef struct pj_hmac_md5_context 
     49{ 
     50    pj_md5_context  context;    /**< MD5 context            */ 
     51    pj_uint8_t      k_opad[64]; /**< opad xor-ed with key   */ 
     52} pj_hmac_md5_context; 
    4353 
    4454 
     
    5868 
    5969/** 
     70 * Initiate HMAC-MD5 context for incremental hashing. 
     71 * 
     72 * @param hctx          HMAC-MD5 context. 
     73 * @param key           Pointer to the authentication key. 
     74 * @param key_len       Length of the authentication key. 
     75 */ 
     76PJ_DECL(void) pj_hmac_md5_init(pj_hmac_md5_context *hctx,  
     77                               const pj_uint8_t *key, unsigned key_len); 
     78 
     79/** 
     80 * Append string to the message. 
     81 * 
     82 * @param hctx          HMAC-MD5 context. 
     83 * @param input         Pointer to the input stream. 
     84 * @param input_len     Length of input stream in bytes. 
     85 */ 
     86PJ_DECL(void) pj_hmac_md5_update(pj_hmac_md5_context *hctx, 
     87                                 const pj_uint8_t *input,  
     88                                 unsigned input_len); 
     89 
     90/** 
     91 * Finish the message and return the digest.  
     92 * 
     93 * @param hctx          HMAC-MD5 context. 
     94 * @param digest        Buffer to be filled with HMAC MD5 digest. 
     95 */ 
     96PJ_DECL(void) pj_hmac_md5_final(pj_hmac_md5_context *hctx, 
     97                                pj_uint8_t digest[16]); 
     98 
     99/** 
    60100 * @} 
    61101 */ 
Note: See TracChangeset for help on using the changeset viewer.