Build more components of Security

This commit is contained in:
Andrew Hyatt 2017-06-13 13:47:26 -07:00
parent 681533d4d0
commit 443ca774d3
9 changed files with 84 additions and 4 deletions

View File

@ -6,4 +6,11 @@ add_definitions(
-DOSSPINLOCK_USE_INLINED=0
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/keychain
${CMAKE_CURRENT_SOURCE_DIR}/base
${CMAKE_CURRENT_SOURCE_DIR}/OSX/libsecurity_asn1
${CMAKE_CURRENT_SOURCE_DIR}/trust
)
add_subdirectory(OSX)

View File

@ -1 +1,2 @@
add_subdirectory(libsecurity_asn1)
add_subdirectory(sec)

65
OSX/sec/CMakeLists.txt Normal file
View File

@ -0,0 +1,65 @@
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/ipc
${CMAKE_CURRENT_SOURCE_DIR}/SOSCircle/SecureObjectSync
)
add_definitions(
-DSEC_IOS_ON_OSX=1
)
add_library(libSecOtrOSX OBJECT
Security/SecOTRDHKey.c
Security/SecOTRFullIdentity.c
Security/SecOTRMath.c
Security/SecOTRPacketData.c
Security/SecOTRPackets.c
Security/SecOTRPublicIdentity.c
Security/SecOTRSession.c
Security/SecOTRSessionAKE.c
Security/SecOTRUtils.c
)
make_fat(libSecOtrOSX)
add_definitions(
-DECITEM_SHIM_OSX=1
)
add_library(libSecItemShimOSX OBJECT
Security/SecItemBackup.c
Security/SecKeyAdaptors.c
Security/SecCFAllocator.c
Security/SecItem.c
Security/SecRSAKey.c
Security/SecDH.c
Security/SecCTKKey.c
SOSCircle/SecureObjectSync/SOSCloudCircle.c
Security/SecAccessControl.c
Security/SecKey.c
Security/SecuritydXPC.c
Security/SecECKey.c
Security/SecItemConstants.c
Security/SecPasswordGenerate.c
)
make_fat(libSecItemShimOSX)
add_library(libSecTrustOSX OBJECT
Security/SecCertificateRequest.c
Security/SecCertificate.c
Security/SecDigest.c
Security/SecBase64.c
Security/SecCertificatePath.c
Security/SecKey.c
Security/SecKeyAdaptors.c
Security/SecPolicy.c
Security/SecPolicyLeafCallbacks.c
Security/SecTrust.c
Security/SecTrustStore.c
Security/SecECKey.c
Security/SecRSAKey.c
Security/SecServerEncryptionSupport.c
../utilities/src/SecInternalRelease.c
Security/SecSignatureVerificationSupport.c
)
make_fat(libSecTrustOSX)

View File

@ -548,8 +548,8 @@ static CFTypeRef SecRSAPrivateKeyCopyOperationResult(SecKeyRef key, SecKeyOperat
// Encrypt buffer and write it to output data.
result = CFDataCreateMutableWithScratch(kCFAllocatorDefault, ccrsa_block_size(ccrsa_ctx_public(fullkey)));
ccerr = ccrsa_priv_crypt(fullkey, (cc_unit *)CFDataGetMutableBytePtr((CFMutableDataRef)result),
(const cc_unit *)CFDataGetBytePtr(in1));
//ccerr = ccrsa_priv_crypt(fullkey, (cc_unit *)CFDataGetMutableBytePtr((CFMutableDataRef)result),
// (const cc_unit *)CFDataGetBytePtr(in1));
} else {
// Operation is supported.
result = kCFBooleanTrue;
@ -561,8 +561,8 @@ static CFTypeRef SecRSAPrivateKeyCopyOperationResult(SecKeyRef key, SecKeyOperat
if (mode == kSecKeyOperationModePerform) {
// Decrypt buffer and write it to output data.
result = CFDataCreateMutableWithScratch(NULL, ccrsa_block_size(fullkey));
ccerr = ccrsa_priv_crypt(fullkey, (cc_unit *)CFDataGetMutableBytePtr((CFMutableDataRef)result),
(const cc_unit *)CFDataGetBytePtr(in1));
//ccerr = ccrsa_priv_crypt(fullkey, (cc_unit *)CFDataGetMutableBytePtr((CFMutableDataRef)result),
// (const cc_unit *)CFDataGetBytePtr(in1));
} else {
// Operation is supported.
result = kCFBooleanTrue;

View File

@ -0,0 +1 @@
../SOSCircle/SecureObjectSync

1
OSX/sec/libDER Symbolic link
View File

@ -0,0 +1 @@
../libsecurity_keychain/libDER/libDER

1
OSX/sec/utilities Symbolic link
View File

@ -0,0 +1 @@
../utilities/src

View File

@ -48,6 +48,9 @@
#error "unknown keystore status for this platform"
#endif
#undef TARGET_HAS_KEYSTORE
#define TARGET_HAS_KEYSTORE 0
#if !TARGET_HAS_KEYSTORE
#include <IOKit/IOReturn.h>

View File

@ -0,0 +1 @@
../../OSX/libsecurity_asn1/lib/SecAsn1Coder.h