@@ -661,11 +661,6 @@ static long zcrypt_rsa_modexpo(struct ap_perms *perms,
661661
662662 ap_init_message (& ap_msg );
663663
664- #ifdef CONFIG_ZCRYPT_DEBUG
665- if (tr && tr -> fi .cmd )
666- ap_msg .fi .cmd = tr -> fi .cmd ;
667- #endif
668-
669664 if (mex -> outputdatalength < mex -> inputdatalength ) {
670665 func_code = 0 ;
671666 rc = - EINVAL ;
@@ -771,11 +766,6 @@ static long zcrypt_rsa_crt(struct ap_perms *perms,
771766
772767 ap_init_message (& ap_msg );
773768
774- #ifdef CONFIG_ZCRYPT_DEBUG
775- if (tr && tr -> fi .cmd )
776- ap_msg .fi .cmd = tr -> fi .cmd ;
777- #endif
778-
779769 if (crt -> outputdatalength < crt -> inputdatalength ) {
780770 func_code = 0 ;
781771 rc = - EINVAL ;
@@ -883,16 +873,6 @@ static long _zcrypt_send_cprb(bool userspace, struct ap_perms *perms,
883873 xcrb -> status = 0 ;
884874 ap_init_message (& ap_msg );
885875
886- #ifdef CONFIG_ZCRYPT_DEBUG
887- if (tr && tr -> fi .cmd )
888- ap_msg .fi .cmd = tr -> fi .cmd ;
889- if (tr && tr -> fi .action == AP_FI_ACTION_CCA_AGENT_FF ) {
890- ZCRYPT_DBF_WARN ("%s fi cmd 0x%04x: forcing invalid agent_ID 'FF'\n" ,
891- __func__ , tr -> fi .cmd );
892- xcrb -> agent_ID = 0x4646 ;
893- }
894- #endif
895-
896876 rc = prep_cca_ap_msg (userspace , xcrb , & ap_msg , & func_code , & domain );
897877 if (rc )
898878 goto out ;
@@ -982,14 +962,6 @@ static long _zcrypt_send_cprb(bool userspace, struct ap_perms *perms,
982962 if (* domain == AUTOSEL_DOM )
983963 * domain = AP_QID_QUEUE (qid );
984964
985- #ifdef CONFIG_ZCRYPT_DEBUG
986- if (tr && tr -> fi .action == AP_FI_ACTION_CCA_DOM_INVAL ) {
987- ZCRYPT_DBF_WARN ("%s fi cmd 0x%04x: forcing invalid domain\n" ,
988- __func__ , tr -> fi .cmd );
989- * domain = 99 ;
990- }
991- #endif
992-
993965 rc = pref_zq -> ops -> send_cprb (userspace , pref_zq , xcrb , & ap_msg );
994966
995967 spin_lock (& zcrypt_list_lock );
@@ -1058,11 +1030,6 @@ static long _zcrypt_send_ep11_cprb(bool userspace, struct ap_perms *perms,
10581030
10591031 ap_init_message (& ap_msg );
10601032
1061- #ifdef CONFIG_ZCRYPT_DEBUG
1062- if (tr && tr -> fi .cmd )
1063- ap_msg .fi .cmd = tr -> fi .cmd ;
1064- #endif
1065-
10661033 target_num = (unsigned short )xcrb -> targets_num ;
10671034
10681035 /* empty list indicates autoselect (all available targets) */
@@ -1473,23 +1440,10 @@ static int icarsamodexpo_ioctl(struct ap_perms *perms, unsigned long arg)
14731440 if (copy_from_user (& mex , umex , sizeof (mex )))
14741441 return - EFAULT ;
14751442
1476- #ifdef CONFIG_ZCRYPT_DEBUG
1477- if (mex .inputdatalength & (1U << 31 )) {
1478- if (!capable (CAP_SYS_ADMIN ))
1479- return - EPERM ;
1480- tr .fi .cmd = (u16 )(mex .inputdatalength >> 16 );
1481- }
1482- mex .inputdatalength &= 0x0000FFFF ;
1483- #endif
1484-
14851443 do {
14861444 rc = zcrypt_rsa_modexpo (perms , & tr , & mex );
14871445 if (rc == - EAGAIN )
14881446 tr .again_counter ++ ;
1489- #ifdef CONFIG_ZCRYPT_DEBUG
1490- if (rc == - EAGAIN && (tr .fi .flags & AP_FI_FLAG_NO_RETRY ))
1491- break ;
1492- #endif
14931447 } while (rc == - EAGAIN && tr .again_counter < TRACK_AGAIN_MAX );
14941448 /* on failure: retry once again after a requested rescan */
14951449 if ((rc == - ENODEV ) && (zcrypt_process_rescan ()))
@@ -1518,23 +1472,10 @@ static int icarsacrt_ioctl(struct ap_perms *perms, unsigned long arg)
15181472 if (copy_from_user (& crt , ucrt , sizeof (crt )))
15191473 return - EFAULT ;
15201474
1521- #ifdef CONFIG_ZCRYPT_DEBUG
1522- if (crt .inputdatalength & (1U << 31 )) {
1523- if (!capable (CAP_SYS_ADMIN ))
1524- return - EPERM ;
1525- tr .fi .cmd = (u16 )(crt .inputdatalength >> 16 );
1526- }
1527- crt .inputdatalength &= 0x0000FFFF ;
1528- #endif
1529-
15301475 do {
15311476 rc = zcrypt_rsa_crt (perms , & tr , & crt );
15321477 if (rc == - EAGAIN )
15331478 tr .again_counter ++ ;
1534- #ifdef CONFIG_ZCRYPT_DEBUG
1535- if (rc == - EAGAIN && (tr .fi .flags & AP_FI_FLAG_NO_RETRY ))
1536- break ;
1537- #endif
15381479 } while (rc == - EAGAIN && tr .again_counter < TRACK_AGAIN_MAX );
15391480 /* on failure: retry once again after a requested rescan */
15401481 if ((rc == - ENODEV ) && (zcrypt_process_rescan ()))
@@ -1563,23 +1504,10 @@ static int zsecsendcprb_ioctl(struct ap_perms *perms, unsigned long arg)
15631504 if (copy_from_user (& xcrb , uxcrb , sizeof (xcrb )))
15641505 return - EFAULT ;
15651506
1566- #ifdef CONFIG_ZCRYPT_DEBUG
1567- if ((xcrb .status & 0x8000FFFF ) == 0x80004649 /* 'FI' */ ) {
1568- if (!capable (CAP_SYS_ADMIN ))
1569- return - EPERM ;
1570- tr .fi .cmd = (u16 )(xcrb .status >> 16 );
1571- }
1572- xcrb .status = 0 ;
1573- #endif
1574-
15751507 do {
15761508 rc = _zcrypt_send_cprb (true, perms , & tr , & xcrb );
15771509 if (rc == - EAGAIN )
15781510 tr .again_counter ++ ;
1579- #ifdef CONFIG_ZCRYPT_DEBUG
1580- if (rc == - EAGAIN && (tr .fi .flags & AP_FI_FLAG_NO_RETRY ))
1581- break ;
1582- #endif
15831511 } while (rc == - EAGAIN && tr .again_counter < TRACK_AGAIN_MAX );
15841512 /* on failure: retry once again after a requested rescan */
15851513 if ((rc == - ENODEV ) && (zcrypt_process_rescan ()))
@@ -1609,23 +1537,10 @@ static int zsendep11cprb_ioctl(struct ap_perms *perms, unsigned long arg)
16091537 if (copy_from_user (& xcrb , uxcrb , sizeof (xcrb )))
16101538 return - EFAULT ;
16111539
1612- #ifdef CONFIG_ZCRYPT_DEBUG
1613- if (xcrb .req_len & (1ULL << 63 )) {
1614- if (!capable (CAP_SYS_ADMIN ))
1615- return - EPERM ;
1616- tr .fi .cmd = (u16 )(xcrb .req_len >> 48 );
1617- }
1618- xcrb .req_len &= 0x0000FFFFFFFFFFFFULL ;
1619- #endif
1620-
16211540 do {
16221541 rc = _zcrypt_send_ep11_cprb (true, perms , & tr , & xcrb );
16231542 if (rc == - EAGAIN )
16241543 tr .again_counter ++ ;
1625- #ifdef CONFIG_ZCRYPT_DEBUG
1626- if (rc == - EAGAIN && (tr .fi .flags & AP_FI_FLAG_NO_RETRY ))
1627- break ;
1628- #endif
16291544 } while (rc == - EAGAIN && tr .again_counter < TRACK_AGAIN_MAX );
16301545 /* on failure: retry once again after a requested rescan */
16311546 if ((rc == - ENODEV ) && (zcrypt_process_rescan ()))
0 commit comments