Please can you share your recompiled code. i would like to try it for the same usage as you (create a master image to deploy on different hardware)
Actually, I'll do one better, what I should have done origionally: I'll explain how I compiled the code.
First thing I did was grab the
Origional C Source cited in Peters original post.
Next I replaced the CryptAcquireContext subroutine in that source with my revised one that had the context specification in it. Specifically...
if(CryptAcquireContext(
&hCryptProv,
NULL,
NULL,
PROV_RSA_FULL,
0))
{
printf("CryptAcquireContext complete. \n");
} else {
MyHandleError("Acquisition of context failed.");
}
becomes....
if(CryptAcquireContext(
&hCryptProv,
NULL,
NULL,
PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT))
{
printf("CryptAcquireContext complete. \n");
} else {
MyHandleError("Acquisition of context failed.");
}
Next I downloaded the
cygwin installer and installed the Cygwin system to my computer.
When you install Cygwin, be absolutely sure that you include the GCC-Core and GDB packages installed as well. These are the Gnu C Compiler and GNU Debugger packages you'll need if you want to do any basic C compiling on your computer. You may need other packages too depending on your needs. I've installed that thing so often that I just have a base set of boxes that i always check, regardless of where I'm putting it;) GCC-Core is one of them.
Ok, let Cygwin rip and finish. It should make a start menu folder for you called Cygwin, and in it a shortcut called "Cygwin Bash Shell". Launch that bad boy.
From here, I'm going to assume you know how to navigate through a *nix system. If you dont know what the "ls" or "man" commands do please check out
this resource.
When it comes time to compile your source, navigate to the folder you have containing your .c file, and run this command:
gcc drvsignsup.c -mno-cygwin
I share that bit specifically because it bothers the heck out of me when I find my compiled apps require certain cygwin specific dlls to run;) The -mno-cygwin switch will remove cygwin dependency from your compiled app, making it portable to your windows machines as a standalone app, with out the need of dragging things like the cygwin1.dll around with the .exe.
Hope that helps dude!
And again, as Peter already pointed out, all this stuff isn't really required for his script. This is if you want to use the drvsignsup on an OS that you intend to image and deploy over and over again, or suppress the signing policy on currently rolled out computers via automation.