Skip to content

Conversation

@dkbennett
Copy link
Member

@dkbennett dkbennett commented Oct 9, 2025

This formalizes a workaround I have been using for testing an unsigned Pre-Indexed Package Source. It would be convenient to have this in the code so I don't have to constantly stash/unstash the changes when moving around branches.

This works only when test hooks are enabled (i.e. a debug build) AND you set the preprocessor directive "AICLI_ALLOW_UNSIGNED_SOURCE"

The easy way to set this up is to add CL=/DAICLI_ALLOW_UNSIGNED_SOURCE to your Environment variables and restart visual studio.

I've noticed Visual Studio will not recognize the directive is set, but the compiler will set it when it builds and it will work. I did not make these const due to a web of compiler warnings and errors when a const value is specified first in an if statement.


Microsoft Reviewers: Open in CodeFlow

@dkbennett dkbennett requested a review from JohnMcPMS October 9, 2025 22:11
@github-actions

This comment has been minimized.

{
// To use an unsigned source, set AICLI_ALLOW_UNSIGNED_SOURCE and use a debug build.
// Ex: set CL=/DAICLI_ALLOW_UNSIGNED_SOURCE
#if ! defined( AICLI_DISABLE_TEST_HOOKS ) && defined( AICLI_ALLOW_UNSIGNED_SOURCE )
Copy link
Member

Choose a reason for hiding this comment

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

I think I would rather see this hardened more to prevent what feels like potential for accidental disabling of the security.

I would do that by creating a function on the base class for use in calling ValidateTrustInfo. Then create a derived type from the Desktop version that overrides that virtual with the one that doesn't check (and can do that easily from preprocessor instead of a global bool).

I would also create a separate semantic for using the Desktop version all the time, mostly because we might consider allowing that as choice.

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