Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
29 Views

Missing constants for Windows 7 API cryptographic functions in IVF 2017.1

Jump to solution

Hello all.

While trying to use Windows functions from the ADVAPI32 module to compute SHA keys, I noticed that the Microsoft AES Cryptographic Provider constant MS_ENH_RSA_AES_PROV is not defined in the IFWINTY module. Character strings definitions of providers are here on MSDN. For this provider, it is "Microsoft Enhanced RSA and AES Cryptographic Provider".

Instead, there is a MS_ENH_RSA_AES_PROV_A constant (equal to "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)") that, according to Microsoft, was used on Windows XP, under the name MS_ENH_RSA_AES_PROV.

Likewise, several algorithm constants are not defined, for instance CALG_SHA_256 and the other SHA-2 algorithms.

It's not much of an issue, since all of this is documented on the MSDN and I can simply add the constants to my program, but maybe the modules will have to be updated eventually.

I added working examples on the Rosetta Code web site, for MD5, SHA-1 and SHA-256. Problems arised with the last, as MD5 and SHA-1 come with the "Microsoft Base Cryptographic Provider", for which IVF has all the necessary constants.

Best regards,

Jean-Claude Arbaut

0 Kudos

Accepted Solutions
Highlighted
29 Views

Try the attached - unzip and add it to your project.

View solution in original post

0 Kudos
5 Replies
Highlighted
29 Views

We have been trying to keep up with the Windows API, but it's difficult because changes are not all listed in one place. It's a manual process and we've been concentrating on kernel32 changes mostly.

I'll take a look at the crypto API and see what needs to be added. If you come across any other useful APIs and constants missing, please do let us know.

0 Kudos
Highlighted
Beginner
29 Views

Thank you. I didn't realize that this is done by hand, I thought it could be possible to write a script to automatically translate Windows C headers into Fortran interface modules.

Jean-Claude Arbaut

0 Kudos
Highlighted
29 Views

It is possible, but a lot of hand editing and checking is also needed. The C headers don't always "translate" into what a Fortran user would want.

0 Kudos
Highlighted
30 Views

Try the attached - unzip and add it to your project.

View solution in original post

0 Kudos
Highlighted
Beginner
29 Views

It's working now, thanks!

0 Kudos