Skip to content

Conversation

@riwoh
Copy link
Contributor

@riwoh riwoh commented Feb 5, 2026

Issue #70: Disable SVP with build flag (it will still be enabled by default)

Copilot AI review requested due to automatic review settings February 5, 2026 15:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a build-time flag to disable SVP (Secure Video Path) support for environments that don't have SVP capabilities. The flag ENABLE_SVP defaults to ON, maintaining backward compatibility.

Changes:

  • Added ENABLE_SVP CMake option (defaults to ON) to control SVP support at build time
  • Guarded all SVP-related code with #ifdef ENABLE_SVP directives
  • Provided stub implementations that return SEC_RESULT_UNIMPLEMENTED_FEATURE when SVP is disabled
  • Updated test code to check for SVP capability support at runtime

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
CMakeLists.txt Adds ENABLE_SVP build option (default ON) and sets corresponding compiler flags
include/sec_security_svp.h Guards SVP-specific types, structs, and function declarations with ENABLE_SVP
src/sec_adapter_svp.c Guards SVP implementation and adds stub functions returning unimplemented errors when disabled
src/sec_adapter_processor.c Guards SVP buffer cleanup code and SVP-related command processing
src/sec_adapter_cipher.c Guards all opaque buffer cipher operations to return unimplemented errors when SVP is disabled
test/openssl/src/test_creds_soc.cpp Returns false for CAPABILITY_SVP when ENABLE_SVP is not defined
test/main/cpp/sec_api_utest_main.cpp Wraps SVP-dependent test in runtime capability check

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@riwoh riwoh requested review from JRHewitt-CC and mhabrat February 5, 2026 17:15
Copy link

@mhabrat mhabrat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Update and extend copyright years.
  • Is there any reason to include sec_security_svp.h in any file? I'd add the ifdef around its inclusion.

case SA_CRYPTO_RANDOM:
// Doesn't require a handle so called directly and not in the invoke thread.
case SA_GET_NAME:
case SA_SVP_BUFFER_ALLOC:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some missed SVP conditionals.

@@ -411,6 +411,10 @@ Sec_Result SecCipher_ProcessFragmented(Sec_CipherHandle* cipherHandle, SEC_BYTE*
*/
Sec_Result SecCipher_ProcessOpaque(Sec_CipherHandle* cipherHandle, Sec_OpaqueBufferHandle* inOpaqueBufferHandle,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why include this function at all since it is specific to SVP?

// Stub implementations when SVP is disabled

// Deprecated
Sec_Result Sec_OpaqueBufferMalloc(SEC_SIZE bufLength, void** handle, void* params) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why include these functions in the non-SVP code base? They are specific to SVP operation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants