libwinpr-crypto: started stubbing CryptoAPI
authorMarc-André Moreau <marcandre.moreau@gmail.com>
Sat, 22 Dec 2012 07:23:58 +0000 (02:23 -0500)
committerMarc-André Moreau <marcandre.moreau@gmail.com>
Sat, 22 Dec 2012 07:23:58 +0000 (02:23 -0500)
winpr/include/winpr/crypto.h [new file with mode: 0644]
winpr/libwinpr/crypto/CMakeLists.txt [new file with mode: 0644]
winpr/libwinpr/crypto/ModuleOptions.cmake [new file with mode: 0644]
winpr/libwinpr/crypto/cert.c [new file with mode: 0644]
winpr/libwinpr/crypto/crypto.c [new file with mode: 0644]
winpr/libwinpr/crypto/module.def [new file with mode: 0644]
winpr/libwinpr/pool/CMakeLists.txt

diff --git a/winpr/include/winpr/crypto.h b/winpr/include/winpr/crypto.h
new file mode 100644 (file)
index 0000000..a71067e
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * WinPR: Windows Portable Runtime
+ * Cryptography API (CryptoAPI)
+ *
+ * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef WINPR_CRYPTO_H
+#define WINPR_CRYPTO_H
+
+#include <winpr/winpr.h>
+#include <winpr/wtypes.h>
+
+#ifndef _WIN32
+
+#endif
+
+#endif /* WINPR_CRYPTO_H */
+
diff --git a/winpr/libwinpr/crypto/CMakeLists.txt b/winpr/libwinpr/crypto/CMakeLists.txt
new file mode 100644 (file)
index 0000000..a935afa
--- /dev/null
@@ -0,0 +1,42 @@
+# WinPR: Windows Portable Runtime
+# libwinpr-crypto cmake build script
+#
+# Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+set(MODULE_NAME "winpr-crypto")
+set(MODULE_PREFIX "WINPR_CRYPTO")
+
+set(${MODULE_PREFIX}_SRCS
+       crypto.c
+       cert.c)
+
+if(MSVC AND (NOT MONOLITHIC_BUILD))
+       set(${MODULE_PREFIX}_SRCS ${${MODULE_PREFIX}_SRCS} module.def)
+endif()
+
+add_complex_library(MODULE ${MODULE_NAME} TYPE "OBJECT"
+       MONOLITHIC ${MONOLITHIC_BUILD}
+       SOURCES ${${MODULE_PREFIX}_SRCS})
+
+set_target_properties(${MODULE_NAME} PROPERTIES VERSION ${WINPR_VERSION_FULL} SOVERSION ${WINPR_VERSION} PREFIX "lib")
+
+if(MONOLITHIC_BUILD)
+
+else()
+       install(TARGETS ${MODULE_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR})
+endif()
+
+set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "WinPR")
+
diff --git a/winpr/libwinpr/crypto/ModuleOptions.cmake b/winpr/libwinpr/crypto/ModuleOptions.cmake
new file mode 100644 (file)
index 0000000..39cbfe1
--- /dev/null
@@ -0,0 +1,9 @@
+
+set(MINWIN_LAYER "1")
+set(MINWIN_GROUP "core")
+set(MINWIN_MAJOR_VERSION "1")
+set(MINWIN_MINOR_VERSION "0")
+set(MINWIN_SHORT_NAME "crypto")
+set(MINWIN_LONG_NAME "Cryptography API (CryptoAPI)")
+set(MODULE_LIBRARY_NAME "crypt32")
+
diff --git a/winpr/libwinpr/crypto/cert.c b/winpr/libwinpr/crypto/cert.c
new file mode 100644 (file)
index 0000000..5309c81
--- /dev/null
@@ -0,0 +1,157 @@
+/**
+ * WinPR: Windows Portable Runtime
+ * Cryptography API (CryptoAPI)
+ *
+ * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <winpr/crypto.h>
+
+/**
+ * CertAddCertificateContextToStore
+ * CertAddCertificateLinkToStore
+ * CertAddCRLContextToStore
+ * CertAddCRLLinkToStore
+ * CertAddCTLContextToStore
+ * CertAddCTLLinkToStore
+ * CertAddEncodedCertificateToStore
+ * CertAddEncodedCertificateToSystemStoreA
+ * CertAddEncodedCertificateToSystemStoreW
+ * CertAddEncodedCRLToStore
+ * CertAddEncodedCTLToStore
+ * CertAddSerializedElementToStore
+ * CertAddStoreToCollection
+ * CertControlStore
+ * CertCloseStore
+ * CertDeleteCertificateFromStore
+ * CertDeleteCRLFromStore
+ * CertDeleteCTLFromStore
+ * CertDuplicateStore
+ * CertGetCRLFromStore
+ * CertEnumCertificatesInStore
+ * CertEnumCRLsInStore
+ * CertEnumCTLsInStore
+ * CertEnumPhysicalStore
+ * CertEnumSystemStore
+ * CertEnumSystemStoreLocation
+ * CertFindCertificateInStore
+ * CertFindChainInStore
+ * CertFindCRLInStore
+ * CertFindCTLInStore
+ * CertGetIssuerCertificateFromStore
+ * CertGetStoreProperty
+ * CertGetSubjectCertificateFromStore
+ * CertOpenStore
+ * CertOpenSystemStoreA
+ * CertOpenSystemStoreW
+ * CertRegisterPhysicalStore
+ * CertRegisterSystemStore
+ * CertRemoveStoreFromCollection
+ * CertSaveStore
+ * CertSerializeCertificateStoreElement
+ * CertSerializeCRLStoreElement
+ * CertSerializeCTLStoreElement
+ * CertSetStoreProperty
+ * CertUnregisterPhysicalStore
+ * CertUnregisterSystemStore
+ *
+ * CertAddEnhancedKeyUsageIdentifier
+ * CertAddRefServerOcspResponse
+ * CertAddRefServerOcspResponseContext
+ * CertAlgIdToOID
+ * CertCloseServerOcspResponse
+ * CertCompareCertificate
+ * CertCompareCertificateName
+ * CertCompareIntegerBlob
+ * CertComparePublicKeyInfo
+ * CertCreateCertificateChainEngine
+ * CertCreateCertificateContext
+ * CertCreateContext
+ * CertCreateCRLContext
+ * CertCreateCTLContext
+ * CertCreateCTLEntryFromCertificateContextProperties
+ * CertCreateSelfSignCertificate
+ * CertDuplicateCertificateChain
+ * CertDuplicateCertificateContext
+ * CertDuplicateCRLContext
+ * CertDuplicateCTLContext
+ * CertEnumCertificateContextProperties
+ * CertEnumCRLContextProperties
+ * CertEnumCTLContextProperties
+ * CertEnumSubjectInSortedCTL
+ * CertFindAttribute
+ * CertFindCertificateInCRL
+ * CertFindExtension
+ * CertFindRDNAttr
+ * CertFindSubjectInCTL
+ * CertFindSubjectInSortedCTL
+ * CertFreeCertificateChain
+ * CertFreeCertificateChainEngine
+ * CertFreeCertificateChainList
+ * CertFreeCertificateContext
+ * CertFreeCRLContext
+ * CertFreeCTLContext
+ * CertFreeServerOcspResponseContext
+ * CertGetCertificateChain
+ * CertGetCertificateContextProperty
+ * CertGetCRLContextProperty
+ * CertGetCTLContextProperty
+ * CertGetEnhancedKeyUsage
+ * CertGetIntendedKeyUsage
+ * CertGetNameStringA
+ * CertGetNameStringW
+ * CertGetPublicKeyLength
+ * CertGetServerOcspResponseContext
+ * CertGetValidUsages
+ * CertIsRDNAttrsInCertificateName
+ * CertIsStrongHashToSign
+ * CertIsValidCRLForCertificate
+ * CertNameToStrA
+ * CertNameToStrW
+ * CertOIDToAlgId
+ * CertOpenServerOcspResponse
+ * CertRDNValueToStrA
+ * CertRDNValueToStrW
+ * CertRemoveEnhancedKeyUsageIdentifier
+ * CertResyncCertificateChainEngine
+ * CertRetrieveLogoOrBiometricInfo
+ * CertSelectCertificateChains
+ * CertSetCertificateContextPropertiesFromCTLEntry
+ * CertSetCertificateContextProperty
+ * CertSetCRLContextProperty
+ * CertSetCTLContextProperty
+ * CertSetEnhancedKeyUsage
+ * CertStrToNameA
+ * CertStrToNameW
+ * CertVerifyCertificateChainPolicy
+ * CertVerifyCRLRevocation
+ * CertVerifyCRLTimeValidity
+ * CertVerifyCTLUsage
+ * CertVerifyRevocation
+ * CertVerifySubjectCertificateContext
+ * CertVerifyTimeValidity
+ * CertVerifyValidityNesting
+ */
+
+#ifndef _WIN32
+
+
+
+#endif
+
diff --git a/winpr/libwinpr/crypto/crypto.c b/winpr/libwinpr/crypto/crypto.c
new file mode 100644 (file)
index 0000000..5c6a1a6
--- /dev/null
@@ -0,0 +1,149 @@
+/**
+ * WinPR: Windows Portable Runtime
+ * Cryptography API (CryptoAPI)
+ *
+ * Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <winpr/crypto.h>
+
+/**
+ * CryptAcquireCertificatePrivateKey
+ * CryptBinaryToStringA
+ * CryptBinaryToStringW
+ * CryptCloseAsyncHandle
+ * CryptCreateAsyncHandle
+ * CryptCreateKeyIdentifierFromCSP
+ * CryptDecodeMessage
+ * CryptDecodeObject
+ * CryptDecodeObjectEx
+ * CryptDecryptAndVerifyMessageSignature
+ * CryptDecryptMessage
+ * CryptEncodeObject
+ * CryptEncodeObjectEx
+ * CryptEncryptMessage
+ * CryptEnumKeyIdentifierProperties
+ * CryptEnumOIDFunction
+ * CryptEnumOIDInfo
+ * CryptExportPKCS8
+ * CryptExportPublicKeyInfo
+ * CryptExportPublicKeyInfoEx
+ * CryptExportPublicKeyInfoFromBCryptKeyHandle
+ * CryptFindCertificateKeyProvInfo
+ * CryptFindLocalizedName
+ * CryptFindOIDInfo
+ * CryptFormatObject
+ * CryptFreeOIDFunctionAddress
+ * CryptGetAsyncParam
+ * CryptGetDefaultOIDDllList
+ * CryptGetDefaultOIDFunctionAddress
+ * CryptGetKeyIdentifierProperty
+ * CryptGetMessageCertificates
+ * CryptGetMessageSignerCount
+ * CryptGetOIDFunctionAddress
+ * CryptGetOIDFunctionValue
+ * CryptHashCertificate
+ * CryptHashCertificate2
+ * CryptHashMessage
+ * CryptHashPublicKeyInfo
+ * CryptHashToBeSigned
+ * CryptImportPKCS8
+ * CryptImportPublicKeyInfo
+ * CryptImportPublicKeyInfoEx
+ * CryptImportPublicKeyInfoEx2
+ * CryptInitOIDFunctionSet
+ * CryptInstallDefaultContext
+ * CryptInstallOIDFunctionAddress
+ * CryptLoadSip
+ * CryptMemAlloc
+ * CryptMemFree
+ * CryptMemRealloc
+ * CryptMsgCalculateEncodedLength
+ * CryptMsgClose
+ * CryptMsgControl
+ * CryptMsgCountersign
+ * CryptMsgCountersignEncoded
+ * CryptMsgDuplicate
+ * CryptMsgEncodeAndSignCTL
+ * CryptMsgGetAndVerifySigner
+ * CryptMsgGetParam
+ * CryptMsgOpenToDecode
+ * CryptMsgOpenToEncode
+ * CryptMsgSignCTL
+ * CryptMsgUpdate
+ * CryptMsgVerifyCountersignatureEncoded
+ * CryptMsgVerifyCountersignatureEncodedEx
+ * CryptProtectData
+ * CryptProtectMemory
+ * CryptQueryObject
+ * CryptRegisterDefaultOIDFunction
+ * CryptRegisterOIDFunction
+ * CryptRegisterOIDInfo
+ * CryptRetrieveTimeStamp
+ * CryptSetAsyncParam
+ * CryptSetKeyIdentifierProperty
+ * CryptSetOIDFunctionValue
+ * CryptSignAndEncodeCertificate
+ * CryptSignAndEncryptMessage
+ * CryptSignCertificate
+ * CryptSignMessage
+ * CryptSignMessageWithKey
+ * CryptSIPAddProvider
+ * CryptSIPCreateIndirectData
+ * CryptSIPGetCaps
+ * CryptSIPGetSignedDataMsg
+ * CryptSIPLoad
+ * CryptSIPPutSignedDataMsg
+ * CryptSIPRemoveProvider
+ * CryptSIPRemoveSignedDataMsg
+ * CryptSIPRetrieveSubjectGuid
+ * CryptSIPRetrieveSubjectGuidForCatalogFile
+ * CryptSIPVerifyIndirectData
+ * CryptStringToBinaryA
+ * CryptStringToBinaryW
+ * CryptUninstallDefaultContext
+ * CryptUnprotectData
+ * CryptUnprotectMemory
+ * CryptUnregisterDefaultOIDFunction
+ * CryptUnregisterOIDFunction
+ * CryptUnregisterOIDInfo
+ * CryptUpdateProtectedState
+ * CryptVerifyCertificateSignature
+ * CryptVerifyCertificateSignatureEx
+ * CryptVerifyDetachedMessageHash
+ * CryptVerifyDetachedMessageSignature
+ * CryptVerifyMessageHash
+ * CryptVerifyMessageSignature
+ * CryptVerifyMessageSignatureWithKey
+ * CryptVerifyTimeStampSignature
+ * DbgInitOSS
+ * DbgPrintf
+ * PFXExportCertStore
+ * PFXExportCertStore2
+ * PFXExportCertStoreEx
+ * PFXImportCertStore
+ * PFXIsPFXBlob
+ * PFXVerifyPassword
+ */
+
+#ifndef _WIN32
+
+
+
+#endif
diff --git a/winpr/libwinpr/crypto/module.def b/winpr/libwinpr/crypto/module.def
new file mode 100644 (file)
index 0000000..d21b126
--- /dev/null
@@ -0,0 +1,3 @@
+LIBRARY                "libwinpr-crypto"
+EXPORTS
+
index 7470c0a..9841e43 100644 (file)
@@ -1,5 +1,5 @@
 # WinPR: Windows Portable Runtime
-# libwinpr-thread cmake build script
+# libwinpr-pool cmake build script
 #
 # Copyright 2012 Marc-Andre Moreau <marcandre.moreau@gmail.com>
 #