From 25f7c87b168bb21dc8b3c1e1f618825f9291acb4 Mon Sep 17 00:00:00 2001 From: Richard Woh Date: Mon, 26 Jan 2026 16:09:29 -0800 Subject: [PATCH 1/2] Fix invalid buffer type validation in sa_process_common_encryption Add early validation for in and out buffer_type fields to return SA_STATUS_INVALID_PARAMETER when buffer type is neither SA_BUFFER_TYPE_CLEAR nor SA_BUFFER_TYPE_SVP. This fixes the SaProcessCommonEncryptionNegativeTest.invalidInBufferType test which was incorrectly returning SA_STATUS_NULL_PARAMETER. --- .../clientimpl/src/sa_process_common_encryption.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/reference/src/clientimpl/src/sa_process_common_encryption.c b/reference/src/clientimpl/src/sa_process_common_encryption.c index 8d2d165e..a1e06aaa 100644 --- a/reference/src/clientimpl/src/sa_process_common_encryption.c +++ b/reference/src/clientimpl/src/sa_process_common_encryption.c @@ -81,6 +81,20 @@ sa_status sa_process_common_encryption( break; } + if (samples[i].out->buffer_type != SA_BUFFER_TYPE_CLEAR && + samples[i].out->buffer_type != SA_BUFFER_TYPE_SVP) { + ERROR("Invalid out buffer_type"); + status = SA_STATUS_INVALID_PARAMETER; + break; + } + + if (samples[i].in->buffer_type != SA_BUFFER_TYPE_CLEAR && + samples[i].in->buffer_type != SA_BUFFER_TYPE_SVP) { + ERROR("Invalid in buffer_type"); + status = SA_STATUS_INVALID_PARAMETER; + break; + } + process_common_encryption->api_version = API_VERSION; memcpy(process_common_encryption->iv, samples[i].iv, samples[i].iv_length); process_common_encryption->crypt_byte_block = samples[i].crypt_byte_block; From f7c52275a18c34e93e0f31d6b1630f039bcd2e63 Mon Sep 17 00:00:00 2001 From: Richard Woh Date: Mon, 26 Jan 2026 16:13:19 -0800 Subject: [PATCH 2/2] Update copyright year to 2020-2026 --- reference/src/clientimpl/src/sa_process_common_encryption.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/src/clientimpl/src/sa_process_common_encryption.c b/reference/src/clientimpl/src/sa_process_common_encryption.c index a1e06aaa..811c884c 100644 --- a/reference/src/clientimpl/src/sa_process_common_encryption.c +++ b/reference/src/clientimpl/src/sa_process_common_encryption.c @@ -1,5 +1,5 @@ /* - * Copyright 2020-2025 Comcast Cable Communications Management, LLC + * Copyright 2020-2026 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.