Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

IIS Ext: Add support for more certificate stores #597

Merged
merged 1 commit into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/ext/Iis/ca/scacert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,21 @@ static HRESULT ConfigureCertificates(
case SCA_CERTSYSTEMSTORE_LOCALMACHINE:
dwStoreLocation = CERT_SYSTEM_STORE_LOCAL_MACHINE;
break;
case SCA_CERTSYSTEMSTORE_SERVICES:
dwStoreLocation = CERT_SYSTEM_STORE_SERVICES;
break;
case SCA_CERTSYSTEMSTORE_USERS:
dwStoreLocation = CERT_SYSTEM_STORE_USERS;
break;
case SCA_CERTSYSTEMSTORE_USER_POLICY:
dwStoreLocation = CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY;
break;
case SCA_CERTSYSTEMSTORE_LOCALMACHINE_POLICY:
dwStoreLocation = CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY;
break;
case SCA_CERTSYSTEMSTORE_LOCALMACHINE_ENTERPRISE:
dwStoreLocation = CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE;
break;
default:
hr = E_INVALIDARG;
ExitOnFailure(hr, "Invalid store location value: %d", iData);
Expand Down
5 changes: 5 additions & 0 deletions src/ext/Iis/ca/scacert.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ enum SCA_CERTSYSTEMSTORE
{
SCA_CERTSYSTEMSTORE_CURRENTUSER = 1,
SCA_CERTSYSTEMSTORE_LOCALMACHINE = 2,
SCA_CERTSYSTEMSTORE_SERVICES = 3,
SCA_CERTSYSTEMSTORE_USERS = 4,
SCA_CERTSYSTEMSTORE_USER_POLICY = 5,
SCA_CERTSYSTEMSTORE_LOCALMACHINE_POLICY = 6,
SCA_CERTSYSTEMSTORE_LOCALMACHINE_ENTERPRISE = 7,
};
15 changes: 15 additions & 0 deletions src/ext/Iis/wixext/IIsCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,21 @@ private void ParseCertificateElement(Intermediate intermediate, IntermediateSect
case "localMachine":
storeLocation = 2; // SCA_CERTSYSTEMSTORE_LOCALMACHINE
break;
case "services":
storeLocation = 3; // SCA_CERTSYSTEMSTORE_SERVICES
break;
case "users":
storeLocation = 4; // SCA_CERTSYSTEMSTORE_USERS
break;
case "userPolicy":
storeLocation = 5; // SCA_CERTSYSTEMSTORE_USER_POLICY
break;
case "localMachinePolicy":
storeLocation = 6; // SCA_CERTSYSTEMSTORE_LOCALMACHINE_POLICY
break;
case "localMachineEnterprise":
storeLocation = 7; // SCA_CERTSYSTEMSTORE_LOCALMACHINE_ENTERPRISE
break;
default:
storeLocation = -1;
this.Messaging.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, element.Name.LocalName, "StoreLocation", storeLocationValue, "currentUser", "localMachine"));
Expand Down
2 changes: 1 addition & 1 deletion src/ext/Iis/wixext/IisTableDefinitions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static class IisTableDefinitions
new ColumnDefinition("Certificate", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyColumn: 1, description: "Identifier for the certificate in the package.", modularizeType: ColumnModularizeType.Column),
new ColumnDefinition("Component_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, description: "Foreign key into the Component table used to determine install state", modularizeType: ColumnModularizeType.Column),
new ColumnDefinition("Name", ColumnType.String, 255, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Name to be used for the Certificate."),
new ColumnDefinition("StoreLocation", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 1, maxValue: 2, description: "Location of the target certificate store (CurrentUser == 1, LocalMachine == 2)"),
new ColumnDefinition("StoreLocation", ColumnType.Number, 2, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 1, maxValue: 7, description: "Location of the target certificate store (CurrentUser == 1, LocalMachine == 2, Services == 3, Users == 4, User Group Policy == 5, LocalMachine Group Policy == 6, LocalMachine Enterprise == 7)"),
new ColumnDefinition("StoreName", ColumnType.String, 64, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Name of the target certificate store"),
new ColumnDefinition("Attributes", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 2147483647, description: "Attributes of the certificate"),
new ColumnDefinition("Binary_", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "Binary", keyColumn: 1, description: "Identifier to Binary table containing certificate.", modularizeType: ColumnModularizeType.Column),
Expand Down
Loading