PKISolutions / ADCS-SID-Extension-Policy-Module

MIT License
16 stars 3 forks source link

Error 0x80131040 in custom build #3

Closed playduin closed 1 year ago

playduin commented 1 year ago

Error 0x80131040 in custom build. Please explain the reason. policy_module

Crypt32 commented 1 year ago

The error stands for The located assembly's manifest definition does not match the assembly reference. This can be because of incorrect COM object registration or missing strong name signing. Did you build sources or used compiled binaries from release section?

playduin commented 1 year ago

Compiled binaries from release section works fine, but I want to create custom Policy Module.

Crypt32 commented 1 year ago

Then you need to use strong name signing and update COM registration to match your assembly.

playduin commented 1 year ago

What is COM registration?

playduin commented 1 year ago

I use PowerShell script from compiled binaries from release, auto-generated strong name signing and my certificate signing.

Crypt32 commented 1 year ago

AD CS and its components is a COM server. Policy Module is a COM object that runs on a server and implements ICertPolicy COM interface. You have to register COM object to make it visible to other applications (in given case, visible to AD CS). Supplied installation script registers COM objects I'm releasing in this repo. If you change sources and compile your own binaries, then you need to update installation script to match your assembly and managed ICertPolicy and ICertManageModule interfaces implementations:

playduin commented 1 year ago

After renaming all filenames and fields in the project and installation script, I see same error.

Sleepw4lker commented 1 year ago

If you want to build a custom module from scratch, here is a "stub" project. Here is a "production ready" one with build instructions.

Crypt32 commented 1 year ago

Closing because of inactivity.