From: Mohamad Al-Jaf mohamadaljaf@gmail.com
Needed by Lenovo USBRecoveryCreator. --- dlls/cryptxml/Makefile.in | 3 ++ dlls/cryptxml/cryptxml.c | 65 +++++++++++++++++++++++++++++++++++++ dlls/cryptxml/cryptxml.spec | 2 +- 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 dlls/cryptxml/cryptxml.c
diff --git a/dlls/cryptxml/Makefile.in b/dlls/cryptxml/Makefile.in index f5e925499c2..1fe91fe7019 100644 --- a/dlls/cryptxml/Makefile.in +++ b/dlls/cryptxml/Makefile.in @@ -1 +1,4 @@ MODULE = cryptxml.dll + +SOURCES = \ + cryptxml.c diff --git a/dlls/cryptxml/cryptxml.c b/dlls/cryptxml/cryptxml.c new file mode 100644 index 00000000000..0a32874df10 --- /dev/null +++ b/dlls/cryptxml/cryptxml.c @@ -0,0 +1,65 @@ +/* CryptXML Implementation + * + * Copyright (C) 2025 Mohamad Al-Jaf + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include <stdarg.h> + +#include "windef.h" +#include "winbase.h" +#include "cryptxml.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(cryptxml); + +HRESULT WINAPI CryptXmlOpenToDecode( const CRYPT_XML_TRANSFORM_CHAIN_CONFIG *config, DWORD flags, const CRYPT_XML_PROPERTY *property, + ULONG property_count, const CRYPT_XML_BLOB *blob, HCRYPTXML *handle ) +{ + static CRYPT_XML_SIGNED_INFO signed_info = { 0 }; + static CRYPT_XML_KEY_INFO key_info = { 0 }; + static PCRYPT_XML_SIGNATURE signatures[1]; + static CRYPT_XML_SIGNATURE signature; + static CRYPT_XML_DOC_CTXT *context; + + FIXME( "config %p, flags %lx, property %p, property_count %lu, blob %p, handle %p stub!\n", + config, flags, property, property_count, blob, handle ); + + if (!blob || !handle) return E_INVALIDARG; + if (!(context = calloc( 1, sizeof( *context ) ))) return E_OUTOFMEMORY; + + signature.cbSize = sizeof( CRYPT_XML_SIGNATURE ); + signature.hSignature = (HCRYPTXML)&signature; + signature.wszId = L""; + signature.SignedInfo = signed_info; + signature.SignatureValue.cbData = blob->cbData; + signature.SignatureValue.pbData = blob->pbData; + signature.pKeyInfo = &key_info; + signature.cObject = 0; + signature.rgpObject = NULL; + + signatures[0] = &signature; + + context->cbSize = sizeof( *context ); + context->hDocCtxt = (HCRYPTXML)context; + context->pTransformsConfig = (CRYPT_XML_TRANSFORM_CHAIN_CONFIG *)config; + context->cSignature = 1; + context->rgpSignature = signatures; + + *handle = (HCRYPTXML)context; + return S_OK; +} diff --git a/dlls/cryptxml/cryptxml.spec b/dlls/cryptxml/cryptxml.spec index 326f5d56b32..6e9847770a3 100644 --- a/dlls/cryptxml/cryptxml.spec +++ b/dlls/cryptxml/cryptxml.spec @@ -12,7 +12,7 @@ @ stub CryptXmlGetStatus @ stub CryptXmlGetTransforms @ stub CryptXmlImportPublicKey -@ stub CryptXmlOpenToDecode +@ stdcall CryptXmlOpenToDecode(ptr long ptr long ptr ptr) @ stub CryptXmlOpenToEncode @ stub CryptXmlSetHMACSecret @ stub CryptXmlSign