Lines Matching refs:keylen

393 static int pkey_nonccatok2pkey(const u8 *key, u32 keylen,  in pkey_nonccatok2pkey()  argument
404 if (keylen != sizeof(struct protaeskeytoken)) in pkey_nonccatok2pkey()
423 if (keylen < sizeof(struct clearaeskeytoken)) in pkey_nonccatok2pkey()
426 if (keylen != sizeof(*t) + t->len) in pkey_nonccatok2pkey()
464 rc = ep11_check_aes_key(debug_info, 3, key, keylen, 1); in pkey_nonccatok2pkey()
472 rc = ep11_check_aes_key_with_hdr(debug_info, 3, key, keylen, 1); in pkey_nonccatok2pkey()
492 static int pkey_ccainttok2pkey(const u8 *key, u32 keylen, in pkey_ccainttok2pkey() argument
499 if (keylen != sizeof(struct secaeskeytoken)) in pkey_ccainttok2pkey()
503 if (keylen < hdr->len || keylen > MAXCCAVLSCTOKENSIZE) in pkey_ccainttok2pkey()
518 int pkey_keyblob2pkey(const u8 *key, u32 keylen, in pkey_keyblob2pkey() argument
524 if (keylen < sizeof(struct keytoken_header)) { in pkey_keyblob2pkey()
525 DEBUG_ERR("%s invalid keylen %d\n", __func__, keylen); in pkey_keyblob2pkey()
531 rc = pkey_nonccatok2pkey(key, keylen, protkey); in pkey_keyblob2pkey()
534 rc = pkey_ccainttok2pkey(key, keylen, protkey); in pkey_keyblob2pkey()
658 static int pkey_verifykey2(const u8 *key, size_t keylen, in pkey_verifykey2() argument
667 if (keylen < sizeof(struct keytoken_header)) in pkey_verifykey2()
741 rc = ep11_check_aes_key(debug_info, 3, key, keylen, 1); in pkey_verifykey2()
769 const u8 *key, size_t keylen, in pkey_keyblob2pkey2() argument
779 if (keylen < sizeof(struct keytoken_header)) in pkey_keyblob2pkey2()
784 if (keylen != sizeof(struct secaeskeytoken)) in pkey_keyblob2pkey2()
789 if (keylen < hdr->len || keylen > MAXCCAVLSCTOKENSIZE) in pkey_keyblob2pkey2()
800 if (keylen < sizeof(struct ep11keyblob)) in pkey_keyblob2pkey2()
802 if (ep11_check_aes_key(debug_info, 3, key, keylen, 1)) in pkey_keyblob2pkey2()
805 return pkey_nonccatok2pkey(key, keylen, pkey); in pkey_keyblob2pkey2()
842 static int pkey_apqns4key(const u8 *key, size_t keylen, u32 flags, in pkey_apqns4key() argument
849 if (keylen < sizeof(struct keytoken_header) || flags == 0) in pkey_apqns4key()
1016 const u8 *key, size_t keylen, u32 *protkeytype, in pkey_keyblob2pkey3() argument
1026 if (keylen < sizeof(struct keytoken_header)) in pkey_keyblob2pkey3()
1033 if (ep11_check_aes_key_with_hdr(debug_info, 3, key, keylen, 1)) in pkey_keyblob2pkey3()
1039 if (ep11_check_ecc_key_with_hdr(debug_info, 3, key, keylen, 1)) in pkey_keyblob2pkey3()
1045 if (ep11_check_aes_key(debug_info, 3, key, keylen, 1)) in pkey_keyblob2pkey3()
1050 if (keylen != sizeof(struct secaeskeytoken)) in pkey_keyblob2pkey3()
1056 if (keylen < hdr->len || keylen > MAXCCAVLSCTOKENSIZE) in pkey_keyblob2pkey3()
1067 if (keylen < sizeof(struct eccprivkeytoken)) in pkey_keyblob2pkey3()
1069 if (cca_check_sececckeytoken(debug_info, 3, key, keylen, 1)) in pkey_keyblob2pkey3()
1074 rc = pkey_nonccatok2pkey(key, keylen, &pkey); in pkey_keyblob2pkey3()
1124 static void *_copy_key_from_user(void __user *ukey, size_t keylen) in _copy_key_from_user() argument
1126 if (!ukey || keylen < MINKEYBLOBSIZE || keylen > KEYBLOBBUFSIZE) in _copy_key_from_user()
1129 return memdup_user(ukey, keylen); in _copy_key_from_user()
1284 kkey = _copy_key_from_user(ktp.key, ktp.keylen); in pkey_unlocked_ioctl()
1287 rc = pkey_keyblob2pkey(kkey, ktp.keylen, &ktp.protkey); in pkey_unlocked_ioctl()
1323 if (kgs.keylen < klen) { in pkey_unlocked_ioctl()
1332 kgs.keylen = klen; in pkey_unlocked_ioctl()
1365 if (kcs.keylen < klen) { in pkey_unlocked_ioctl()
1374 kcs.keylen = klen; in pkey_unlocked_ioctl()
1388 kkey = _copy_key_from_user(kvk.key, kvk.keylen); in pkey_unlocked_ioctl()
1391 rc = pkey_verifykey2(kkey, kvk.keylen, in pkey_unlocked_ioctl()
1413 kkey = _copy_key_from_user(ktp.key, ktp.keylen); in pkey_unlocked_ioctl()
1419 kkey, ktp.keylen, &ktp.protkey); in pkey_unlocked_ioctl()
1446 kkey = _copy_key_from_user(kak.key, kak.keylen); in pkey_unlocked_ioctl()
1451 rc = pkey_apqns4key(kkey, kak.keylen, kak.flags, in pkey_unlocked_ioctl()
1532 kkey = _copy_key_from_user(ktp.key, ktp.keylen); in pkey_unlocked_ioctl()
1544 ktp.keylen, &ktp.pkeytype, in pkey_unlocked_ioctl()