]> git.saurik.com Git - apple/security.git/blob - OSX/libsecurity_cryptkit/lib/platform.c
Security-59754.80.3.tar.gz
[apple/security.git] / OSX / libsecurity_cryptkit / lib / platform.c
1 /* Copyright (c) 1998,2011,2014 Apple Inc. All Rights Reserved.
2 *
3 * NOTICE: USE OF THE MATERIALS ACCOMPANYING THIS NOTICE IS SUBJECT
4 * TO THE TERMS OF THE SIGNED "FAST ELLIPTIC ENCRYPTION (FEE) REFERENCE
5 * SOURCE CODE EVALUATION AGREEMENT" BETWEEN APPLE, INC. AND THE
6 * ORIGINAL LICENSEE THAT OBTAINED THESE MATERIALS FROM APPLE,
7 * INC. ANY USE OF THESE MATERIALS NOT PERMITTED BY SUCH AGREEMENT WILL
8 * EXPOSE YOU TO LIABILITY.
9 ***************************************************************************
10 *
11 * platform.c - platform-dependent C functions
12 *
13 * Revision History
14 * ----------------
15 * 6 Sep 96 at NeXT
16 * Created.
17 */
18
19 #include "platform.h"
20 #include <stdio.h>
21 #include "feeDebug.h"
22
23 #import "feeDebug.h"
24
25 #if __MAC_BUILD__
26 /*
27 * Macintosh, all flavors.
28 */
29 #include <stdlib.h>
30 #include <CrashReporterClient.h>
31
32 void CKRaise(const char *reason) {
33 #if FEE_DEBUG
34 printf("CryptKit fatal error: %s\n", reason);
35 #endif
36 char * msg = NULL;
37 if(asprintf(&msg, "CryptKit fatal error: %s", reason)) {
38 CRSetCrashLogMessage(msg);
39 } else {
40 CRSetCrashLogMessage("CryptKit fatal error");
41 }
42 abort();
43 }
44
45 #else
46
47 #error platform-specific work needed in security_cryptkit/platform.c
48
49 #endif