Lines Matching refs:key

67  *     priv_key    key to use for signing.
84 HMAC_Key *key;
97 key = (HMAC_Key *) d_key->dk_KEY_struct;
101 MD5Update(ctx, key->hk_ipad, HMAC_LEN);
114 MD5Update(ctx, key->hk_opad, HMAC_LEN);
137 * dkey key to use for verify.
152 HMAC_Key *key;
165 key = (HMAC_Key *) d_key->dk_KEY_struct;
168 MD5Update(ctx, key->hk_ipad, HMAC_LEN);
175 if (signature == NULL || key == NULL || sig_len != MD5_LEN)
181 MD5Update(ctx, key->hk_opad, HMAC_LEN);
200 * Converts key from raw data to an HMAC Key
203 * hkey the HMAC key to be filled in
204 * key the key in raw format
205 * keylen the length of the key
211 dst_buffer_to_hmac_md5(DST_KEY *dkey, const u_char *key, const unsigned keylen)
218 if (dkey == NULL || key == NULL || keylen < 0)
227 /* if key is longer than HMAC_LEN bytes reset it to key=MD5(key) */
231 MD5Update(&ctx, (const unsigned char *)key, keylen);
234 key = tk;
237 /* start out by storing key in pads */
238 memcpy(hkey->hk_ipad, key, local_keylen);
239 memcpy(hkey->hk_opad, key, local_keylen);
241 /* XOR key with hk_ipad and opad values */
272 u_char key[HMAC_LEN];
288 memset(key, 0, HMAC_LEN);
290 key[i] = hkey->hk_ipad[i] ^ HMAC_IPAD;
292 if (key[i] != 0)
300 len = b64_ntop(key, key_len, bp, b_len);
314 * Converts contents of a key file into an HMAC key.
316 * hkey structure to put key into
317 * buff buffer containing the encoded key
320 * n >= 0 Foot print of the key converted
329 u_char key[HMAC_LEN+1]; /* b64_pton needs more than 64 bytes do decode
341 memset(key, 0, sizeof(key));
353 key_len = b64_pton((char *)tmp, key, HMAC_LEN+1); /* see above */
356 if (dst_buffer_to_hmac_md5(dkey, key, key_len) < 0) {
364 * function to extract hmac key from DST_KEY structure
366 * in_key: HMAC-MD5 key
413 dst_hmac_md5_free_key_structure(void *key)
415 HMAC_Key *hkey = key;
423 * Creates a HMAC key of size size with a maximum size of 63 bytes
424 * generating a HMAC key larger than 63 bytes makes no sense as that key
429 dst_hmac_md5_generate_key(DST_KEY *key, const int nothing)
435 if (key == NULL || key->dk_alg != KEY_HMAC_MD5)
437 size = (key->dk_key_size + 7) / 8; /* convert to bytes */
450 n = dst_buffer_to_hmac_md5(key, buff, len);