Closed fastbike closed 6 months ago
With the last commit I've added some conditional defines to load the correct DLL version. But the problem with xmlSecDSigCtxSign
remains. If I enable the log a see:
func=xmlSecDSigCtxProcessKeyInfoNode:file=xmldsig.c:line=871:obj=unknown:subj=unknown:error=45:key is not found:
func=xmlSecDSigCtxProcessSignatureNode:file=xmldsig.c:line=565:obj=unknown:subj=xmlSecDSigCtxProcessKeyInfoNode:error=1:xmlsec library function failed:
func=xmlSecDSigCtxSign:file=xmldsig.c:line=303:obj=unknown:subj=xmlSecDSigCtxSignatureProcessNode:error=1:xmlsec library function failed:
I don't know if it's same for you. I'll try to work on it in the next few days.
The problem was that on win64 the time_t
size change from LongInt
to Int64
The problem was that on win64 the
time_t
size change fromLongInt
toInt64
Thank you very much for tracking this down and fixing.
@lminuti This has not fixed the issue for signing ... The following signatures need to be changed according to the compiler
// Win32
function xmlSecDSigCtxSign (dsigCtx: xmlSecDSigCtxPtr; tmpl: xmlNodePtr) : Longint; cdecl; external LIBXMLSEC_SO;
function xmlSecDSigCtxVerify (dsigCtx: xmlSecDSigCtxPtr; node: xmlNodePtr) : Longint; cdecl; external LIBXMLSEC_SO;
// Win64
function xmlSecDSigCtxSign (dsigCtx: xmlSecDSigCtxPtr; tmpl: xmlNodePtr) : Int64; cdecl; external LIBXMLSEC_SO;
function xmlSecDSigCtxVerify (dsigCtx: xmlSecDSigCtxPtr; node: xmlNodePtr) : Int64; cdecl; external LIBXMLSEC_SO;
I think a global alias for LongInt is required as this will be used elsewhere too
longint is correct. The C
declaration are
XMLSEC_EXPORT int xmlSecDSigCtxSign (xmlSecDSigCtxPtr dsigCtx,
xmlNodePtr tmpl);
XMLSEC_EXPORT int xmlSecDSigCtxVerify (xmlSecDSigCtxPtr dsigCtx,
xmlNodePtr node);
The size of int
type in C/C++ in 32bit and 64bit architectures are the same as you can see for examples here: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/64-bit_Windows_Data_Types_Compared_to_32-bit_Windows_Data_Types (you can see both delphi and C++ data types comparison).
If you still have problems probably there's something else wrong. Try to follow these steps:
keygen.bat
, this will create two files sp-key.pem
and sp-cert.pem
<myns:test xmlns:myns="urn:myns" ID="1234"></myns:test>
sp-key.pem
, sp-cert.pem
and the XML in bin64 folderXmlSecDemo
project (64bit target)urn:myns:test
)sp-key.pem
sp-cert.pem
Thanks for uploading this library. I'm looking to compile the demos for 64 bit use, I've changed some of the conditional defines such as
I can get the code signing demo to work until the actual call to sign the XML
I'm using the same certs, input XML file etc but just with a recent 64 bit version of the DLLs from the https://www.aleksey.com/xmlsec/ website