Lines Matching refs:key

81  *     priv_key    key to use for signing.
98 HMAC_Key *key;
112 key = (HMAC_Key *) d_key->dk_KEY_struct;
116 MD5Update(ctx, key->hk_ipad, HMAC_LEN);
129 MD5Update(ctx, key->hk_opad, HMAC_LEN);
152 * dkey key to use for verify.
167 HMAC_Key *key;
180 key = (HMAC_Key *) d_key->dk_KEY_struct;
183 MD5Update(ctx, key->hk_ipad, HMAC_LEN);
190 if (signature == NULL || key == NULL || sig_len != MD5_LEN)
196 MD5Update(ctx, key->hk_opad, HMAC_LEN);
215 * Converts key from raw data to an HMAC Key
218 * hkey the HMAC key to be filled in
219 * key the key in raw format
220 * keylen the length of the key
226 dst_buffer_to_hmac_md5(DST_KEY *dkey, const u_char *key, const int keylen)
234 if (dkey == NULL || key == NULL || keylen < 0)
243 /* if key is longer than HMAC_LEN bytes reset it to key=MD5(key) */
246 MD5Update(&ctx, key, keylen);
249 key = tk;
252 /* start out by storing key in pads */
253 memcpy(hkey->hk_ipad, key, local_keylen);
254 memcpy(hkey->hk_opad, key, local_keylen);
256 /* XOR key with hk_ipad and opad values */
286 u_char key[HMAC_LEN];
305 memset(key, 0, HMAC_LEN);
307 key[i] = hkey->hk_ipad[i] ^ HMAC_IPAD;
309 if (key[i] != 0)
318 len = b64_ntop(key, key_len, bp, buff_len - (bp - buff));
333 * Converts contents of a key file into an HMAC key.
335 * hkey structure to put key into
336 * buff buffer containing the encoded key
339 * n >= 0 Foot print of the key converted
348 u_char key[HMAC_LEN+1]; /* b64_pton needs more than 64 bytes do decode
360 memset(key, 0, sizeof(key));
374 key_len = b64_pton((char *)tmp, key, HMAC_LEN+1); /*%< see above */
377 if (dst_buffer_to_hmac_md5(dkey, key, key_len) < 0) {
385 * function to extract hmac key from DST_KEY structure
387 * in_key: HMAC-MD5 key
434 dst_hmac_md5_free_key_structure(void *key)
436 HMAC_Key *hkey = key;
444 * Creates a HMAC key of size size with a maximum size of 63 bytes
445 * generating a HMAC key larger than 63 bytes makes no sense as that key
450 dst_hmac_md5_generate_key(DST_KEY *key, const int nothing)
452 (void)key;