[v2,1/1] drm/i915/hdcp: Mandate zero seq_num_V at first RecvId msg
diff mbox series

Message ID 20200212084143.13852-2-anshuman.gupta@intel.com
State New
Headers show
Series
  • HDCP 2.2 Comp fixes
Related show

Commit Message

Anshuman Gupta Feb. 12, 2020, 8:41 a.m. UTC
HDCP Repeater initializes seq_num_V to 0 at the beginning of
hdcp Session i.e. after AKE_init received, refer
HDCP 2.2 Spec HDMI PAGE 19, DP PAGE 20.

HDCP 2.2 Comp specs 1B-06 test verifies that whether DUT
considers failure of authentication if the repeater provides a
non-zero value in seq_num_V in the first,
RepeaterAuth_Send_ReceiverID_List message.

Make sure that HDCP repeater initializes seq_num_V to zero at
beginning of session i.e. after AKE_Init, fail the Auth if
there is non zero seq_num_V.

v2:
- Used existing hdcp2_encrypted flag instead of
  declaring new flag. [Ram]

Cc: Ramalingam C <ramalingam.c@intel.com>
Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 drivers/gpu/drm/i915/display/intel_hdcp.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Ramalingam C Feb. 13, 2020, 8:23 a.m. UTC | #1
On 2020-02-12 at 14:11:43 +0530, Anshuman Gupta wrote:
> HDCP Repeater initializes seq_num_V to 0 at the beginning of
> hdcp Session i.e. after AKE_init received, refer
> HDCP 2.2 Spec HDMI PAGE 19, DP PAGE 20.
> 
> HDCP 2.2 Comp specs 1B-06 test verifies that whether DUT
> considers failure of authentication if the repeater provides a
> non-zero value in seq_num_V in the first,
> RepeaterAuth_Send_ReceiverID_List message.
> 
> Make sure that HDCP repeater initializes seq_num_V to zero at
> beginning of session i.e. after AKE_Init, fail the Auth if
> there is non zero seq_num_V.
> 
> v2:
> - Used existing hdcp2_encrypted flag instead of
>   declaring new flag. [Ram]
> 
> Cc: Ramalingam C <ramalingam.c@intel.com>
> Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_hdcp.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
> index 30e0a3aa9d57..75f60ca282fc 100644
> --- a/drivers/gpu/drm/i915/display/intel_hdcp.c
> +++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
> @@ -1462,6 +1462,12 @@ int hdcp2_authenticate_repeater_topology(struct intel_connector *connector)
>  	seq_num_v =
>  		drm_hdcp_be24_to_cpu((const u8 *)msgs.recvid_list.seq_num_v);
>  
> +	if (!hdcp->hdcp2_encrypted && seq_num_v) {
> +		drm_dbg_kms(&dev_priv->drm,
> +			    "Non zero Seq_num_v at first RecvId_List msg\n");
> +		return -EINVAL;
> +	}
> +
As we dont have retry for topology authentication alone and it always
start with AKE_Init, we can rely on hdcp2_encrypted status for first
RepeaterAuth_Send_ReceiverID_List detection.

LGTM.

Reviewed-by: Ramalingam C <ramalingam.c@intel.com>

>  	if (seq_num_v < hdcp->seq_num_v) {
>  		/* Roll over of the seq_num_v from repeater. Reauthenticate. */
>  		DRM_DEBUG_KMS("Seq_num_v roll over.\n");
> -- 
> 2.24.0
>

Patch
diff mbox series

diff --git a/drivers/gpu/drm/i915/display/intel_hdcp.c b/drivers/gpu/drm/i915/display/intel_hdcp.c
index 30e0a3aa9d57..75f60ca282fc 100644
--- a/drivers/gpu/drm/i915/display/intel_hdcp.c
+++ b/drivers/gpu/drm/i915/display/intel_hdcp.c
@@ -1462,6 +1462,12 @@  int hdcp2_authenticate_repeater_topology(struct intel_connector *connector)
 	seq_num_v =
 		drm_hdcp_be24_to_cpu((const u8 *)msgs.recvid_list.seq_num_v);
 
+	if (!hdcp->hdcp2_encrypted && seq_num_v) {
+		drm_dbg_kms(&dev_priv->drm,
+			    "Non zero Seq_num_v at first RecvId_List msg\n");
+		return -EINVAL;
+	}
+
 	if (seq_num_v < hdcp->seq_num_v) {
 		/* Roll over of the seq_num_v from repeater. Reauthenticate. */
 		DRM_DEBUG_KMS("Seq_num_v roll over.\n");