Lines Matching full:rc
29 int rc; in key2protkey() local
32 rc = pkey_handler_key_to_protkey(apqns, nr_apqns, in key2protkey()
38 if (rc == -ENODEV) { in key2protkey()
39 rc = pkey_handler_slowpath_key_to_protkey(apqns, nr_apqns, in key2protkey()
43 if (rc) in key2protkey()
44 rc = -ENODEV; in key2protkey()
47 pr_debug("rc=%d\n", rc); in key2protkey()
48 return rc; in key2protkey()
57 int rc; in pkey_key2protkey() local
59 rc = key2protkey(NULL, 0, key, keylen, in pkey_key2protkey()
61 if (rc == -ENODEV) { in pkey_key2protkey()
63 rc = key2protkey(NULL, 0, key, keylen, in pkey_key2protkey()
67 return rc; in pkey_key2protkey()
96 int rc; in pkey_ioctl_genseck() local
104 rc = pkey_handler_gen_key(&apqn, 1, in pkey_ioctl_genseck()
107 pr_debug("gen_key()=%d\n", rc); in pkey_ioctl_genseck()
108 if (!rc && copy_to_user(ugs, &kgs, sizeof(kgs))) in pkey_ioctl_genseck()
109 rc = -EFAULT; in pkey_ioctl_genseck()
112 return rc; in pkey_ioctl_genseck()
120 int rc; in pkey_ioctl_clr2seck() local
128 rc = pkey_handler_clr_to_key(&apqn, 1, in pkey_ioctl_clr2seck()
133 pr_debug("clr_to_key()=%d\n", rc); in pkey_ioctl_clr2seck()
134 if (!rc && copy_to_user(ucs, &kcs, sizeof(kcs))) in pkey_ioctl_clr2seck()
135 rc = -EFAULT; in pkey_ioctl_clr2seck()
138 return rc; in pkey_ioctl_clr2seck()
145 int rc; in pkey_ioctl_sec2protk() local
153 rc = pkey_handler_key_to_protkey(&apqn, 1, in pkey_ioctl_sec2protk()
158 pr_debug("key_to_protkey()=%d\n", rc); in pkey_ioctl_sec2protk()
159 if (!rc && copy_to_user(usp, &ksp, sizeof(ksp))) in pkey_ioctl_sec2protk()
160 rc = -EFAULT; in pkey_ioctl_sec2protk()
163 return rc; in pkey_ioctl_sec2protk()
172 int rc; in pkey_ioctl_clr2protk() local
198 rc = key2protkey(NULL, 0, in pkey_ioctl_clr2protk()
202 pr_debug("key2protkey()=%d\n", rc); in pkey_ioctl_clr2protk()
206 if (!rc && copy_to_user(ucp, &kcp, sizeof(kcp))) in pkey_ioctl_clr2protk()
207 rc = -EFAULT; in pkey_ioctl_clr2protk()
210 return rc; in pkey_ioctl_clr2protk()
218 int rc; in pkey_ioctl_findcard() local
228 rc = pkey_handler_apqns_for_key(kfc.seckey.seckey, in pkey_ioctl_findcard()
232 if (rc == -ENODEV) in pkey_ioctl_findcard()
233 rc = pkey_handler_apqns_for_key(kfc.seckey.seckey, in pkey_ioctl_findcard()
237 pr_debug("apqns_for_key()=%d\n", rc); in pkey_ioctl_findcard()
238 if (rc) { in pkey_ioctl_findcard()
240 return rc; in pkey_ioctl_findcard()
254 int rc; in pkey_ioctl_skey2pkey() local
260 rc = pkey_handler_key_to_protkey(NULL, 0, in pkey_ioctl_skey2pkey()
266 pr_debug("key_to_protkey()=%d\n", rc); in pkey_ioctl_skey2pkey()
267 if (!rc && copy_to_user(usp, &ksp, sizeof(ksp))) in pkey_ioctl_skey2pkey()
268 rc = -EFAULT; in pkey_ioctl_skey2pkey()
271 return rc; in pkey_ioctl_skey2pkey()
278 int rc; in pkey_ioctl_verifykey() local
285 rc = pkey_handler_verify_key(kvk.seckey.seckey, in pkey_ioctl_verifykey()
289 pr_debug("verify_key()=%d\n", rc); in pkey_ioctl_verifykey()
290 if (!rc && keytype != PKEY_TYPE_CCA_DATA) in pkey_ioctl_verifykey()
291 rc = -EINVAL; in pkey_ioctl_verifykey()
296 if (!rc && copy_to_user(uvk, &kvk, sizeof(kvk))) in pkey_ioctl_verifykey()
297 rc = -EFAULT; in pkey_ioctl_verifykey()
300 return rc; in pkey_ioctl_verifykey()
306 int rc; in pkey_ioctl_genprotk() local
312 rc = pkey_handler_gen_key(NULL, 0, kgp.keytype, in pkey_ioctl_genprotk()
316 pr_debug("gen_key()=%d\n", rc); in pkey_ioctl_genprotk()
317 if (!rc && copy_to_user(ugp, &kgp, sizeof(kgp))) in pkey_ioctl_genprotk()
318 rc = -EFAULT; in pkey_ioctl_genprotk()
321 return rc; in pkey_ioctl_genprotk()
330 int rc; in pkey_ioctl_verifyprotk() local
356 rc = pkey_handler_verify_key(tmpbuf, sizeof(*t), in pkey_ioctl_verifyprotk()
358 pr_debug("verify_key()=%d\n", rc); in pkey_ioctl_verifyprotk()
363 return rc; in pkey_ioctl_verifyprotk()
370 int rc; in pkey_ioctl_kblob2protk() local
378 rc = key2protkey(NULL, 0, kkey, ktp.keylen, in pkey_ioctl_kblob2protk()
381 pr_debug("key2protkey()=%d\n", rc); in pkey_ioctl_kblob2protk()
383 if (!rc && copy_to_user(utp, &ktp, sizeof(ktp))) in pkey_ioctl_kblob2protk()
384 rc = -EFAULT; in pkey_ioctl_kblob2protk()
387 return rc; in pkey_ioctl_kblob2protk()
396 int rc; in pkey_ioctl_genseck2() local
415 rc = pkey_handler_gen_key(apqns, kgs.apqn_entries, in pkey_ioctl_genseck2()
418 pr_debug("gen_key()=%d\n", rc); in pkey_ioctl_genseck2()
420 if (rc) { in pkey_ioctl_genseck2()
422 return rc; in pkey_ioctl_genseck2()
436 rc = -EFAULT; in pkey_ioctl_genseck2()
439 return rc; in pkey_ioctl_genseck2()
448 int rc; in pkey_ioctl_clr2seck2() local
471 rc = pkey_handler_clr_to_key(apqns, kcs.apqn_entries, in pkey_ioctl_clr2seck2()
475 pr_debug("clr_to_key()=%d\n", rc); in pkey_ioctl_clr2seck2()
477 if (rc) { in pkey_ioctl_clr2seck2()
480 return rc; in pkey_ioctl_clr2seck2()
496 rc = -EFAULT; in pkey_ioctl_clr2seck2()
500 return rc; in pkey_ioctl_clr2seck2()
507 int rc; in pkey_ioctl_verifykey2() local
515 rc = pkey_handler_verify_key(kkey, kvk.keylen, in pkey_ioctl_verifykey2()
518 pr_debug("verify_key()=%d\n", rc); in pkey_ioctl_verifykey2()
521 if (!rc && copy_to_user(uvk, &kvk, sizeof(kvk))) in pkey_ioctl_verifykey2()
524 return rc; in pkey_ioctl_verifykey2()
532 int rc; in pkey_ioctl_kblob2protk2() local
545 rc = key2protkey(apqns, ktp.apqn_entries, kkey, ktp.keylen, in pkey_ioctl_kblob2protk2()
548 pr_debug("key2protkey()=%d\n", rc); in pkey_ioctl_kblob2protk2()
551 if (!rc && copy_to_user(utp, &ktp, sizeof(ktp))) in pkey_ioctl_kblob2protk2()
552 rc = -EFAULT; in pkey_ioctl_kblob2protk2()
555 return rc; in pkey_ioctl_kblob2protk2()
564 int rc; in pkey_ioctl_apqns4k() local
581 rc = pkey_handler_apqns_for_key(kkey, kak.keylen, kak.flags, in pkey_ioctl_apqns4k()
583 pr_debug("apqns_for_key()=%d\n", rc); in pkey_ioctl_apqns4k()
585 if (rc && rc != -ENOSPC) { in pkey_ioctl_apqns4k()
587 return rc; in pkey_ioctl_apqns4k()
589 if (!rc && kak.apqns) { in pkey_ioctl_apqns4k()
604 rc = -EFAULT; in pkey_ioctl_apqns4k()
607 return rc; in pkey_ioctl_apqns4k()
615 int rc; in pkey_ioctl_apqns4kt() local
627 rc = pkey_handler_apqns_for_keytype(kat.type, in pkey_ioctl_apqns4kt()
630 pr_debug("apqns_for_keytype()=%d\n", rc); in pkey_ioctl_apqns4kt()
631 if (rc && rc != -ENOSPC) { in pkey_ioctl_apqns4kt()
633 return rc; in pkey_ioctl_apqns4kt()
635 if (!rc && kat.apqns) { in pkey_ioctl_apqns4kt()
650 rc = -EFAULT; in pkey_ioctl_apqns4kt()
653 return rc; in pkey_ioctl_apqns4kt()
662 int rc; in pkey_ioctl_kblob2protk3() local
680 rc = key2protkey(apqns, ktp.apqn_entries, kkey, ktp.keylen, in pkey_ioctl_kblob2protk3()
682 pr_debug("key2protkey()=%d\n", rc); in pkey_ioctl_kblob2protk3()
685 if (rc) { in pkey_ioctl_kblob2protk3()
687 return rc; in pkey_ioctl_kblob2protk3()
710 int rc; in pkey_unlocked_ioctl() local
714 rc = pkey_ioctl_genseck((struct pkey_genseck __user *)arg); in pkey_unlocked_ioctl()
717 rc = pkey_ioctl_clr2seck((struct pkey_clr2seck __user *)arg); in pkey_unlocked_ioctl()
720 rc = pkey_ioctl_sec2protk((struct pkey_sec2protk __user *)arg); in pkey_unlocked_ioctl()
723 rc = pkey_ioctl_clr2protk((struct pkey_clr2protk __user *)arg); in pkey_unlocked_ioctl()
726 rc = pkey_ioctl_findcard((struct pkey_findcard __user *)arg); in pkey_unlocked_ioctl()
729 rc = pkey_ioctl_skey2pkey((struct pkey_skey2pkey __user *)arg); in pkey_unlocked_ioctl()
732 rc = pkey_ioctl_verifykey((struct pkey_verifykey __user *)arg); in pkey_unlocked_ioctl()
735 rc = pkey_ioctl_genprotk((struct pkey_genprotk __user *)arg); in pkey_unlocked_ioctl()
738 rc = pkey_ioctl_verifyprotk((struct pkey_verifyprotk __user *)arg); in pkey_unlocked_ioctl()
741 rc = pkey_ioctl_kblob2protk((struct pkey_kblob2pkey __user *)arg); in pkey_unlocked_ioctl()
744 rc = pkey_ioctl_genseck2((struct pkey_genseck2 __user *)arg); in pkey_unlocked_ioctl()
747 rc = pkey_ioctl_clr2seck2((struct pkey_clr2seck2 __user *)arg); in pkey_unlocked_ioctl()
750 rc = pkey_ioctl_verifykey2((struct pkey_verifykey2 __user *)arg); in pkey_unlocked_ioctl()
753 rc = pkey_ioctl_kblob2protk2((struct pkey_kblob2pkey2 __user *)arg); in pkey_unlocked_ioctl()
756 rc = pkey_ioctl_apqns4k((struct pkey_apqns4key __user *)arg); in pkey_unlocked_ioctl()
759 rc = pkey_ioctl_apqns4kt((struct pkey_apqns4keytype __user *)arg); in pkey_unlocked_ioctl()
762 rc = pkey_ioctl_kblob2protk3((struct pkey_kblob2pkey3 __user *)arg); in pkey_unlocked_ioctl()
769 return rc; in pkey_unlocked_ioctl()