this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Changes to get Security and Heimdal building

+618 -34
-1
platform-include/ApplicationServices
··· 1 - ../src/ApplicationServices/include/ApplicationServices/
+1
platform-include/CommonCrypto
··· 1 + ../src/CommonCrypto/CommonCrypto/
-1
platform-include/CoreFoundation
··· 1 - ../src/external/corefoundation/
+1
platform-include/corecrypto
··· 1 + ../src/external/corecrypto/include/corecrypto/
+1 -1
platform-include/dispatch
··· 1 - ../src/external/libdispatch/dispatch 1 + ../src/external/libdispatch/include/dispatch/
+1
platform-include/dns.h
··· 1 + ../src/libresolv/dns.h
+1
platform-include/sqlite3_private.h
··· 1 + ../src/external/sqlite/include/sqlite3_private.h
+1
platform-include/unicode
··· 1 + ../src/external/icu/icuSources/common/unicode/
+6 -4
src/CMakeLists.txt
··· 74 74 ${CMAKE_CURRENT_SOURCE_DIR}/libiconv/include 75 75 ${CMAKE_CURRENT_SOURCE_DIR}/ncurses/include 76 76 ${CMAKE_CURRENT_SOURCE_DIR}/libc/include/NetBSD 77 + ${CMAKE_CURRENT_SOURCE_DIR}/external/corefoundation/include 78 + ${CMAKE_CURRENT_SOURCE_DIR}/external/foundation/include 79 + ${CMAKE_CURRENT_SOURCE_DIR}/external/syslog/libsystem_asl.tproj/include 77 80 ) 78 81 79 82 add_subdirectory(external/libkqueue) ··· 132 135 #add_subdirectory(ApplicationServices) 133 136 #add_subdirectory(VideoDecodeAcceleration) 134 137 add_subdirectory(DiskArbitration) 135 - #add_subdirectory(DebugSymbols) 136 - add_subdirectory(external/Heimdal) 137 138 add_subdirectory(xar) 138 139 add_subdirectory(libedit) 139 140 add_subdirectory(external/libclosure) ··· 147 148 #add_subdirectory(external/libauto) 148 149 add_subdirectory(external/libarchive/libarchive) 149 150 add_subdirectory(external/apr) 150 - #add_subdirectory(external/corecrypto) 151 - #add_subdirectory(external/security) # work in progress 151 + add_subdirectory(external/corecrypto) 152 + add_subdirectory(external/security) 152 153 add_subdirectory(sandbox) 153 154 add_subdirectory(xcselect) 154 155 #add_subdirectory(Cocoa) ··· 196 197 add_subdirectory(login) 197 198 add_subdirectory(DebugSymbols) 198 199 add_subdirectory(external/bsm) 200 + add_subdirectory(external/Heimdal) 199 201 200 202 add_subdirectory(external/libcxxabi) 201 203 add_subdirectory(external/libcxx)
+196
src/CommonCrypto/CommonCrypto/CommonCryptorSPI.h
··· 1 + /* 2 + * Copyright (c) 2010 Apple Inc. All Rights Reserved. 3 + * 4 + * @APPLE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. Please obtain a copy of the License at 10 + * http://www.opensource.apple.com/apsl/ and read it before using this 11 + * file. 12 + * 13 + * The Original Code and all software distributed under the License are 14 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 + * Please see the License for the specific language governing rights and 19 + * limitations under the License. 20 + * 21 + * @APPLE_LICENSE_HEADER_END@ 22 + */ 23 + 24 + #ifndef _CC_CryptorSPI_H_ 25 + #define _CC_CryptorSPI_H_ 26 + 27 + #include <sys/types.h> 28 + #include <sys/param.h> 29 + #include <stdint.h> 30 + 31 + #include <string.h> 32 + #include <limits.h> 33 + #include <stdlib.h> 34 + #include <Availability.h> 35 + 36 + #ifdef __cplusplus 37 + extern "C" { 38 + #endif 39 + 40 + /* 41 + This is an SPI header. It includes some work in progress implementation notes that 42 + will be removed when this is promoted to an API set. 43 + */ 44 + 45 + /* 46 + Cipher Modes 47 + */ 48 + 49 + enum { 50 + kCCModeECB = 1, 51 + kCCModeCBC = 2, 52 + kCCModeCFB = 3, 53 + kCCModeCTR = 4, 54 + kCCModeF8 = 5, // Unimplemented for now (not included) 55 + kCCModeLRW = 6, // Unimplemented for now (not included) 56 + kCCModeOFB = 7, 57 + kCCModeXTS = 8, 58 + kCCModeRC4 = 9, // RC4 as a streaming cipher is handled internally as a mode. 59 + kCCModeCFB8 = 10, 60 + }; 61 + typedef uint32_t CCMode; 62 + 63 + /* 64 + Padding for block ciphers 65 + */ 66 + 67 + enum { 68 + ccDefaultPadding = 0, 69 + ccPKCS7Padding = 1, 70 + ccANSIx923Padding = 2, // Unimplemented for now (not included) 71 + ccISO10126Padding = 3, // Unimplemented for now (not included) 72 + }; 73 + typedef uint32_t CCPadding; 74 + 75 + /* 76 + Mode options - so far only used for CTR mode 77 + */ 78 + 79 + enum { 80 + kCCModeOptionCTR_LE = 0x0001, // CTR Mode Little Endian 81 + kCCModeOptionCTR_BE = 0x0002 // CTR Mode Big Endian 82 + }; 83 + 84 + typedef uint32_t CCModeOptions; 85 + 86 + /* 87 + Supports a mode call of 88 + int mode_setup(int cipher, const unsigned char *IV, const unsigned char *key, int keylen, 89 + const unsigned char *tweak, int tweaklen, int num_rounds, int options, mode_context *ctx); 90 + */ 91 + 92 + /* User supplied space for the CryptorRef */ 93 + 94 + CCCryptorStatus CCCryptorCreateFromDataWithMode( 95 + CCOperation op, /* kCCEncrypt, kCCEncrypt, kCCBoth (default for BlockMode) */ 96 + CCMode mode, 97 + CCAlgorithm alg, 98 + CCPadding padding, 99 + const void *iv, /* optional initialization vector */ 100 + const void *key, /* raw key material */ 101 + size_t keyLength, 102 + const void *tweak, /* raw tweak material */ 103 + size_t tweakLength, 104 + int numRounds, 105 + CCModeOptions options, 106 + const void *data, /* caller-supplied memory */ 107 + size_t dataLength, /* length of data in bytes */ 108 + CCCryptorRef *cryptorRef, /* RETURNED */ 109 + size_t *dataUsed) /* optional, RETURNED */ 110 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 111 + 112 + /* This version mallocs the CCCryptorRef */ 113 + 114 + CCCryptorStatus CCCryptorCreateWithMode( 115 + CCOperation op, /* kCCEncrypt, kCCEncrypt, kCCBoth (default for BlockMode) */ 116 + CCMode mode, 117 + CCAlgorithm alg, 118 + CCPadding padding, 119 + const void *iv, /* optional initialization vector */ 120 + const void *key, /* raw key material */ 121 + size_t keyLength, 122 + const void *tweak, /* raw tweak material */ 123 + size_t tweakLength, 124 + int numRounds, /* 0 == default */ 125 + CCModeOptions options, 126 + CCCryptorRef *cryptorRef) /* RETURNED */ 127 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 128 + 129 + /* 130 + Assuming we can use existing CCCryptorCreateFromData for all modes serviced by these: 131 + int mode_encrypt(const unsigned char *pt, unsigned char *ct, unsigned long len, mode_context *ctx); 132 + int mode_decrypt(const unsigned char *ct, unsigned char *pt, unsigned long len, mode_context *ctx); 133 + */ 134 + 135 + /* 136 + Block mode encrypt and decrypt interfaces for IV tweaked blocks (XTS and CBC) 137 + 138 + int mode_encrypt_tweaked(const unsigned char *pt, unsigned long len, unsigned char *ct, const unsigned char *tweak, mode_context *ctx); 139 + int mode_decrypt_tweaked(const unsigned char *ct, unsigned long len, unsigned char *pt, const unsigned char *tweak, mode_context *ctx); 140 + */ 141 + 142 + CCCryptorStatus CCCryptorEncryptDataBlock( 143 + CCCryptorRef cryptorRef, 144 + const void *iv, 145 + const void *dataIn, 146 + size_t dataInLength, 147 + void *dataOut) 148 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 149 + 150 + 151 + CCCryptorStatus CCCryptorDecryptDataBlock( 152 + CCCryptorRef cryptorRef, 153 + const void *iv, 154 + const void *dataIn, 155 + size_t dataInLength, 156 + void *dataOut) 157 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 158 + 159 + /* 160 + Assuming we can use the existing CCCryptorRelease() interface for 161 + int mode_done(mode_context *ctx); 162 + */ 163 + 164 + /* 165 + Not surfacing these other than with CCCryptorReset() 166 + 167 + int mode_setiv(const unsigned char *IV, unsigned long len, mode_context *ctx); 168 + int mode_getiv(const unsigned char *IV, unsigned long *len, mode_context *ctx); 169 + */ 170 + 171 + /* 172 + DES key utilities 173 + */ 174 + 175 + CCCryptorStatus CCDesIsWeakKey( 176 + void *key, 177 + size_t Length) 178 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 179 + 180 + void CCDesSetOddParity( 181 + void *key, 182 + size_t Length) 183 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 184 + 185 + uint32_t CCDesCBCCksum(void *input, void *output, 186 + size_t length, void *key, size_t keylen, 187 + void *ivec) 188 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 189 + 190 + 191 + 192 + #ifdef __cplusplus 193 + } 194 + #endif 195 + 196 + #endif /* _CC_CryptorSPI_H_ */
+58
src/CommonCrypto/CommonCrypto/CommonRandom.h
··· 1 + /* 2 + * Copyright (c) 2014 Apple Inc. All Rights Reserved. 3 + * 4 + * @APPLE_LICENSE_HEADER_START@ 5 + * 6 + * This file contains Original Code and/or Modifications of Original Code 7 + * as defined in and that are subject to the Apple Public Source License 8 + * Version 2.0 (the 'License'). You may not use this file except in 9 + * compliance with the License. Please obtain a copy of the License at 10 + * http://www.opensource.apple.com/apsl/ and read it before using this 11 + * file. 12 + * 13 + * The Original Code and all software distributed under the License are 14 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 + * Please see the License for the specific language governing rights and 19 + * limitations under the License. 20 + * 21 + * @APPLE_LICENSE_HEADER_END@ 22 + */ 23 + 24 + // 25 + // CommonRandom.h 26 + // CommonCrypto 27 + 28 + #ifndef CommonCrypto_CommonRandom_h 29 + #define CommonCrypto_CommonRandom_h 30 + 31 + #if defined(__cplusplus) 32 + extern "C" { 33 + #endif 34 + 35 + typedef CCCryptorStatus CCRNGStatus; 36 + 37 + /*! 38 + @function CCRandomGenerateBytes 39 + 40 + @abstract Return random bytes in a buffer allocated by the caller. 41 + 42 + @discussion The PRNG returns cryptographically strong random 43 + bits suitable for use as cryptographic keys, IVs, nonces etc. 44 + 45 + @param bytes Pointer to the return buffer. 46 + @param count Number of random bytes to return. 47 + 48 + @result Return kCCSuccess on success. 49 + */ 50 + 51 + CCRNGStatus CCRandomGenerateBytes(void *bytes, size_t count) 52 + __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0); 53 + 54 + #if defined(__cplusplus) 55 + } 56 + #endif 57 + 58 + #endif
+234
src/CommonCrypto/CommonCrypto/CommonRandomSPI.h
··· 1 + #ifndef COMMONRANDOM_H 2 + #define COMMONRANDOM_H 1 3 + 4 + /* 5 + * CommonRandom.h 6 + * 7 + * Copyright � 2010-2011 by Apple, Inc. All rights reserved. 8 + * 9 + * @APPLE_LICENSE_HEADER_START@ 10 + * 11 + * This file contains Original Code and/or Modifications of Original Code 12 + * as defined in and that are subject to the Apple Public Source License 13 + * Version 2.0 (the 'License'). You may not use this file except in 14 + * compliance with the License. Please obtain a copy of the License at 15 + * http://www.opensource.apple.com/apsl/ and read it before using this 16 + * file. 17 + * 18 + * The Original Code and all software distributed under the License are 19 + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 20 + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 21 + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 22 + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 23 + * Please see the License for the specific language governing rights and 24 + * limitations under the License. 25 + * 26 + * @APPLE_LICENSE_HEADER_END@ 27 + * 28 + */ 29 + 30 + #include <dispatch/dispatch.h> 31 + #include <dispatch/queue.h> 32 + #include <Availability.h> 33 + #include <stdint.h> 34 + #include <sys/types.h> 35 + #include <CommonCrypto/CommonCryptor.h> 36 + 37 + /*! 38 + 39 + @header CommonRNG.h 40 + @abstract An interface to a system random number generator. This module 41 + provides a managed way either to get random numbers from a 42 + NIST-approved random number generator or /dev/random. The NIST 43 + random number generator gets its entropy from /dev/random, but 44 + operates 9x-10x faster than it. 45 + 46 + @discussion It is inconvenient to call system random number generators 47 + directly. In the simple case of calling /dev/random, the caller 48 + has to open the device and close it in addition to managing it 49 + while it's open. This module has as its immediate raison d'�tre 50 + the inconvenience of doing this. It manages a file descriptor to 51 + /dev/random including the exception processing of what happens 52 + in a fork() and exec(). Call CCRandomCopyBytes() and all the 53 + fiddly bits are managed for you. Just get on with whatever you 54 + were really trying to do. 55 + 56 + More importantly, though, it also manages a FIPS 140-compliant 57 + way to get random numbers. NIST created in their document SP 58 + 800-90 a new type of AES-based "Deterministic Random Bit 59 + Generator" (DRBG) (what is often called a PRNG) and guidelines 60 + on how to use it. There are two reasons to prefer it over 61 + directly calling /dev/random. It's a standard and immediately 62 + compliant with FIPS 140, and it is dramatically faster per-byte. 63 + For complete disclosure, this implements an AES-CTR DRBG with 64 + derivation function using AES-128 as the cipher and prediction 65 + resistance. 66 + 67 + Thus, we provide two RNGs to call, kCCRandomDefault (the NIST 68 + one) and kCCRandomDevRandom (a managed wrapper around 69 + /dev/random). If you are doing anything involving security, call 70 + the default one. You'll be glad you did, because it does much 71 + security-related housekeeping for you and you don't have to 72 + think about it. Really. 73 + 74 + In implementation details, the first time you call 75 + CCRandomCopyBytes(), it will open up /dev/random and seed the RNG 76 + with 64 bytes. After each call, there is a reseed operation that 77 + happens on an async GCD queue that reseeds with 32 bytes and a 78 + nonce from mach_absolute_time(). All access to the internal DRBG 79 + is serialized through a GCD queue and is therefore thread safe. 80 + 81 + Should you need to create your own RNG context or have a secondary 82 + RNG context, CCRNGCreate() and CCRNGRelease() will let you create 83 + an RNG yourself and then call CCRandomCopyBytes() with that 84 + context. 85 + */ 86 + 87 + #include <CommonCrypto/CommonRandom.h> 88 + 89 + #if defined(__cplusplus) 90 + extern "C" { 91 + #endif 92 + 93 + /*! 94 + @typedef CCRandomRef 95 + @abstract Abstract Reference to a random number generator. 96 + 97 + */ 98 + #ifndef COMMONRANDOMPRIV_H // Check for the private header 99 + typedef struct __CCRandom *CCRandomRef; 100 + #endif 101 + 102 + /*! 103 + @function CCRandomCopyBytes 104 + 105 + @abstract Return random bytes in a buffer allocated by the caller. 106 + 107 + @discussion The default PRNG returns cryptographically strong random 108 + bits suitable for use as cryptographic keys, IVs, nonces etc. 109 + 110 + @param rnd The random number generator to use. Pre-defined values: 111 + kCCRandomDefault, the NIST AES-based one and 112 + kCCRandomDevRandom, /dev/random itself. 113 + 114 + Alternately, you can create one with CCRNGCreate(). 115 + 116 + @param bytes Pointer to the return buffer. 117 + @param count Number of random bytes to return. 118 + 119 + @result Return kCCSuccess on success. Other values are ... 120 + */ 121 + 122 + int CCRandomCopyBytes(CCRandomRef rnd, void *bytes, size_t count) 123 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 124 + 125 + extern const CCRandomRef kCCRandomDefault 126 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 127 + 128 + extern const CCRandomRef kCCRandomDevRandom 129 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 130 + 131 + /*! 132 + @function CCRNGCreate 133 + 134 + @abstract Create an RNG context. 135 + 136 + @discussion This creates a CCRandomRef that you can then pass into 137 + CCRandomCopyBytes(). Only call this if you need to create 138 + your own context. You can call CCRandomCopyBytes() with this 139 + context. Remember to release it. 140 + 141 + @param options Option flags. See below. Unless you have a very 142 + good reason, just use kCCRNGOptionCryptoRNG. 143 + 144 + @param rngRef A pointer to a CCRandomRef. 145 + 146 + @result Returns kCCSuccess on success. 147 + 148 + 149 + */ 150 + 151 + CCRNGStatus 152 + CCRNGCreate(uint32_t options, CCRandomRef *rngRef) 153 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 154 + 155 + /*! 156 + @function CCRNGRelease 157 + 158 + @abstract Release an RNG context. 159 + 160 + @discussion This releases and deallocates a context. 161 + 162 + @param rng A CCRandomRef. 163 + 164 + @result Returns kCCSuccess on success. 165 + 166 + 167 + */ 168 + 169 + CCRNGStatus 170 + CCRNGRelease(CCRandomRef rng) 171 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 172 + 173 + 174 + /* 175 + Options flags 176 + 177 + The option flags are not exposed through the default use of CCRandomGetBytes(). 178 + They are only exposed through direct use of a CCRandomRef. 179 + 180 + The polarity is reversed here for two reasons. One is that I want people to 181 + think before they make a non-FIPS, predictable RNG. If you're doing any sort of 182 + crypto, you want FIPS and you want prediction resistance. Prediction resistance 183 + reseeds after every query which is slightly slower, but more secure. Non-FIPS 184 + is about 20% faster for very large reads, where very large means well over a MB 185 + per get, which you will probably never do. If you pull under 500 bytes from the 186 + RNG, there is *NO* change in performance for non-FIPS. 187 + 188 + Non-FIPS makes two changes. First, it increments the counter in machine-natural 189 + order, which on little-endian machines makes a very small performance 190 + improvement. It saves you two byte-swaps for every 32-bit increment of the 191 + counter, for every int that has to be incremented, which is admittedly not 192 + much. It is so much not much that this is a compile-time option in the DRBG, 193 + and likely to be turned off. 194 + 195 + But something that makes a difference is that it reads from the DRBG in one 196 + lump sum, instead of in 500 byte chunks, as FIPS demands. On a 50MB test, runs 197 + about 20% faster, but obviously for 500 bytes would run the same. 198 + 199 + Arguably, we should remove the non-FIPS thing because in most circumstances it 200 + matters naught. Also, as we've said before, if you're interested in security, 201 + you shouldn't be worrying about a small performance tweaks. 202 + 203 + Prediction resistance re-seeds the DRBG after every request with 32 bytes from 204 + /dev/random and a timestamp from mach_absolute_time(). This is a legitimate 205 + thing you might want and a difference between a "random" and a "urandom" 206 + variant. 207 + 208 + */ 209 + 210 + enum { 211 + kCCRNGOptionIgnoreFIPS = 0x00000001, 212 + kCCRNGOptionNoPredictionResistance = 0x00000002, 213 + 214 + kCCRNGOptionCryptoRNG = 0x00000000, 215 + }; 216 + 217 + // Accessor functions to get the rng "states" for internal Security Framework 218 + // use. 219 + #include <corecrypto/ccdrbg.h> 220 + #include <corecrypto/ccrng_system.h> 221 + 222 + struct ccrng_state *ccDevRandomGetRngState(void) 223 + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); 224 + 225 + struct ccrng_state *ccDRBGGetRngState(void) 226 + __OSX_AVAILABLE_STARTING(__MAC_10_8, __IPHONE_6_0); 227 + 228 + 229 + #if defined(__cplusplus) 230 + } 231 + #endif 232 + 233 + #endif /* COMMONRANDOM_H */ 234 +
+109 -26
src/CommonCrypto/Source/CommonCryptoSPI/CommonDigestSPI.h
··· 24 24 #ifndef _CC_DigestSPI_H_ 25 25 #define _CC_DigestSPI_H_ 26 26 27 + #include <stdint.h> 28 + #include <sys/types.h> 29 + 27 30 #include <Availability.h> 31 + 28 32 #ifdef __cplusplus 29 33 extern "C" { 30 34 #endif 31 35 32 36 33 37 /*! 34 - @enum CCDigestAlg 38 + @enum CCDigestAlgorithm 35 39 @abstract Algorithms implemented in this module. 36 40 41 + @constant kCCDigestNone Digest Selector for "no digest" 37 42 @constant kCCDigestMD2 MD2 digest 38 43 @constant kCCDigestMD4 MD4 digest 39 44 @constant kCCDigestMD5 MD5 digest ··· 55 60 */ 56 61 57 62 enum { 63 + kCCDigestNone = 0, 58 64 kCCDigestMD2 = 1, 59 65 kCCDigestMD4 = 2, 60 66 kCCDigestMD5 = 3, ··· 67 73 kCCDigestSHA256 = 10, 68 74 kCCDigestSHA384 = 11, 69 75 kCCDigestSHA512 = 12, 70 - kCCDigestSkein128 = 13, 71 - kCCDigestSkein160 = 14, 72 - kCCDigestSkein224 = 16, 73 - kCCDigestSkein256 = 17, 74 - kCCDigestSkein384 = 18, 75 - kCCDigestSkein512 = 19, 76 + kCCDigestSkein128 = 13, // Deprecated in iPhoneOS 6.0 and MacOSX10.9 77 + kCCDigestSkein160 = 14, // Deprecated in iPhoneOS 6.0 and MacOSX10.9 78 + kCCDigestSkein224 = 16, // Deprecated in iPhoneOS 6.0 and MacOSX10.9 79 + kCCDigestSkein256 = 17, // Deprecated in iPhoneOS 6.0 and MacOSX10.9 80 + kCCDigestSkein384 = 18, // Deprecated in iPhoneOS 6.0 and MacOSX10.9 81 + kCCDigestSkein512 = 19, // Deprecated in iPhoneOS 6.0 and MacOSX10.9 76 82 }; 77 - typedef uint32_t CCDigestAlg; 83 + typedef uint32_t CCDigestAlgorithm; 84 + 85 + // Hold this until Heimdal has changed. 86 + 87 + #define CCDigestAlg CCDigestAlgorithm 78 88 79 89 /*! 80 90 @typedef CCDigestCtx ··· 86 96 uint8_t context[CC_DIGEST_SIZE]; 87 97 } CCDigestCtx, *CCDigestRef; 88 98 99 + #define CC_RMD128_DIGEST_LENGTH 16 /* digest length in bytes */ 100 + #define CC_RMD128_BLOCK_BYTES 64 /* block size in bytes */ 101 + #define CC_RMD128_BLOCK_LONG (CC_RMD128_BLOCK_BYTES / sizeof(CC_LONG)) 102 + 103 + #define CC_RMD160_DIGEST_LENGTH 20 /* digest length in bytes */ 104 + #define CC_RMD160_BLOCK_BYTES 64 /* block size in bytes */ 105 + #define CC_RMD160_BLOCK_LONG (CC_RMD160_BLOCK_BYTES / sizeof(CC_LONG)) 106 + 107 + #define CC_RMD256_DIGEST_LENGTH 32 /* digest length in bytes */ 108 + #define CC_RMD256_BLOCK_BYTES 64 /* block size in bytes */ 109 + #define CC_RMD256_BLOCK_LONG (CC_RMD256_BLOCK_BYTES / sizeof(CC_LONG)) 110 + 111 + #define CC_RMD320_DIGEST_LENGTH 40 /* digest length in bytes */ 112 + #define CC_RMD320_BLOCK_BYTES 64 /* block size in bytes */ 113 + #define CC_RMD320_BLOCK_LONG (CC_RMD320_BLOCK_BYTES / sizeof(CC_LONG)) 114 + 89 115 /**************************************************************************/ 90 116 /* SPI Only */ 91 117 /**************************************************************************/ ··· 108 134 */ 109 135 110 136 int 111 - CCDigestInit(CCDigestAlg algorithm, CCDigestRef ctx) 112 - __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 137 + CCDigestInit(CCDigestAlgorithm algorithm, CCDigestRef ctx) 138 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 139 + 113 140 114 141 115 142 /**************************************************************************/ ··· 134 161 */ 135 162 136 163 int 137 - CCDigest(CCDigestAlg algorithm, 164 + CCDigest(CCDigestAlgorithm algorithm, 138 165 const uint8_t *data, size_t length, uint8_t *output) 139 - __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 166 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 140 167 141 168 /*! 142 169 @function CCDigestCreate ··· 144 171 145 172 @param algorithm Digest algorithm to setup. 146 173 147 - returns 0 on success. 174 + returns a pointer to a digestRef on success. 148 175 */ 149 176 150 177 CCDigestRef 151 - CCDigestCreate(CCDigestAlg alg) 152 - __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 178 + CCDigestCreate(CCDigestAlgorithm alg) 179 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 153 180 154 181 /*! 155 182 @function CCDigestUpdate ··· 164 191 165 192 int 166 193 CCDigestUpdate(CCDigestRef ctx, const void *data, size_t length) 167 - __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 194 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 168 195 169 196 /*! 170 197 @function CCDigestFinal ··· 178 205 179 206 int 180 207 CCDigestFinal(CCDigestRef ctx, uint8_t *output) 181 - __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 208 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 182 209 /*! 183 210 @function CCDigestDestroy 184 211 @abstract Clear and free a CCDigestCtx ··· 189 216 190 217 void 191 218 CCDigestDestroy(CCDigestRef ctx) 192 - __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 219 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 193 220 194 221 /*! 195 222 @function CCDigestReset ··· 200 227 201 228 void 202 229 CCDigestReset(CCDigestRef ctx) 203 - __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 230 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 204 231 205 232 /*! 206 - @function CCDigestInterrimResult 233 + @function CCDigestRefGetDigest 207 234 @abstract Produce the digest output result for the bytes currently 208 235 processed. 209 236 ··· 214 241 */ 215 242 216 243 int 217 - CCDigestInterrimResult(CCDigestRef ctx, uint8_t *output) 218 - __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 244 + CCDigestGetDigest(CCDigestRef ctx, uint8_t *output) 245 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 219 246 220 247 /*! 221 - @function CCDigestBlockSize 248 + @function CCDigestGetBlockSize 249 + @abstract Provides the block size of the digest algorithm 250 + 251 + @param algorithm A digest algorithm selector. 252 + 253 + returns 0 on failure or the block size on success. 254 + */ 255 + 256 + size_t 257 + CCDigestGetBlockSize(CCDigestAlgorithm algorithm) 258 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 259 + 260 + 261 + 262 + /*! 263 + @function CCDigestGetOutputSize 264 + @abstract Provides the digest output size of the digest algorithm 265 + 266 + @param algorithm A digest algorithm selector. 267 + 268 + returns 0 on failure or the digest output size on success. 269 + */ 270 + 271 + size_t 272 + CCDigestGetOutputSize(CCDigestAlgorithm algorithm) 273 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 274 + 275 + /*! 276 + @function CCDigestGetBlockSizeFromRef 222 277 @abstract Provides the block size of the digest algorithm 223 278 224 279 @param ctx A digest context. ··· 227 282 */ 228 283 229 284 size_t 285 + CCDigestGetBlockSizeFromRef(CCDigestRef ctx) 286 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 287 + 288 + // Until Heimdal Changes 289 + // #define CCDigestBlockSize CCDigestGetBlockSizeFromRef 290 + size_t 230 291 CCDigestBlockSize(CCDigestRef ctx) 231 292 __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 232 - 293 + 233 294 /*! 234 - @function CCDigestOutputSize 295 + @function CCDigestGetOutputSizeFromRef 235 296 @abstract Provides the digest output size of the digest algorithm 236 297 237 298 @param ctx A digest context. ··· 240 301 */ 241 302 242 303 size_t 304 + CCDigestGetOutputSizeFromRef(CCDigestRef ctx) 305 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 306 + 307 + // Until Heimdal Changes 308 + // #define CCDigestOutputSize CCDigestGetOutputSizeFromRef 309 + size_t 243 310 CCDigestOutputSize(CCDigestRef ctx) 244 - __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA); 311 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 312 + 313 + 314 + 315 + uint8_t * 316 + CCDigestOID(CCDigestRef ctx) 317 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 318 + 319 + size_t 320 + CCDigestOIDLen(CCDigestRef ctx) 321 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 322 + 323 + CCDigestRef 324 + CCDigestCreateByOID(uint8_t *OID, size_t OIDlen) 325 + __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_5_0); 326 + 327 + 245 328 246 329 #ifdef __cplusplus 247 330 }
+6
src/kernel/emulation/linux/signal/sigaction.h
··· 57 57 typedef void (bsd_sig_handler)(int, struct bsd_siginfo*, void*); 58 58 typedef void (linux_sig_handler)(int, struct linux_siginfo*, void*); 59 59 60 + #ifndef SIG_DFL 60 61 #define SIG_DFL (bsd_sig_handler*)0 62 + #endif 63 + #ifndef SIG_IGN 61 64 #define SIG_IGN (bsd_sig_handler*)1 65 + #endif 66 + #ifndef SIG_ERR 62 67 #define SIG_ERR ((bsd_sig_handler*)-1l) 68 + #endif 63 69 64 70 struct bsd_sigaction 65 71 {
+1
src/libc/os/activity.h
··· 28 28 #include <stdint.h> 29 29 #include <stdbool.h> 30 30 #include <mach-o/loader.h> 31 + #include <MacTypes.h> 31 32 32 33 __BEGIN_DECLS 33 34
+2 -1
src/libsystem/CMakeLists.txt
··· 44 44 target_link_libraries(system PRIVATE system_malloc system_c system_kernel keymgr sandbox 45 45 system_m system_info system_notify system_quarantine libdispatch_shared launch compiler_rt 46 46 removefile system_copyfile unwind system_coreservices system_dyld macho CommonCrypto 47 - system_pthread platform system_asl system_duct system_blocks xpc) # objc 47 + system_pthread platform system_asl system_duct system_blocks xpc corecrypto) # objc 48 48 set_target_properties(system PROPERTIES OUTPUT_NAME "System.B") 49 49 set_property(TARGET system APPEND_STRING PROPERTY LINK_FLAGS 50 50 " -sub_library libsystem_malloc \ ··· 73 73 -sub_library libsystem_asl \ 74 74 -sub_library libdispatch \ 75 75 -sub_library libxpc \ 76 + -sub_library libcorecrypto \ 76 77 -Wl,-compatibility_version,1.0.0 \ 77 78 -Wl,-current_version,1238.0.0") 78 79