#-------------------
include(pgosupport.cmake)
-add_subdirectory(src/libraries-native)
+#-------------------------------
+# Include libraries native shims
+#-------------------------------
+if(NOT CLR_CROSS_COMPONENTS_BUILD)
+ add_subdirectory(src/libraries-native)
+endif(NOT CLR_CROSS_COMPONENTS_BUILD)
#-----------------------------------------
# Add Projects
<linker>
<assembly fullname="System.Private.CoreLib">
+ <type fullname="Interop/Globalization">
+ <!-- Internal API used by tests only. -->
+ <method name="GetICUVersion" />
+ </type>
<type fullname="System.GC">
<!-- Methods are used to register and unregister frozen segments. They are private and experimental. -->
<method name="_RegisterFrozenSegment" />
gcinfo # Condition="'$(TargetCpu)'=='amd64' or '$(TargetCpu)' == 'arm' or '$(TargetCpu)' == 'arm64'"
ildbsymlib
utilcode
+ libraries-native
)
if(CLR_CMAKE_TARGET_WIN32)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(GLOBALIZATION_NATIVE_DIR ${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/System.Globalization.Native)
-if(CLR_CMAKE_HOST_UNIX AND NOT CLR_CROSS_COMPONENTS_BUILD)
- add_subdirectory(${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/System.Globalization.Native System.Globalization.Native)
+# Suppress exporting of the PAL APIs
+add_definitions(-DPALEXPORT=)
+
+if(CLR_CMAKE_HOST_UNIX)
+ include_directories("${CLR_REPO_ROOT_DIR}/src/libraries/Native/Unix/Common")
+ include_directories("${GLOBALIZATION_NATIVE_DIR}")
+
+ add_subdirectory(${GLOBALIZATION_NATIVE_DIR} System.Globalization.Native)
endif()
+
+add_library(libraries-native
+ STATIC
+ entrypoints.c
+)
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#ifdef TARGET_UNIX
+
+#include "pal_types.h"
+
+typedef uint16_t UChar;
+
+// Include System.Globalization.Native headers
+#include "pal_calendarData.h"
+#include "pal_casing.h"
+#include "pal_collation.h"
+#include "pal_locale.h"
+#include "pal_localeNumberData.h"
+#include "pal_localeStringData.h"
+#include "pal_icushim.h"
+#include "pal_idna.h"
+#include "pal_normalization.h"
+#include "pal_timeZoneInfo.h"
+#endif // TARGET_UNIX
+
+#define FCFuncStart(name) extern const void* name[]; const void* name[] = {
+#define FCFuncEnd() (void*)0x01 /* FCFuncFlag_EndOfArray */ };
+
+#define QCFuncElement(name,impl) \
+ (void*)0x8 /* FCFuncFlag_QCall */, (void*)(impl), (void*)name,
+
+#ifdef TARGET_UNIX
+FCFuncStart(gPalGlobalizationNative)
+ QCFuncElement("ChangeCase", GlobalizationNative_ChangeCase)
+ QCFuncElement("ChangeCaseInvariant", GlobalizationNative_ChangeCaseInvariant)
+ QCFuncElement("ChangeCaseTurkish", GlobalizationNative_ChangeCaseTurkish)
+ QCFuncElement("CloseSortHandle", GlobalizationNative_CloseSortHandle)
+ QCFuncElement("CompareString", GlobalizationNative_CompareString)
+ QCFuncElement("CompareStringOrdinalIgnoreCase", GlobalizationNative_CompareStringOrdinalIgnoreCase)
+ QCFuncElement("EndsWith", GlobalizationNative_EndsWith)
+ QCFuncElement("EnumCalendarInfo", GlobalizationNative_EnumCalendarInfo)
+ QCFuncElement("GetCalendarInfo", GlobalizationNative_GetCalendarInfo)
+ QCFuncElement("GetCalendars", GlobalizationNative_GetCalendars)
+ QCFuncElement("GetDefaultLocaleName", GlobalizationNative_GetDefaultLocaleName)
+ QCFuncElement("GetICUVersion", GlobalizationNative_GetICUVersion)
+ QCFuncElement("GetJapaneseEraStartDate", GlobalizationNative_GetJapaneseEraStartDate)
+ QCFuncElement("GetLatestJapaneseEra", GlobalizationNative_GetLatestJapaneseEra)
+ QCFuncElement("GetLocaleInfoGroupingSizes", GlobalizationNative_GetLocaleInfoGroupingSizes)
+ QCFuncElement("GetLocaleInfoInt", GlobalizationNative_GetLocaleInfoInt)
+ QCFuncElement("GetLocaleInfoString", GlobalizationNative_GetLocaleInfoString)
+ QCFuncElement("GetLocaleName", GlobalizationNative_GetLocaleName)
+ QCFuncElement("GetLocales", GlobalizationNative_GetLocales)
+ QCFuncElement("GetLocaleTimeFormat", GlobalizationNative_GetLocaleTimeFormat)
+ QCFuncElement("GetSortHandle", GlobalizationNative_GetSortHandle)
+ QCFuncElement("GetSortKey", GlobalizationNative_GetSortKey)
+ QCFuncElement("GetSortVersion", GlobalizationNative_GetSortVersion)
+ QCFuncElement("GetTimeZoneDisplayName", GlobalizationNative_GetTimeZoneDisplayName)
+ QCFuncElement("IndexOf", GlobalizationNative_IndexOf)
+ QCFuncElement("IndexOfOrdinalIgnoreCase", GlobalizationNative_IndexOfOrdinalIgnoreCase)
+ QCFuncElement("IsNormalized", GlobalizationNative_IsNormalized)
+ QCFuncElement("IsPredefinedLocale", GlobalizationNative_IsPredefinedLocale)
+ QCFuncElement("LastIndexOf", GlobalizationNative_LastIndexOf)
+ QCFuncElement("LoadICU", GlobalizationNative_LoadICU)
+ QCFuncElement("NormalizeString", GlobalizationNative_NormalizeString)
+ QCFuncElement("StartsWith", GlobalizationNative_StartsWith)
+ QCFuncElement("ToAscii", GlobalizationNative_ToAscii)
+ QCFuncElement("ToUnicode", GlobalizationNative_ToUnicode)
+FCFuncEnd()
+#endif // TARGET_UNIX
if (callConv == pmCallConvThiscall)
ndirectflags |= NDirectMethodDesc::kThisCall;
- if (pNMD->GetLoaderModule()->IsSystem() && strcmp(szLibName, "QCall") == 0)
+ if (pNMD->GetLoaderModule()->IsSystem() && (strcmp(szLibName, "QCall") == 0 || strcmp(szLibName, "System.Globalization.Native") == 0))
{
ndirectflags |= NDirectMethodDesc::kIsQCall;
}
FCClassElement("GC", "System", gGCInterfaceFuncs)
FCClassElement("GCHandle", "System.Runtime.InteropServices", gGCHandleFuncs)
FCClassElement("GCSettings", "System.Runtime", gGCSettingsFuncs)
+#ifdef TARGET_UNIX
+#ifndef CROSSGEN_COMPILE
+FCClassElement("Globalization", "", gPalGlobalizationNative)
+#endif
+#endif
#ifdef FEATURE_COMINTEROP
FCClassElement("IEnumerable", "System.Collections", gStdMngIEnumerableFuncs)
FCClassElement("IEnumerator", "System.Collections", gStdMngIEnumeratorFuncs)
};
const USHORT c_nMscorlibFieldDescriptions = NumItems(c_rgMscorlibFieldDescriptions) + 1;
-
-
-
-
///////////////////////////////////////////////////////////////////////////////
//
// ECalls
//
+// ECalls defined by libraries-native shims
+EXTERN_C const LPVOID gPalGlobalizationNative[];
+
// When compiling crossgen, we only need the target version of the ecall tables
#if !defined(CROSSGEN_COMPILE) || defined(CROSSGEN_MSCORLIB)
{
[DllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_LoadICU")]
internal static extern int LoadICU();
+
+ [DllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetICUVersion")]
+ internal static extern int GetICUVersion();
}
}
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using System.Reflection;
using System.Runtime.InteropServices;
using System.Xml.Linq;
private static Version GetICUVersion()
{
- if (IsWindows)
+ int version = 0;
+ Type interopGlobalization = Type.GetType("Interop+Globalization");
+ if (interopGlobalization != null)
{
- return new Version(0, 0, 0, 0);
- }
- else
- {
- int ver = libc.GlobalizationNative_GetICUVersion();
- return new Version( ver & 0xFF,
- (ver >> 8) & 0xFF,
- (ver >> 16) & 0xFF,
- ver >> 24);
+ MethodInfo methodInfo = interopGlobalization.GetMethod("GetICUVersion", BindingFlags.NonPublic | BindingFlags.Static);
+ if (methodInfo != null)
+ {
+ version = (int)methodInfo.Invoke(null, null);
+ }
}
+
+ return new Version( version & 0xFF,
+ (version >> 8) & 0xFF,
+ (version >> 16) & 0xFF,
+ version >> 24);
}
private static Version GetOSXProductVersion()
[DllImport("libc", CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr gnu_get_libc_version();
-
- [DllImport("System.Globalization.Native", SetLastError = true)]
- public static extern int GlobalizationNative_GetICUVersion();
}
}
}
#else
#include "pal_types.h"
#include "pal_compiler.h"
- #define FUNCTIONEXPORT DLLEXPORT
+ #define FUNCTIONEXPORT PALEXPORT
#define FUNCTIONCALLINGCONVENCTION
#endif
set(CMAKE_SHARED_LIBRARY_PREFIX "")
set(VERSION_FILE_PATH "${CMAKE_BINARY_DIR}/version.c")
-# We mark the function which needs exporting with DLLEXPORT
+# We mark the function which needs exporting with PALEXPORT
add_compile_options(-fvisibility=hidden)
add_compile_options(-Wno-format-nonliteral)
#define c_static_assert(e) c_static_assert_msg(e, "")
#endif
-#define DLLEXPORT __attribute__ ((__visibility__ ("default")))
+#ifndef PALEXPORT
+#define PALEXPORT __attribute__ ((__visibility__ ("default")))
+#endif // ifndef PALEXPORT
#include <string.h>
#include <strings.h>
+#include "pal_locale_internal.h"
+#include "pal_errors_internal.h"
#include "pal_calendarData.h"
#define GREGORIAN_NAME "gregorian"
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#pragma once
+
#include <stdlib.h>
-#include "pal_compiler.h"
#include "pal_locale.h"
+#include "pal_compiler.h"
#include "pal_errors.h"
/*
// the function pointer definition for the callback used in EnumCalendarInfo
typedef void (*EnumCalendarInfoCallback)(const UChar*, const void*);
-DLLEXPORT int32_t GlobalizationNative_GetCalendars(const UChar* localeName,
+PALEXPORT int32_t GlobalizationNative_GetCalendars(const UChar* localeName,
CalendarId* calendars,
int32_t calendarsCapacity);
-DLLEXPORT ResultCode GlobalizationNative_GetCalendarInfo(const UChar* localeName,
+PALEXPORT ResultCode GlobalizationNative_GetCalendarInfo(const UChar* localeName,
CalendarId calendarId,
CalendarDataType dataType,
UChar* result,
int32_t resultCapacity);
-DLLEXPORT int32_t GlobalizationNative_EnumCalendarInfo(EnumCalendarInfoCallback callback,
+PALEXPORT int32_t GlobalizationNative_EnumCalendarInfo(EnumCalendarInfoCallback callback,
const UChar* localeName,
CalendarId calendarId,
CalendarDataType dataType,
const void* context);
-DLLEXPORT int32_t GlobalizationNative_GetLatestJapaneseEra(void);
+PALEXPORT int32_t GlobalizationNative_GetLatestJapaneseEra(void);
-DLLEXPORT int32_t GlobalizationNative_GetJapaneseEraStartDate(int32_t era,
+PALEXPORT int32_t GlobalizationNative_GetJapaneseEraStartDate(int32_t era,
int32_t* startYear,
int32_t* startMonth,
int32_t* startDay);
#include <assert.h>
#include <stdint.h>
+#include "pal_icushim_internal.h"
#include "pal_casing.h"
-#include "pal_icushim.h"
// Workaround for warnings produced by U16_NEXT and U16_APPEND macro expansions
#pragma clang diagnostic push
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#include "pal_compiler.h"
#include "pal_locale.h"
+#include "pal_compiler.h"
-DLLEXPORT void GlobalizationNative_ChangeCase(const UChar* lpSrc,
+PALEXPORT void GlobalizationNative_ChangeCase(const UChar* lpSrc,
int32_t cwSrcLength,
UChar* lpDst,
int32_t cwDstLength,
int32_t bToUpper);
-DLLEXPORT void GlobalizationNative_ChangeCaseInvariant(const UChar* lpSrc,
+PALEXPORT void GlobalizationNative_ChangeCaseInvariant(const UChar* lpSrc,
int32_t cwSrcLength,
UChar* lpDst,
int32_t cwDstLength,
int32_t bToUpper);
-DLLEXPORT void GlobalizationNative_ChangeCaseTurkish(const UChar* lpSrc,
+PALEXPORT void GlobalizationNative_ChangeCaseTurkish(const UChar* lpSrc,
int32_t cwSrcLength,
UChar* lpDst,
int32_t cwDstLength,
#include <search.h>
#include <string.h>
+#include "pal_errors_internal.h"
#include "pal_collation.h"
c_static_assert_msg(UCOL_EQUAL == 0, "managed side requires 0 for equal strings");
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#include "pal_compiler.h"
+#pragma once
+
#include "pal_locale.h"
+#include "pal_compiler.h"
#include "pal_errors.h"
typedef struct SortHandle SortHandle;
-DLLEXPORT ResultCode GlobalizationNative_GetSortHandle(const char* lpLocaleName, SortHandle** ppSortHandle);
+PALEXPORT ResultCode GlobalizationNative_GetSortHandle(const char* lpLocaleName, SortHandle** ppSortHandle);
-DLLEXPORT void GlobalizationNative_CloseSortHandle(SortHandle* pSortHandle);
+PALEXPORT void GlobalizationNative_CloseSortHandle(SortHandle* pSortHandle);
-DLLEXPORT int32_t GlobalizationNative_GetSortVersion(SortHandle* pSortHandle);
+PALEXPORT int32_t GlobalizationNative_GetSortVersion(SortHandle* pSortHandle);
-DLLEXPORT int32_t GlobalizationNative_CompareString(SortHandle* pSortHandle,
+PALEXPORT int32_t GlobalizationNative_CompareString(SortHandle* pSortHandle,
const UChar* lpStr1,
int32_t cwStr1Length,
const UChar* lpStr2,
int32_t cwStr2Length,
int32_t options);
-DLLEXPORT int32_t GlobalizationNative_IndexOf(SortHandle* pSortHandle,
+PALEXPORT int32_t GlobalizationNative_IndexOf(SortHandle* pSortHandle,
const UChar* lpTarget,
int32_t cwTargetLength,
const UChar* lpSource,
int32_t options,
int32_t* pMatchedLength);
-DLLEXPORT int32_t GlobalizationNative_LastIndexOf(SortHandle* pSortHandle,
+PALEXPORT int32_t GlobalizationNative_LastIndexOf(SortHandle* pSortHandle,
const UChar* lpTarget,
int32_t cwTargetLength,
const UChar* lpSource,
int32_t cwSourceLength,
int32_t options);
-DLLEXPORT int32_t GlobalizationNative_IndexOfOrdinalIgnoreCase(const UChar* lpTarget,
+PALEXPORT int32_t GlobalizationNative_IndexOfOrdinalIgnoreCase(const UChar* lpTarget,
int32_t cwTargetLength,
const UChar* lpSource,
int32_t cwSourceLength,
int32_t findLast);
-DLLEXPORT int32_t GlobalizationNative_StartsWith(SortHandle* pSortHandle,
+PALEXPORT int32_t GlobalizationNative_StartsWith(SortHandle* pSortHandle,
const UChar* lpTarget,
int32_t cwTargetLength,
const UChar* lpSource,
int32_t cwSourceLength,
int32_t options);
-DLLEXPORT int32_t GlobalizationNative_EndsWith(SortHandle* pSortHandle,
+PALEXPORT int32_t GlobalizationNative_EndsWith(SortHandle* pSortHandle,
const UChar* lpTarget,
int32_t cwTargetLength,
const UChar* lpSource,
int32_t cwSourceLength,
int32_t options);
-DLLEXPORT int32_t GlobalizationNative_GetSortKey(SortHandle* pSortHandle,
+PALEXPORT int32_t GlobalizationNative_GetSortKey(SortHandle* pSortHandle,
const UChar* lpStr,
int32_t cwStrLength,
uint8_t* sortKey,
int32_t cbSortKeyLength,
int32_t options);
-DLLEXPORT int32_t GlobalizationNative_CompareStringOrdinalIgnoreCase(const UChar* lpStr1,
+PALEXPORT int32_t GlobalizationNative_CompareStringOrdinalIgnoreCase(const UChar* lpStr1,
int32_t cwStr1Length,
const UChar* lpStr2,
int32_t cwStr2Length);
#pragma once
-#include "pal_compiler.h"
-
/*
* These values should be kept in sync with
* Interop.GlobalizationInterop.ResultCode
InsufficentBuffer = 2,
OutOfMemory = 3
} ResultCode;
-
-/*
-Converts a UErrorCode to a ResultCode.
-*/
-static ResultCode GetResultCode(UErrorCode err)
-{
- if (err == U_BUFFER_OVERFLOW_ERROR || err == U_STRING_NOT_TERMINATED_WARNING)
- {
- return InsufficentBuffer;
- }
-
- if (err == U_MEMORY_ALLOCATION_ERROR)
- {
- return OutOfMemory;
- }
-
- if (U_SUCCESS(err))
- {
- return Success;
- }
-
- return UnknownError;
-}
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#pragma once
+
+#include "pal_icushim_internal.h"
+#include "pal_errors.h"
+
+/*
+Converts a UErrorCode to a ResultCode.
+*/
+static ResultCode GetResultCode(UErrorCode err)
+{
+ if (err == U_BUFFER_OVERFLOW_ERROR || err == U_STRING_NOT_TERMINATED_WARNING)
+ {
+ return InsufficentBuffer;
+ }
+
+ if (err == U_MEMORY_ALLOCATION_ERROR)
+ {
+ return OutOfMemory;
+ }
+
+ if (U_SUCCESS(err))
+ {
+ return Success;
+ }
+
+ return UnknownError;
+}
#include <string.h>
#include <assert.h>
+#include "pal_icushim_internal.h"
#include "pal_icushim.h"
// Define pointers to all the used ICU functions
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-// See the LICENSE file in the project root for more information.
-//
-
-// Enable calling ICU functions through shims to enable support for
-// multiple versions of ICU.
#pragma once
-#include "config.h"
#include "pal_compiler.h"
-#define U_DISABLE_RENAMING 1
-
-// All ICU headers need to be included here so that all function prototypes are
-// available before the function pointers are declared below.
-#include <unicode/ucurr.h>
-#include <unicode/ucal.h>
-#include <unicode/uchar.h>
-#include <unicode/ucol.h>
-#include <unicode/udat.h>
-#include <unicode/udatpg.h>
-#include <unicode/uenum.h>
-#include <unicode/uidna.h>
-#include <unicode/uldnames.h>
-#include <unicode/ulocdata.h>
-#include <unicode/unorm2.h>
-#include <unicode/unum.h>
-#include <unicode/ures.h>
-#include <unicode/usearch.h>
-#include <unicode/utf16.h>
-#include <unicode/utypes.h>
-#include <unicode/urename.h>
-#include <unicode/ustring.h>
-
-// List of all functions from the ICU libraries that are used in the System.Globalization.Native.so
-#define FOR_ALL_UNCONDITIONAL_ICU_FUNCTIONS \
- PER_FUNCTION_BLOCK(u_charsToUChars, libicuuc) \
- PER_FUNCTION_BLOCK(u_getVersion, libicuuc) \
- PER_FUNCTION_BLOCK(u_strlen, libicuuc) \
- PER_FUNCTION_BLOCK(u_strncpy, libicuuc) \
- PER_FUNCTION_BLOCK(u_tolower, libicuuc) \
- PER_FUNCTION_BLOCK(u_toupper, libicuuc) \
- PER_FUNCTION_BLOCK(ucal_add, libicui18n) \
- PER_FUNCTION_BLOCK(ucal_close, libicui18n) \
- PER_FUNCTION_BLOCK(ucal_get, libicui18n) \
- PER_FUNCTION_BLOCK(ucal_getAttribute, libicui18n) \
- PER_FUNCTION_BLOCK(ucal_getKeywordValuesForLocale, libicui18n) \
- PER_FUNCTION_BLOCK(ucal_getLimit, libicui18n) \
- PER_FUNCTION_BLOCK(ucal_getTimeZoneDisplayName, libicui18n) \
- PER_FUNCTION_BLOCK(ucal_open, libicui18n) \
- PER_FUNCTION_BLOCK(ucal_set, libicui18n) \
- PER_FUNCTION_BLOCK(ucol_close, libicui18n) \
- PER_FUNCTION_BLOCK(ucol_closeElements, libicui18n) \
- PER_FUNCTION_BLOCK(ucol_getRules, libicui18n) \
- PER_FUNCTION_BLOCK(ucol_getSortKey, libicui18n) \
- PER_FUNCTION_BLOCK(ucol_getStrength, libicui18n) \
- PER_FUNCTION_BLOCK(ucol_getVersion, libicui18n) \
- PER_FUNCTION_BLOCK(ucol_next, libicui18n) \
- PER_FUNCTION_BLOCK(ucol_previous, libicui18n) \
- PER_FUNCTION_BLOCK(ucol_open, libicui18n) \
- PER_FUNCTION_BLOCK(ucol_openElements, libicui18n) \
- PER_FUNCTION_BLOCK(ucol_openRules, libicui18n) \
- PER_FUNCTION_BLOCK(ucol_safeClone, libicui18n) \
- PER_FUNCTION_BLOCK(ucol_setAttribute, libicui18n) \
- PER_FUNCTION_BLOCK(ucol_strcoll, libicui18n) \
- PER_FUNCTION_BLOCK(ucurr_forLocale, libicui18n) \
- PER_FUNCTION_BLOCK(ucurr_getName, libicui18n) \
- PER_FUNCTION_BLOCK(udat_close, libicui18n) \
- PER_FUNCTION_BLOCK(udat_countSymbols, libicui18n) \
- PER_FUNCTION_BLOCK(udat_getSymbols, libicui18n) \
- PER_FUNCTION_BLOCK(udat_open, libicui18n) \
- PER_FUNCTION_BLOCK(udat_setCalendar, libicui18n) \
- PER_FUNCTION_BLOCK(udat_toPattern, libicui18n) \
- PER_FUNCTION_BLOCK(udatpg_close, libicui18n) \
- PER_FUNCTION_BLOCK(udatpg_getBestPattern, libicui18n) \
- PER_FUNCTION_BLOCK(udatpg_open, libicui18n) \
- PER_FUNCTION_BLOCK(uenum_close, libicuuc) \
- PER_FUNCTION_BLOCK(uenum_count, libicuuc) \
- PER_FUNCTION_BLOCK(uenum_next, libicuuc) \
- PER_FUNCTION_BLOCK(uidna_close, libicuuc) \
- PER_FUNCTION_BLOCK(uidna_nameToASCII, libicuuc) \
- PER_FUNCTION_BLOCK(uidna_nameToUnicode, libicuuc) \
- PER_FUNCTION_BLOCK(uidna_openUTS46, libicuuc) \
- PER_FUNCTION_BLOCK(uldn_close, libicui18n) \
- PER_FUNCTION_BLOCK(uldn_keyValueDisplayName, libicui18n) \
- PER_FUNCTION_BLOCK(uldn_open, libicui18n) \
- PER_FUNCTION_BLOCK(uloc_canonicalize, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_countAvailable, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_getAvailable, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_getBaseName, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_getCharacterOrientation, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_getCountry, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_getDefault, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_getDisplayCountry, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_getDisplayLanguage, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_getDisplayName, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_getISO3Country, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_getISO3Language, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_getKeywordValue, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_getLanguage, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_getLCID, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_getName, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_getParent, libicuuc) \
- PER_FUNCTION_BLOCK(uloc_setKeywordValue, libicuuc) \
- PER_FUNCTION_BLOCK(ulocdata_getMeasurementSystem, libicui18n) \
- PER_FUNCTION_BLOCK(unorm2_getNFCInstance, libicuuc) \
- PER_FUNCTION_BLOCK(unorm2_getNFDInstance, libicuuc) \
- PER_FUNCTION_BLOCK(unorm2_getNFKCInstance, libicuuc) \
- PER_FUNCTION_BLOCK(unorm2_getNFKDInstance, libicuuc) \
- PER_FUNCTION_BLOCK(unorm2_isNormalized, libicuuc) \
- PER_FUNCTION_BLOCK(unorm2_normalize, libicuuc) \
- PER_FUNCTION_BLOCK(unum_close, libicui18n) \
- PER_FUNCTION_BLOCK(unum_getAttribute, libicui18n) \
- PER_FUNCTION_BLOCK(unum_getSymbol, libicui18n) \
- PER_FUNCTION_BLOCK(unum_open, libicui18n) \
- PER_FUNCTION_BLOCK(unum_toPattern, libicui18n) \
- PER_FUNCTION_BLOCK(ures_close, libicuuc) \
- PER_FUNCTION_BLOCK(ures_getByKey, libicuuc) \
- PER_FUNCTION_BLOCK(ures_getSize, libicuuc) \
- PER_FUNCTION_BLOCK(ures_getStringByIndex, libicuuc) \
- PER_FUNCTION_BLOCK(ures_open, libicuuc) \
- PER_FUNCTION_BLOCK(usearch_close, libicui18n) \
- PER_FUNCTION_BLOCK(usearch_first, libicui18n) \
- PER_FUNCTION_BLOCK(usearch_getMatchedLength, libicui18n) \
- PER_FUNCTION_BLOCK(usearch_last, libicui18n) \
- PER_FUNCTION_BLOCK(usearch_openFromCollator, libicui18n)
-
-#if HAVE_SET_MAX_VARIABLE
-#define FOR_ALL_ICU_FUNCTIONS \
- FOR_ALL_UNCONDITIONAL_ICU_FUNCTIONS \
- PER_FUNCTION_BLOCK(ucol_setMaxVariable, libicui18n)
-#else
-#define FOR_ALL_ICU_FUNCTIONS \
- FOR_ALL_UNCONDITIONAL_ICU_FUNCTIONS \
- PER_FUNCTION_BLOCK(ucol_setVariableTop, libicui18n)
-#endif
-
-// Declare pointers to all the used ICU functions
-#define PER_FUNCTION_BLOCK(fn, lib) extern __typeof(fn)* fn##_ptr;
-FOR_ALL_ICU_FUNCTIONS
-#undef PER_FUNCTION_BLOCK
-
-// Redefine all calls to ICU functions as calls through pointers that are set
-// to the functions of the selected version of ICU in the initialization.
-#define u_charsToUChars(...) u_charsToUChars_ptr(__VA_ARGS__)
-#define u_getVersion(...) u_getVersion_ptr(__VA_ARGS__)
-#define u_strlen(...) u_strlen_ptr(__VA_ARGS__)
-#define u_strncpy(...) u_strncpy_ptr(__VA_ARGS__)
-#define u_tolower(...) u_tolower_ptr(__VA_ARGS__)
-#define u_toupper(...) u_toupper_ptr(__VA_ARGS__)
-#define ucal_add(...) ucal_add_ptr(__VA_ARGS__)
-#define ucal_close(...) ucal_close_ptr(__VA_ARGS__)
-#define ucal_get(...) ucal_get_ptr(__VA_ARGS__)
-#define ucal_getAttribute(...) ucal_getAttribute_ptr(__VA_ARGS__)
-#define ucal_getKeywordValuesForLocale(...) ucal_getKeywordValuesForLocale_ptr(__VA_ARGS__)
-#define ucal_getLimit(...) ucal_getLimit_ptr(__VA_ARGS__)
-#define ucal_getTimeZoneDisplayName(...) ucal_getTimeZoneDisplayName_ptr(__VA_ARGS__)
-#define ucal_open(...) ucal_open_ptr(__VA_ARGS__)
-#define ucal_set(...) ucal_set_ptr(__VA_ARGS__)
-#define ucol_close(...) ucol_close_ptr(__VA_ARGS__)
-#define ucol_closeElements(...) ucol_closeElements_ptr(__VA_ARGS__)
-#define ucol_getRules(...) ucol_getRules_ptr(__VA_ARGS__)
-#define ucol_getSortKey(...) ucol_getSortKey_ptr(__VA_ARGS__)
-#define ucol_getStrength(...) ucol_getStrength_ptr(__VA_ARGS__)
-#define ucol_getVersion(...) ucol_getVersion_ptr(__VA_ARGS__)
-#define ucol_next(...) ucol_next_ptr(__VA_ARGS__)
-#define ucol_previous(...) ucol_previous_ptr(__VA_ARGS__)
-#define ucol_open(...) ucol_open_ptr(__VA_ARGS__)
-#define ucol_openElements(...) ucol_openElements_ptr(__VA_ARGS__)
-#define ucol_openRules(...) ucol_openRules_ptr(__VA_ARGS__)
-#define ucol_safeClone(...) ucol_safeClone_ptr(__VA_ARGS__)
-#define ucol_setAttribute(...) ucol_setAttribute_ptr(__VA_ARGS__)
-#if HAVE_SET_MAX_VARIABLE
-#define ucol_setMaxVariable(...) ucol_setMaxVariable_ptr(__VA_ARGS__)
-#else
-#define ucol_setVariableTop(...) ucol_setVariableTop_ptr(__VA_ARGS__)
-#endif
-#define ucol_strcoll(...) ucol_strcoll_ptr(__VA_ARGS__)
-#define ucurr_forLocale(...) ucurr_forLocale_ptr(__VA_ARGS__)
-#define ucurr_getName(...) ucurr_getName_ptr(__VA_ARGS__)
-#define udat_close(...) udat_close_ptr(__VA_ARGS__)
-#define udat_countSymbols(...) udat_countSymbols_ptr(__VA_ARGS__)
-#define udat_getSymbols(...) udat_getSymbols_ptr(__VA_ARGS__)
-#define udat_open(...) udat_open_ptr(__VA_ARGS__)
-#define udat_setCalendar(...) udat_setCalendar_ptr(__VA_ARGS__)
-#define udat_toPattern(...) udat_toPattern_ptr(__VA_ARGS__)
-#define udatpg_close(...) udatpg_close_ptr(__VA_ARGS__)
-#define udatpg_getBestPattern(...) udatpg_getBestPattern_ptr(__VA_ARGS__)
-#define udatpg_open(...) udatpg_open_ptr(__VA_ARGS__)
-#define uenum_close(...) uenum_close_ptr(__VA_ARGS__)
-#define uenum_count(...) uenum_count_ptr(__VA_ARGS__)
-#define uenum_next(...) uenum_next_ptr(__VA_ARGS__)
-#define uidna_close(...) uidna_close_ptr(__VA_ARGS__)
-#define uidna_nameToASCII(...) uidna_nameToASCII_ptr(__VA_ARGS__)
-#define uidna_nameToUnicode(...) uidna_nameToUnicode_ptr(__VA_ARGS__)
-#define uidna_openUTS46(...) uidna_openUTS46_ptr(__VA_ARGS__)
-#define uldn_close(...) uldn_close_ptr(__VA_ARGS__)
-#define uldn_keyValueDisplayName(...) uldn_keyValueDisplayName_ptr(__VA_ARGS__)
-#define uldn_open(...) uldn_open_ptr(__VA_ARGS__)
-#define uloc_canonicalize(...) uloc_canonicalize_ptr(__VA_ARGS__)
-#define uloc_countAvailable(...) uloc_countAvailable_ptr(__VA_ARGS__)
-#define uloc_getAvailable(...) uloc_getAvailable_ptr(__VA_ARGS__)
-#define uloc_getBaseName(...) uloc_getBaseName_ptr(__VA_ARGS__)
-#define uloc_getCharacterOrientation(...) uloc_getCharacterOrientation_ptr(__VA_ARGS__)
-#define uloc_getCountry(...) uloc_getCountry_ptr(__VA_ARGS__)
-#define uloc_getDefault(...) uloc_getDefault_ptr(__VA_ARGS__)
-#define uloc_getDisplayCountry(...) uloc_getDisplayCountry_ptr(__VA_ARGS__)
-#define uloc_getDisplayLanguage(...) uloc_getDisplayLanguage_ptr(__VA_ARGS__)
-#define uloc_getDisplayName(...) uloc_getDisplayName_ptr(__VA_ARGS__)
-#define uloc_getISO3Country(...) uloc_getISO3Country_ptr(__VA_ARGS__)
-#define uloc_getISO3Language(...) uloc_getISO3Language_ptr(__VA_ARGS__)
-#define uloc_getKeywordValue(...) uloc_getKeywordValue_ptr(__VA_ARGS__)
-#define uloc_getLanguage(...) uloc_getLanguage_ptr(__VA_ARGS__)
-#define uloc_getLCID(...) uloc_getLCID_ptr(__VA_ARGS__)
-#define uloc_getName(...) uloc_getName_ptr(__VA_ARGS__)
-#define uloc_getParent(...) uloc_getParent_ptr(__VA_ARGS__)
-#define uloc_setKeywordValue(...) uloc_setKeywordValue_ptr(__VA_ARGS__)
-#define ulocdata_getMeasurementSystem(...) ulocdata_getMeasurementSystem_ptr(__VA_ARGS__)
-#define unorm2_getNFCInstance(...) unorm2_getNFCInstance_ptr(__VA_ARGS__)
-#define unorm2_getNFDInstance(...) unorm2_getNFDInstance_ptr(__VA_ARGS__)
-#define unorm2_getNFKCInstance(...) unorm2_getNFKCInstance_ptr(__VA_ARGS__)
-#define unorm2_getNFKDInstance(...) unorm2_getNFKDInstance_ptr(__VA_ARGS__)
-#define unorm2_isNormalized(...) unorm2_isNormalized_ptr(__VA_ARGS__)
-#define unorm2_normalize(...) unorm2_normalize_ptr(__VA_ARGS__)
-#define unum_close(...) unum_close_ptr(__VA_ARGS__)
-#define unum_getAttribute(...) unum_getAttribute_ptr(__VA_ARGS__)
-#define unum_getSymbol(...) unum_getSymbol_ptr(__VA_ARGS__)
-#define unum_open(...) unum_open_ptr(__VA_ARGS__)
-#define unum_toPattern(...) unum_toPattern_ptr(__VA_ARGS__)
-#define ures_close(...) ures_close_ptr(__VA_ARGS__)
-#define ures_getByKey(...) ures_getByKey_ptr(__VA_ARGS__)
-#define ures_getSize(...) ures_getSize_ptr(__VA_ARGS__)
-#define ures_getStringByIndex(...) ures_getStringByIndex_ptr(__VA_ARGS__)
-#define ures_open(...) ures_open_ptr(__VA_ARGS__)
-#define usearch_close(...) usearch_close_ptr(__VA_ARGS__)
-#define usearch_first(...) usearch_first_ptr(__VA_ARGS__)
-#define usearch_getMatchedLength(...) usearch_getMatchedLength_ptr(__VA_ARGS__)
-#define usearch_last(...) usearch_last_ptr(__VA_ARGS__)
-#define usearch_openFromCollator(...) usearch_openFromCollator_ptr(__VA_ARGS__)
-
-DLLEXPORT int32_t GlobalizationNative_LoadICU(void);
+PALEXPORT int32_t GlobalizationNative_LoadICU(void);
-DLLEXPORT int32_t GlobalizationNative_GetICUVersion(void);
+PALEXPORT int32_t GlobalizationNative_GetICUVersion(void);
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+//
+
+// Enable calling ICU functions through shims to enable support for
+// multiple versions of ICU.
+
+#pragma once
+
+#include "config.h"
+
+#define U_DISABLE_RENAMING 1
+
+// All ICU headers need to be included here so that all function prototypes are
+// available before the function pointers are declared below.
+#include <unicode/ucurr.h>
+#include <unicode/ucal.h>
+#include <unicode/uchar.h>
+#include <unicode/ucol.h>
+#include <unicode/udat.h>
+#include <unicode/udatpg.h>
+#include <unicode/uenum.h>
+#include <unicode/uidna.h>
+#include <unicode/uldnames.h>
+#include <unicode/ulocdata.h>
+#include <unicode/unorm2.h>
+#include <unicode/unum.h>
+#include <unicode/ures.h>
+#include <unicode/usearch.h>
+#include <unicode/utf16.h>
+#include <unicode/utypes.h>
+#include <unicode/urename.h>
+#include <unicode/ustring.h>
+
+// List of all functions from the ICU libraries that are used in the System.Globalization.Native.so
+#define FOR_ALL_UNCONDITIONAL_ICU_FUNCTIONS \
+ PER_FUNCTION_BLOCK(u_charsToUChars, libicuuc) \
+ PER_FUNCTION_BLOCK(u_getVersion, libicuuc) \
+ PER_FUNCTION_BLOCK(u_strlen, libicuuc) \
+ PER_FUNCTION_BLOCK(u_strncpy, libicuuc) \
+ PER_FUNCTION_BLOCK(u_tolower, libicuuc) \
+ PER_FUNCTION_BLOCK(u_toupper, libicuuc) \
+ PER_FUNCTION_BLOCK(ucal_add, libicui18n) \
+ PER_FUNCTION_BLOCK(ucal_close, libicui18n) \
+ PER_FUNCTION_BLOCK(ucal_get, libicui18n) \
+ PER_FUNCTION_BLOCK(ucal_getAttribute, libicui18n) \
+ PER_FUNCTION_BLOCK(ucal_getKeywordValuesForLocale, libicui18n) \
+ PER_FUNCTION_BLOCK(ucal_getLimit, libicui18n) \
+ PER_FUNCTION_BLOCK(ucal_getTimeZoneDisplayName, libicui18n) \
+ PER_FUNCTION_BLOCK(ucal_open, libicui18n) \
+ PER_FUNCTION_BLOCK(ucal_set, libicui18n) \
+ PER_FUNCTION_BLOCK(ucol_close, libicui18n) \
+ PER_FUNCTION_BLOCK(ucol_closeElements, libicui18n) \
+ PER_FUNCTION_BLOCK(ucol_getRules, libicui18n) \
+ PER_FUNCTION_BLOCK(ucol_getSortKey, libicui18n) \
+ PER_FUNCTION_BLOCK(ucol_getStrength, libicui18n) \
+ PER_FUNCTION_BLOCK(ucol_getVersion, libicui18n) \
+ PER_FUNCTION_BLOCK(ucol_next, libicui18n) \
+ PER_FUNCTION_BLOCK(ucol_previous, libicui18n) \
+ PER_FUNCTION_BLOCK(ucol_open, libicui18n) \
+ PER_FUNCTION_BLOCK(ucol_openElements, libicui18n) \
+ PER_FUNCTION_BLOCK(ucol_openRules, libicui18n) \
+ PER_FUNCTION_BLOCK(ucol_safeClone, libicui18n) \
+ PER_FUNCTION_BLOCK(ucol_setAttribute, libicui18n) \
+ PER_FUNCTION_BLOCK(ucol_strcoll, libicui18n) \
+ PER_FUNCTION_BLOCK(ucurr_forLocale, libicui18n) \
+ PER_FUNCTION_BLOCK(ucurr_getName, libicui18n) \
+ PER_FUNCTION_BLOCK(udat_close, libicui18n) \
+ PER_FUNCTION_BLOCK(udat_countSymbols, libicui18n) \
+ PER_FUNCTION_BLOCK(udat_getSymbols, libicui18n) \
+ PER_FUNCTION_BLOCK(udat_open, libicui18n) \
+ PER_FUNCTION_BLOCK(udat_setCalendar, libicui18n) \
+ PER_FUNCTION_BLOCK(udat_toPattern, libicui18n) \
+ PER_FUNCTION_BLOCK(udatpg_close, libicui18n) \
+ PER_FUNCTION_BLOCK(udatpg_getBestPattern, libicui18n) \
+ PER_FUNCTION_BLOCK(udatpg_open, libicui18n) \
+ PER_FUNCTION_BLOCK(uenum_close, libicuuc) \
+ PER_FUNCTION_BLOCK(uenum_count, libicuuc) \
+ PER_FUNCTION_BLOCK(uenum_next, libicuuc) \
+ PER_FUNCTION_BLOCK(uidna_close, libicuuc) \
+ PER_FUNCTION_BLOCK(uidna_nameToASCII, libicuuc) \
+ PER_FUNCTION_BLOCK(uidna_nameToUnicode, libicuuc) \
+ PER_FUNCTION_BLOCK(uidna_openUTS46, libicuuc) \
+ PER_FUNCTION_BLOCK(uldn_close, libicui18n) \
+ PER_FUNCTION_BLOCK(uldn_keyValueDisplayName, libicui18n) \
+ PER_FUNCTION_BLOCK(uldn_open, libicui18n) \
+ PER_FUNCTION_BLOCK(uloc_canonicalize, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_countAvailable, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_getAvailable, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_getBaseName, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_getCharacterOrientation, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_getCountry, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_getDefault, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_getDisplayCountry, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_getDisplayLanguage, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_getDisplayName, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_getISO3Country, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_getISO3Language, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_getKeywordValue, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_getLanguage, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_getLCID, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_getName, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_getParent, libicuuc) \
+ PER_FUNCTION_BLOCK(uloc_setKeywordValue, libicuuc) \
+ PER_FUNCTION_BLOCK(ulocdata_getMeasurementSystem, libicui18n) \
+ PER_FUNCTION_BLOCK(unorm2_getNFCInstance, libicuuc) \
+ PER_FUNCTION_BLOCK(unorm2_getNFDInstance, libicuuc) \
+ PER_FUNCTION_BLOCK(unorm2_getNFKCInstance, libicuuc) \
+ PER_FUNCTION_BLOCK(unorm2_getNFKDInstance, libicuuc) \
+ PER_FUNCTION_BLOCK(unorm2_isNormalized, libicuuc) \
+ PER_FUNCTION_BLOCK(unorm2_normalize, libicuuc) \
+ PER_FUNCTION_BLOCK(unum_close, libicui18n) \
+ PER_FUNCTION_BLOCK(unum_getAttribute, libicui18n) \
+ PER_FUNCTION_BLOCK(unum_getSymbol, libicui18n) \
+ PER_FUNCTION_BLOCK(unum_open, libicui18n) \
+ PER_FUNCTION_BLOCK(unum_toPattern, libicui18n) \
+ PER_FUNCTION_BLOCK(ures_close, libicuuc) \
+ PER_FUNCTION_BLOCK(ures_getByKey, libicuuc) \
+ PER_FUNCTION_BLOCK(ures_getSize, libicuuc) \
+ PER_FUNCTION_BLOCK(ures_getStringByIndex, libicuuc) \
+ PER_FUNCTION_BLOCK(ures_open, libicuuc) \
+ PER_FUNCTION_BLOCK(usearch_close, libicui18n) \
+ PER_FUNCTION_BLOCK(usearch_first, libicui18n) \
+ PER_FUNCTION_BLOCK(usearch_getMatchedLength, libicui18n) \
+ PER_FUNCTION_BLOCK(usearch_last, libicui18n) \
+ PER_FUNCTION_BLOCK(usearch_openFromCollator, libicui18n)
+
+#if HAVE_SET_MAX_VARIABLE
+#define FOR_ALL_ICU_FUNCTIONS \
+ FOR_ALL_UNCONDITIONAL_ICU_FUNCTIONS \
+ PER_FUNCTION_BLOCK(ucol_setMaxVariable, libicui18n)
+#else
+#define FOR_ALL_ICU_FUNCTIONS \
+ FOR_ALL_UNCONDITIONAL_ICU_FUNCTIONS \
+ PER_FUNCTION_BLOCK(ucol_setVariableTop, libicui18n)
+#endif
+
+// Declare pointers to all the used ICU functions
+#define PER_FUNCTION_BLOCK(fn, lib) extern __typeof(fn)* fn##_ptr;
+FOR_ALL_ICU_FUNCTIONS
+#undef PER_FUNCTION_BLOCK
+
+// Redefine all calls to ICU functions as calls through pointers that are set
+// to the functions of the selected version of ICU in the initialization.
+#define u_charsToUChars(...) u_charsToUChars_ptr(__VA_ARGS__)
+#define u_getVersion(...) u_getVersion_ptr(__VA_ARGS__)
+#define u_strlen(...) u_strlen_ptr(__VA_ARGS__)
+#define u_strncpy(...) u_strncpy_ptr(__VA_ARGS__)
+#define u_tolower(...) u_tolower_ptr(__VA_ARGS__)
+#define u_toupper(...) u_toupper_ptr(__VA_ARGS__)
+#define ucal_add(...) ucal_add_ptr(__VA_ARGS__)
+#define ucal_close(...) ucal_close_ptr(__VA_ARGS__)
+#define ucal_get(...) ucal_get_ptr(__VA_ARGS__)
+#define ucal_getAttribute(...) ucal_getAttribute_ptr(__VA_ARGS__)
+#define ucal_getKeywordValuesForLocale(...) ucal_getKeywordValuesForLocale_ptr(__VA_ARGS__)
+#define ucal_getLimit(...) ucal_getLimit_ptr(__VA_ARGS__)
+#define ucal_getTimeZoneDisplayName(...) ucal_getTimeZoneDisplayName_ptr(__VA_ARGS__)
+#define ucal_open(...) ucal_open_ptr(__VA_ARGS__)
+#define ucal_set(...) ucal_set_ptr(__VA_ARGS__)
+#define ucol_close(...) ucol_close_ptr(__VA_ARGS__)
+#define ucol_closeElements(...) ucol_closeElements_ptr(__VA_ARGS__)
+#define ucol_getRules(...) ucol_getRules_ptr(__VA_ARGS__)
+#define ucol_getSortKey(...) ucol_getSortKey_ptr(__VA_ARGS__)
+#define ucol_getStrength(...) ucol_getStrength_ptr(__VA_ARGS__)
+#define ucol_getVersion(...) ucol_getVersion_ptr(__VA_ARGS__)
+#define ucol_next(...) ucol_next_ptr(__VA_ARGS__)
+#define ucol_previous(...) ucol_previous_ptr(__VA_ARGS__)
+#define ucol_open(...) ucol_open_ptr(__VA_ARGS__)
+#define ucol_openElements(...) ucol_openElements_ptr(__VA_ARGS__)
+#define ucol_openRules(...) ucol_openRules_ptr(__VA_ARGS__)
+#define ucol_safeClone(...) ucol_safeClone_ptr(__VA_ARGS__)
+#define ucol_setAttribute(...) ucol_setAttribute_ptr(__VA_ARGS__)
+#if HAVE_SET_MAX_VARIABLE
+#define ucol_setMaxVariable(...) ucol_setMaxVariable_ptr(__VA_ARGS__)
+#else
+#define ucol_setVariableTop(...) ucol_setVariableTop_ptr(__VA_ARGS__)
+#endif
+#define ucol_strcoll(...) ucol_strcoll_ptr(__VA_ARGS__)
+#define ucurr_forLocale(...) ucurr_forLocale_ptr(__VA_ARGS__)
+#define ucurr_getName(...) ucurr_getName_ptr(__VA_ARGS__)
+#define udat_close(...) udat_close_ptr(__VA_ARGS__)
+#define udat_countSymbols(...) udat_countSymbols_ptr(__VA_ARGS__)
+#define udat_getSymbols(...) udat_getSymbols_ptr(__VA_ARGS__)
+#define udat_open(...) udat_open_ptr(__VA_ARGS__)
+#define udat_setCalendar(...) udat_setCalendar_ptr(__VA_ARGS__)
+#define udat_toPattern(...) udat_toPattern_ptr(__VA_ARGS__)
+#define udatpg_close(...) udatpg_close_ptr(__VA_ARGS__)
+#define udatpg_getBestPattern(...) udatpg_getBestPattern_ptr(__VA_ARGS__)
+#define udatpg_open(...) udatpg_open_ptr(__VA_ARGS__)
+#define uenum_close(...) uenum_close_ptr(__VA_ARGS__)
+#define uenum_count(...) uenum_count_ptr(__VA_ARGS__)
+#define uenum_next(...) uenum_next_ptr(__VA_ARGS__)
+#define uidna_close(...) uidna_close_ptr(__VA_ARGS__)
+#define uidna_nameToASCII(...) uidna_nameToASCII_ptr(__VA_ARGS__)
+#define uidna_nameToUnicode(...) uidna_nameToUnicode_ptr(__VA_ARGS__)
+#define uidna_openUTS46(...) uidna_openUTS46_ptr(__VA_ARGS__)
+#define uldn_close(...) uldn_close_ptr(__VA_ARGS__)
+#define uldn_keyValueDisplayName(...) uldn_keyValueDisplayName_ptr(__VA_ARGS__)
+#define uldn_open(...) uldn_open_ptr(__VA_ARGS__)
+#define uloc_canonicalize(...) uloc_canonicalize_ptr(__VA_ARGS__)
+#define uloc_countAvailable(...) uloc_countAvailable_ptr(__VA_ARGS__)
+#define uloc_getAvailable(...) uloc_getAvailable_ptr(__VA_ARGS__)
+#define uloc_getBaseName(...) uloc_getBaseName_ptr(__VA_ARGS__)
+#define uloc_getCharacterOrientation(...) uloc_getCharacterOrientation_ptr(__VA_ARGS__)
+#define uloc_getCountry(...) uloc_getCountry_ptr(__VA_ARGS__)
+#define uloc_getDefault(...) uloc_getDefault_ptr(__VA_ARGS__)
+#define uloc_getDisplayCountry(...) uloc_getDisplayCountry_ptr(__VA_ARGS__)
+#define uloc_getDisplayLanguage(...) uloc_getDisplayLanguage_ptr(__VA_ARGS__)
+#define uloc_getDisplayName(...) uloc_getDisplayName_ptr(__VA_ARGS__)
+#define uloc_getISO3Country(...) uloc_getISO3Country_ptr(__VA_ARGS__)
+#define uloc_getISO3Language(...) uloc_getISO3Language_ptr(__VA_ARGS__)
+#define uloc_getKeywordValue(...) uloc_getKeywordValue_ptr(__VA_ARGS__)
+#define uloc_getLanguage(...) uloc_getLanguage_ptr(__VA_ARGS__)
+#define uloc_getLCID(...) uloc_getLCID_ptr(__VA_ARGS__)
+#define uloc_getName(...) uloc_getName_ptr(__VA_ARGS__)
+#define uloc_getParent(...) uloc_getParent_ptr(__VA_ARGS__)
+#define uloc_setKeywordValue(...) uloc_setKeywordValue_ptr(__VA_ARGS__)
+#define ulocdata_getMeasurementSystem(...) ulocdata_getMeasurementSystem_ptr(__VA_ARGS__)
+#define unorm2_getNFCInstance(...) unorm2_getNFCInstance_ptr(__VA_ARGS__)
+#define unorm2_getNFDInstance(...) unorm2_getNFDInstance_ptr(__VA_ARGS__)
+#define unorm2_getNFKCInstance(...) unorm2_getNFKCInstance_ptr(__VA_ARGS__)
+#define unorm2_getNFKDInstance(...) unorm2_getNFKDInstance_ptr(__VA_ARGS__)
+#define unorm2_isNormalized(...) unorm2_isNormalized_ptr(__VA_ARGS__)
+#define unorm2_normalize(...) unorm2_normalize_ptr(__VA_ARGS__)
+#define unum_close(...) unum_close_ptr(__VA_ARGS__)
+#define unum_getAttribute(...) unum_getAttribute_ptr(__VA_ARGS__)
+#define unum_getSymbol(...) unum_getSymbol_ptr(__VA_ARGS__)
+#define unum_open(...) unum_open_ptr(__VA_ARGS__)
+#define unum_toPattern(...) unum_toPattern_ptr(__VA_ARGS__)
+#define ures_close(...) ures_close_ptr(__VA_ARGS__)
+#define ures_getByKey(...) ures_getByKey_ptr(__VA_ARGS__)
+#define ures_getSize(...) ures_getSize_ptr(__VA_ARGS__)
+#define ures_getStringByIndex(...) ures_getStringByIndex_ptr(__VA_ARGS__)
+#define ures_open(...) ures_open_ptr(__VA_ARGS__)
+#define usearch_close(...) usearch_close_ptr(__VA_ARGS__)
+#define usearch_first(...) usearch_first_ptr(__VA_ARGS__)
+#define usearch_getMatchedLength(...) usearch_getMatchedLength_ptr(__VA_ARGS__)
+#define usearch_last(...) usearch_last_ptr(__VA_ARGS__)
+#define usearch_openFromCollator(...) usearch_openFromCollator_ptr(__VA_ARGS__)
#include <stdint.h>
-#include "pal_icushim.h"
+#include "pal_icushim_internal.h"
#include "pal_idna.h"
static const uint32_t AllowUnassigned = 0x1;
// See the LICENSE file in the project root for more information.
//
-#include "pal_compiler.h"
+#pragma once
+
#include "pal_locale.h"
+#include "pal_compiler.h"
-DLLEXPORT int32_t GlobalizationNative_ToAscii(uint32_t flags,
+PALEXPORT int32_t GlobalizationNative_ToAscii(uint32_t flags,
const UChar* lpSrc,
int32_t cwSrcLength,
UChar* lpDst,
int32_t cwDstLength);
-DLLEXPORT int32_t GlobalizationNative_ToUnicode(uint32_t flags,
+PALEXPORT int32_t GlobalizationNative_ToUnicode(uint32_t flags,
const UChar* lpSrc,
int32_t cwSrcLength,
UChar* lpDst,
#include <stdlib.h>
#include <locale.h>
+#include "pal_locale_internal.h"
#include "pal_locale.h"
int32_t UErrorCodeToBool(UErrorCode status)
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#include "pal_icushim.h"
+#pragma once
-/*
-Function:
-UErrorCodeToBool
+#include "pal_compiler.h"
-Convert an ICU UErrorCode to a Bool compatible with Win32
-Returns 1 for success, 0 otherwise
-*/
-int32_t UErrorCodeToBool(UErrorCode code);
+PALEXPORT int32_t GlobalizationNative_GetLocales(UChar *value, int32_t valueLength);
-/*
-Function:
-GetLocale
+PALEXPORT int32_t GlobalizationNative_GetLocaleName(const UChar* localeName, UChar* value, int32_t valueLength);
-Converts a managed localeName into something ICU understands and can use as a localeName.
-*/
-int32_t GetLocale(const UChar* localeName,
- char* localeNameResult,
- int32_t localeNameResultLength,
- UBool canonicalize,
- UErrorCode* err);
+PALEXPORT int32_t GlobalizationNative_GetDefaultLocaleName(UChar* value, int32_t valueLength);
-/*
-Function:
-u_charsToUChars_safe
-
-Copies the given null terminated char* to UChar with error checking. Replacement for ICU u_charsToUChars
-*/
-void u_charsToUChars_safe(const char* str, UChar* value, int32_t valueLength, UErrorCode* err);
-
-/*
-Function:
-FixupLocaleName
-
-Replace underscores with hyphens to interop with existing .NET code.
-Returns the length of the string.
-*/
-int32_t FixupLocaleName(UChar* value, int32_t valueLength);
-
-/*
-Function:
-DetectDefaultLocaleName
-
-Detect the default locale for the machine, defaulting to Invaraint if
-we can't compute one (different from uloc_getDefault()) would do.
-*/
-const char* DetectDefaultLocaleName(void);
-
-DLLEXPORT int32_t GlobalizationNative_GetLocales(UChar *value, int32_t valueLength);
-
-DLLEXPORT int32_t GlobalizationNative_GetLocaleName(const UChar* localeName, UChar* value, int32_t valueLength);
-
-DLLEXPORT int32_t GlobalizationNative_GetDefaultLocaleName(UChar* value, int32_t valueLength);
-
-DLLEXPORT int32_t GlobalizationNative_IsPredefinedLocale(const UChar* localeName);
+PALEXPORT int32_t GlobalizationNative_IsPredefinedLocale(const UChar* localeName);
#include <stdlib.h>
#include <string.h>
+#include "pal_locale_internal.h"
#include "pal_localeNumberData.h"
// invariant character definitions used by ICU
// See the LICENSE file in the project root for more information.
//
-#include "pal_compiler.h"
+#pragma once
+
#include "pal_locale.h"
+#include "pal_compiler.h"
// Enum that corresponds to managed enum CultureData.LocaleNumberData.
// The numeric values of the enum members match their Win32 counterparts.
WeekRule_FirstFourDayWeek = 2
} CalendarWeekRule;
-DLLEXPORT int32_t GlobalizationNative_GetLocaleInfoInt(const UChar* localeName,
+PALEXPORT int32_t GlobalizationNative_GetLocaleInfoInt(const UChar* localeName,
LocaleNumberData localeNumberData,
int32_t* value);
-DLLEXPORT int32_t GlobalizationNative_GetLocaleInfoGroupingSizes(const UChar* localeName,
+PALEXPORT int32_t GlobalizationNative_GetLocaleInfoGroupingSizes(const UChar* localeName,
LocaleNumberData localeGroupingData,
int32_t* primaryGroupSize,
int32_t* secondaryGroupSize);
#include <stdlib.h>
#include <string.h>
+#include "pal_locale_internal.h"
#include "pal_localeStringData.h"
/*
// See the LICENSE file in the project root for more information.
//
-#include "pal_compiler.h"
+#pragma once
+
#include "pal_locale.h"
+#include "pal_compiler.h"
// Enum that corresponds to managed enum CultureData.LocaleStringData.
// The numeric values of the enum members match their Win32 counterparts.
LocaleString_PerMilleSymbol = 0x00000077
} LocaleStringData;
-DLLEXPORT int32_t GlobalizationNative_GetLocaleInfoString(const UChar* localeName,
+PALEXPORT int32_t GlobalizationNative_GetLocaleInfoString(const UChar* localeName,
LocaleStringData localeStringData,
UChar* value,
int32_t valueLength);
-DLLEXPORT int32_t GlobalizationNative_GetLocaleTimeFormat(const UChar* localeName,
+PALEXPORT int32_t GlobalizationNative_GetLocaleTimeFormat(const UChar* localeName,
int shortFormat, UChar* value,
int32_t valueLength);
--- /dev/null
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#pragma once
+
+#include "pal_icushim_internal.h"
+
+/*
+Function:
+UErrorCodeToBool
+
+Convert an ICU UErrorCode to a Bool compatible with Win32
+Returns 1 for success, 0 otherwise
+*/
+int32_t UErrorCodeToBool(UErrorCode code);
+
+/*
+Function:
+GetLocale
+
+Converts a managed localeName into something ICU understands and can use as a localeName.
+*/
+int32_t GetLocale(const UChar* localeName,
+ char* localeNameResult,
+ int32_t localeNameResultLength,
+ UBool canonicalize,
+ UErrorCode* err);
+
+/*
+Function:
+u_charsToUChars_safe
+
+Copies the given null terminated char* to UChar with error checking. Replacement for ICU u_charsToUChars
+*/
+void u_charsToUChars_safe(const char* str, UChar* value, int32_t valueLength, UErrorCode* err);
+
+/*
+Function:
+FixupLocaleName
+
+Replace underscores with hyphens to interop with existing .NET code.
+Returns the length of the string.
+*/
+int32_t FixupLocaleName(UChar* value, int32_t valueLength);
+
+/*
+Function:
+DetectDefaultLocaleName
+
+Detect the default locale for the machine, defaulting to Invaraint if
+we can't compute one (different from uloc_getDefault()) would do.
+*/
+const char* DetectDefaultLocaleName(void);
#include <stdint.h>
-#include "pal_icushim.h"
+#include "pal_icushim_internal.h"
#include "pal_normalization.h"
static const UNormalizer2* GetNormalizerForForm(NormalizationForm normalizationForm, UErrorCode* pErrorCode)
// See the LICENSE file in the project root for more information.
//
-#include "pal_compiler.h"
+#pragma once
+
#include "pal_locale.h"
+#include "pal_compiler.h"
/*
* These values should be kept in sync with System.Text.NormalizationForm
FormKD = 0x6
} NormalizationForm;
-DLLEXPORT int32_t GlobalizationNative_IsNormalized(NormalizationForm normalizationForm,
+PALEXPORT int32_t GlobalizationNative_IsNormalized(NormalizationForm normalizationForm,
const UChar* lpStr,
int32_t cwStrLength);
-DLLEXPORT int32_t GlobalizationNative_NormalizeString(NormalizationForm normalizationForm,
+PALEXPORT int32_t GlobalizationNative_NormalizeString(NormalizationForm normalizationForm,
const UChar* lpSrc,
int32_t cwSrcLength,
UChar* lpDst,
#include <stdint.h>
#include <unistd.h>
+#include "pal_errors_internal.h"
+#include "pal_locale_internal.h"
#include "pal_timeZoneInfo.h"
/*
// See the LICENSE file in the project root for more information.
//
-#include "pal_compiler.h"
+#pragma once
+
#include "pal_locale.h"
+#include "pal_compiler.h"
#include "pal_errors.h"
/*
TimeZoneDisplayName_DaylightSavings = 2,
} TimeZoneDisplayNameType;
-DLLEXPORT ResultCode GlobalizationNative_GetTimeZoneDisplayName(const UChar* localeName,
+PALEXPORT ResultCode GlobalizationNative_GetTimeZoneDisplayName(const UChar* localeName,
const UChar* timeZoneId,
TimeZoneDisplayNameType type,
UChar* result,
#include "pal_types.h"
#include "pal_compiler.h"
-DLLEXPORT intptr_t SystemIoPortsNative_SerialPortOpen(const char * name);
-DLLEXPORT int SystemIoPortsNative_SerialPortClose(intptr_t fd);
+PALEXPORT intptr_t SystemIoPortsNative_SerialPortOpen(const char * name);
+PALEXPORT int SystemIoPortsNative_SerialPortClose(intptr_t fd);
#include "pal_types.h"
#include "pal_compiler.h"
-DLLEXPORT int32_t SystemIoPortsNative_TermiosGetSignal(intptr_t fd, int32_t signal);
-DLLEXPORT int32_t SystemIoPortsNative_TermiosSetSignal(intptr_t fd, int32_t signal, int32_t set);
-DLLEXPORT int32_t SystemIoPortsNative_TermiosGetAllSignals(intptr_t fd);
+PALEXPORT int32_t SystemIoPortsNative_TermiosGetSignal(intptr_t fd, int32_t signal);
+PALEXPORT int32_t SystemIoPortsNative_TermiosSetSignal(intptr_t fd, int32_t signal, int32_t set);
+PALEXPORT int32_t SystemIoPortsNative_TermiosGetAllSignals(intptr_t fd);
-DLLEXPORT int32_t SystemIoPortsNative_TermiosGetSpeed(intptr_t fd);
-DLLEXPORT int32_t SystemIoPortsNative_TermiosSetSpeed(intptr_t fd, int32_t speed);
+PALEXPORT int32_t SystemIoPortsNative_TermiosGetSpeed(intptr_t fd);
+PALEXPORT int32_t SystemIoPortsNative_TermiosSetSpeed(intptr_t fd, int32_t speed);
-DLLEXPORT int32_t SystemIoPortsNative_TermiosAvailableBytes(intptr_t fd, int32_t readBuffer);
+PALEXPORT int32_t SystemIoPortsNative_TermiosAvailableBytes(intptr_t fd, int32_t readBuffer);
-DLLEXPORT int32_t SystemIoPortsNative_TermiosReset(intptr_t fd, int32_t speed, int32_t dataBits, int32_t stopBits, int32_t parity, int32_t handshake);
-DLLEXPORT int32_t SystemIoPortsNative_TermiosDiscard(intptr_t fd, int32_t queue);
-DLLEXPORT int32_t SystemIoPortsNative_TermiosDrain(intptr_t fd);
-DLLEXPORT int32_t SystemIoPortsNative_TermiosSendBreak(intptr_t fd, int32_t duration);
+PALEXPORT int32_t SystemIoPortsNative_TermiosReset(intptr_t fd, int32_t speed, int32_t dataBits, int32_t stopBits, int32_t parity, int32_t handshake);
+PALEXPORT int32_t SystemIoPortsNative_TermiosDiscard(intptr_t fd, int32_t queue);
+PALEXPORT int32_t SystemIoPortsNative_TermiosDrain(intptr_t fd);
+PALEXPORT int32_t SystemIoPortsNative_TermiosSendBreak(intptr_t fd, int32_t duration);
*
* Returns 0 on success; otherwise, returns errorNo.
*/
-DLLEXPORT int32_t SystemNative_GetWindowSize(WinSize* windowsSize);
+PALEXPORT int32_t SystemNative_GetWindowSize(WinSize* windowsSize);
/**
* Gets whether the specified file descriptor is for a terminal.
* Returns 1 if the file descriptor is referring to a terminal;
* otherwise returns 0 and sets errno.
*/
-DLLEXPORT int32_t SystemNative_IsATty(intptr_t fd);
+PALEXPORT int32_t SystemNative_IsATty(intptr_t fd);
/**
* Initializes signal handling and terminal for use by System.Console and System.Diagnostics.Process.
*
* Returns 1 on success; otherwise returns 0 and sets errno.
*/
-DLLEXPORT int32_t SystemNative_InitializeTerminalAndSignalHandling(void);
+PALEXPORT int32_t SystemNative_InitializeTerminalAndSignalHandling(void);
/**
* Stores the string that can be written to stdout to transition
*
* Returns 1 on success; otherwise returns 0 and sets errno.
*/
-DLLEXPORT void SystemNative_SetKeypadXmit(const char* terminfoString);
+PALEXPORT void SystemNative_SetKeypadXmit(const char* terminfoString);
/**
* Gets the special control character codes for the requested control characters.
* or 0 if a particular name is unsupported or disabled. posixDisableValue is the special sentinel used in the output
* controlCharacterValues array to indicate no value is available.
*/
-DLLEXPORT void SystemNative_GetControlCharacters(
+PALEXPORT void SystemNative_GetControlCharacters(
int32_t* controlCharacterNames, uint8_t* controlCharacterValues, int32_t controlCharacterLength,
uint8_t* posixDisableValue);
/**
* Returns 1 if any input is waiting on stdin; otherwise, 0.
*/
-DLLEXPORT int32_t SystemNative_StdinReady(void);
+PALEXPORT int32_t SystemNative_StdinReady(void);
/**
* Configures the terminal for System.Console Read.
*/
-DLLEXPORT void SystemNative_InitializeConsoleBeforeRead(uint8_t minChars, uint8_t decisecondsTimeout);
+PALEXPORT void SystemNative_InitializeConsoleBeforeRead(uint8_t minChars, uint8_t decisecondsTimeout);
/**
* Configures the terminal after System.Console Read.
*/
-DLLEXPORT void SystemNative_UninitializeConsoleAfterRead(void);
+PALEXPORT void SystemNative_UninitializeConsoleAfterRead(void);
/**
* Configures the terminal for child processes.
*/
-DLLEXPORT void SystemNative_ConfigureTerminalForChildProcess(int32_t enable);
+PALEXPORT void SystemNative_ConfigureTerminalForChildProcess(int32_t enable);
/**
* Reads the number of bytes specified into the provided buffer from stdin.
* Returns the number of bytes read on success; otherwise, -1 is returned an errno is set.
*/
-DLLEXPORT int32_t SystemNative_ReadStdin(void* buffer, int32_t bufferSize);
+PALEXPORT int32_t SystemNative_ReadStdin(void* buffer, int32_t bufferSize);
/**
* Gets the terminal's break mode.
*/
-DLLEXPORT int32_t SystemNative_GetSignalForBreak(void);
+PALEXPORT int32_t SystemNative_GetSignalForBreak(void);
/**
* Configures the terminal's break mode.
*
* Returns 1 on success, 0 on failure, in which case errno is set.
*/
-DLLEXPORT int32_t SystemNative_SetSignalForBreak(int32_t signalForBreak);
+PALEXPORT int32_t SystemNative_SetSignalForBreak(int32_t signalForBreak);
typedef enum
{
#include "pal_compiler.h"
-DLLEXPORT int64_t SystemNative_GetSystemTimeAsTicks(void);
+PALEXPORT int64_t SystemNative_GetSystemTimeAsTicks(void);
* Error above. If the value is not recognized, returns
* Error_ENONSTANDARD.
*/
-DLLEXPORT int32_t SystemNative_ConvertErrorPlatformToPal(int32_t platformErrno);
+PALEXPORT int32_t SystemNative_ConvertErrorPlatformToPal(int32_t platformErrno);
/**
* Converts the given PAL Error value to a platform-specific errno
* value. This is to be used when we want to synthesize a given error
* and obtain the appropriate error message via StrErrorR.
*/
-DLLEXPORT int32_t SystemNative_ConvertErrorPalToPlatform(int32_t error);
+PALEXPORT int32_t SystemNative_ConvertErrorPalToPlatform(int32_t error);
/**
* Obtains the system error message for the given raw numeric value
* returned and the buffer is filled with as much of the message
* as possible and null-terminated.
*/
-DLLEXPORT const char* SystemNative_StrErrorR(int32_t platformErrno, char* buffer, int32_t bufferSize);
+PALEXPORT const char* SystemNative_StrErrorR(int32_t platformErrno, char* buffer, int32_t bufferSize);
typedef void (*LinkLayerAddressFound)(const char* interfaceName, LinkLayerAddressInfo* llAddress);
typedef void (*GatewayAddressFound)(IpAddressInfo* addressInfo);
-DLLEXPORT int32_t SystemNative_EnumerateInterfaceAddresses(
+PALEXPORT int32_t SystemNative_EnumerateInterfaceAddresses(
IPv4AddressFound onIpv4Found, IPv6AddressFound onIpv6Found, LinkLayerAddressFound onLinkLayerFound);
-DLLEXPORT int32_t SystemNative_GetNetworkInterfaces(int32_t * interfaceCount, NetworkInterfaceInfo** interfaces, int32_t * addressCount, IpAddressInfo **addressList);
+PALEXPORT int32_t SystemNative_GetNetworkInterfaces(int32_t * interfaceCount, NetworkInterfaceInfo** interfaces, int32_t * addressCount, IpAddressInfo **addressList);
#if HAVE_RT_MSGHDR
-DLLEXPORT int32_t SystemNative_EnumerateGatewayAddressesForInterface(uint32_t interfaceIndex, GatewayAddressFound onGatewayFound);
+PALEXPORT int32_t SystemNative_EnumerateGatewayAddressesForInterface(uint32_t interfaceIndex, GatewayAddressFound onGatewayFound);
#endif
*
* Returns 0 for success, -1 for failure. Sets errno on failure.
*/
-DLLEXPORT int32_t SystemNative_FStat(intptr_t fd, FileStatus* output);
+PALEXPORT int32_t SystemNative_FStat(intptr_t fd, FileStatus* output);
/**
* Get file status from a full path. Implemented as shim to stat(2).
*
* Returns 0 for success, -1 for failure. Sets errno on failure.
*/
-DLLEXPORT int32_t SystemNative_Stat(const char* path, FileStatus* output);
+PALEXPORT int32_t SystemNative_Stat(const char* path, FileStatus* output);
/**
* Get file stats from a full path. Implemented as shim to lstat(2).
*
* Returns 0 for success, -1 for failure. Sets errno on failure.
*/
-DLLEXPORT int32_t SystemNative_LStat(const char* path, FileStatus* output);
+PALEXPORT int32_t SystemNative_LStat(const char* path, FileStatus* output);
/**
* Open or create a file or device. Implemented as shim to open(2).
*
* Returns file descriptor or -1 for failure. Sets errno on failure.
*/
-DLLEXPORT intptr_t SystemNative_Open(const char* path, int32_t flags, int32_t mode);
+PALEXPORT intptr_t SystemNative_Open(const char* path, int32_t flags, int32_t mode);
/**
* Close a file descriptor. Implemented as shim to open(2).
*
* Returns 0 for success, -1 for failure. Sets errno on failure.
*/
-DLLEXPORT int32_t SystemNative_Close(intptr_t fd);
+PALEXPORT int32_t SystemNative_Close(intptr_t fd);
/**
* Duplicates a file descriptor.
*
* Returns the duplication descriptor for success, -1 for failure. Sets errno on failure.
*/
-DLLEXPORT intptr_t SystemNative_Dup(intptr_t oldfd);
+PALEXPORT intptr_t SystemNative_Dup(intptr_t oldfd);
/**
* Delete an entry from the file system. Implemented as shim to unlink(2).
*
* Returns 0 for success, -1 for failure. Sets errno on failure.
*/
-DLLEXPORT int32_t SystemNative_Unlink(const char* path);
+PALEXPORT int32_t SystemNative_Unlink(const char* path);
/**
* Open or create a shared memory object. Implemented as shim to shm_open(3).
*
* Returns file descriptor or -1 on fiailure. Sets errno on failure.
*/
-DLLEXPORT intptr_t SystemNative_ShmOpen(const char* name, int32_t flags, int32_t mode);
+PALEXPORT intptr_t SystemNative_ShmOpen(const char* name, int32_t flags, int32_t mode);
/**
* Unlink a shared memory object. Implemented as shim to shm_unlink(3).
*
* Returns 0 for success, -1 for failure. Sets errno on failure.
*/
-DLLEXPORT int32_t SystemNative_ShmUnlink(const char* name);
+PALEXPORT int32_t SystemNative_ShmUnlink(const char* name);
/**
* Returns the size of the dirent struct on the current architecture
*/
-DLLEXPORT int32_t SystemNative_GetReadDirRBufferSize(void);
+PALEXPORT int32_t SystemNative_GetReadDirRBufferSize(void);
/**
* Re-entrant readdir that will retrieve the next dirent from the directory stream pointed to by dir.
*
* Returns 0 when data is retrieved; returns -1 when end-of-stream is reached; returns an error code on failure
*/
-DLLEXPORT int32_t SystemNative_ReadDirR(DIR* dir, uint8_t* buffer, int32_t bufferSize, DirectoryEntry* outputEntry);
+PALEXPORT int32_t SystemNative_ReadDirR(DIR* dir, uint8_t* buffer, int32_t bufferSize, DirectoryEntry* outputEntry);
/**
* Returns a DIR struct containing info about the current path or NULL on failure; sets errno on fail.
*/
-DLLEXPORT DIR* SystemNative_OpenDir(const char* path);
+PALEXPORT DIR* SystemNative_OpenDir(const char* path);
/**
* Closes the directory stream opened by opendir and returns 0 on success. On fail, -1 is returned and errno is set
*/
-DLLEXPORT int32_t SystemNative_CloseDir(DIR* dir);
+PALEXPORT int32_t SystemNative_CloseDir(DIR* dir);
/**
* Creates a pipe. Implemented as shim to pipe(2) or pipe2(2) if available.
*
* Returns 0 for success, -1 for failure. Sets errno on failure.
*/
-DLLEXPORT int32_t SystemNative_Pipe(int32_t pipefd[2], // [out] pipefds[0] gets read end, pipefd[1] gets write end.
+PALEXPORT int32_t SystemNative_Pipe(int32_t pipefd[2], // [out] pipefds[0] gets read end, pipefd[1] gets write end.
int32_t flags); // 0 for defaults or PAL_O_CLOEXEC for close-on-exec
// NOTE: Rather than a general fcntl shim, we opt to export separate functions
*
* Returns 0 for success; -1 for failure. Sets errno for failure.
*/
-DLLEXPORT int32_t SystemNative_FcntlSetFD(intptr_t fd, int32_t flags);
+PALEXPORT int32_t SystemNative_FcntlSetFD(intptr_t fd, int32_t flags);
/**
* Gets the flags on a file descriptor.
*
* Returns flags for success; -1 for failure. Sets errno for failure.
*/
-DLLEXPORT int32_t SystemNative_FcntlGetFD(intptr_t fd);
+PALEXPORT int32_t SystemNative_FcntlGetFD(intptr_t fd);
/**
* Determines if the current platform supports getting and setting pipe capacity.
*
* Returns true (non-zero) if supported, false (zero) if not.
*/
-DLLEXPORT int32_t SystemNative_FcntlCanGetSetPipeSz(void);
+PALEXPORT int32_t SystemNative_FcntlCanGetSetPipeSz(void);
/**
* Gets the capacity of a pipe.
*
* NOTE: Some platforms do not support this operation and will always fail with errno = ENOTSUP.
*/
-DLLEXPORT int32_t SystemNative_FcntlGetPipeSz(intptr_t fd);
+PALEXPORT int32_t SystemNative_FcntlGetPipeSz(intptr_t fd);
/**
* Sets the capacity of a pipe.
*
* NOTE: Some platforms do not support this operation and will always fail with errno = ENOTSUP.
*/
-DLLEXPORT int32_t SystemNative_FcntlSetPipeSz(intptr_t fd, int32_t size);
+PALEXPORT int32_t SystemNative_FcntlSetPipeSz(intptr_t fd, int32_t size);
/**
* Sets whether or not a file descriptor is non-blocking.
*
* Returns 0 for success, -1 for failure. Sets errno for failure.
*/
-DLLEXPORT int32_t SystemNative_FcntlSetIsNonBlocking(intptr_t fd, int32_t isNonBlocking);
+PALEXPORT int32_t SystemNative_FcntlSetIsNonBlocking(intptr_t fd, int32_t isNonBlocking);
/**
* Create a directory. Implemented as a shim to mkdir(2).
*
* Returns 0 for success, -1 for failure. Sets errno for failure.
*/
-DLLEXPORT int32_t SystemNative_MkDir(const char* path, int32_t mode);
+PALEXPORT int32_t SystemNative_MkDir(const char* path, int32_t mode);
/**
* Change permissions of a file. Implemented as a shim to chmod(2).
*
* Returns 0 for success, -1 for failure. Sets errno for failure.
*/
-DLLEXPORT int32_t SystemNative_ChMod(const char* path, int32_t mode);
+PALEXPORT int32_t SystemNative_ChMod(const char* path, int32_t mode);
/**
* Change permissions of a file. Implemented as a shim to fchmod(2).
*
* Returns 0 for success, -1 for failure. Sets errno for failure.
*/
-DLLEXPORT int32_t SystemNative_FChMod(intptr_t fd, int32_t mode);
+PALEXPORT int32_t SystemNative_FChMod(intptr_t fd, int32_t mode);
/**
* Flushes all modified data and attribtues of the specified File Descriptor to the storage medium.
*
* Returns 0 for success; on fail, -1 is returned and errno is set.
*/
-DLLEXPORT int32_t SystemNative_FSync(intptr_t fd);
+PALEXPORT int32_t SystemNative_FSync(intptr_t fd);
/**
* Changes the advisory lock status on a given File Descriptor
*
* Returns 0 on success; otherwise, -1 is returned and errno is set
*/
-DLLEXPORT int32_t SystemNative_FLock(intptr_t fd, int32_t operation);
+PALEXPORT int32_t SystemNative_FLock(intptr_t fd, int32_t operation);
/**
* Changes the current working directory to be the specified path.
*
* Returns 0 on success; otherwise, returns -1 and errno is set
*/
-DLLEXPORT int32_t SystemNative_ChDir(const char* path);
+PALEXPORT int32_t SystemNative_ChDir(const char* path);
/**
* Checks the access permissions of the current calling user on the specified path for the specified mode.
* Returns -1 if the path cannot be found or the if desired access is not granted and errno is set; otherwise, returns
* 0.
*/
-DLLEXPORT int32_t SystemNative_Access(const char* path, int32_t mode);
+PALEXPORT int32_t SystemNative_Access(const char* path, int32_t mode);
/**
* Seek to a specified location within a seekable stream
* On success, the resulting offet, in bytes, from the beginning of the stream; otherwise,
* returns -1 and errno is set.
*/
-DLLEXPORT int64_t SystemNative_LSeek(intptr_t fd, int64_t offset, int32_t whence);
+PALEXPORT int64_t SystemNative_LSeek(intptr_t fd, int64_t offset, int32_t whence);
/**
* Creates a hard-link at link pointing to source.
*
* Returns 0 on success; otherwise, returns -1 and errno is set.
*/
-DLLEXPORT int32_t SystemNative_Link(const char* source, const char* linkTarget);
+PALEXPORT int32_t SystemNative_Link(const char* source, const char* linkTarget);
/**
* Creates a file name that adheres to the specified template, creates the file on disk with
*
* Returns a valid File Descriptor on success; otherwise, returns -1 and errno is set.
*/
-DLLEXPORT intptr_t SystemNative_MksTemps(char* pathTemplate, int32_t suffixLength);
+PALEXPORT intptr_t SystemNative_MksTemps(char* pathTemplate, int32_t suffixLength);
/**
* Map file or device into memory. Implemented as shim to mmap(2).
* Note that null failure result is a departure from underlying
* mmap(2) using non-null sentinel.
*/
-DLLEXPORT void* SystemNative_MMap(void* address,
+PALEXPORT void* SystemNative_MMap(void* address,
uint64_t length,
int32_t protection, // bitwise OR of PAL_PROT_*
int32_t flags, // bitwise OR of PAL_MAP_*, but PRIVATE and SHARED are mutually exclusive.
*
* Returns 0 for success, -1 for failure. Sets errno on failure.
*/
-DLLEXPORT int32_t SystemNative_MUnmap(void* address, uint64_t length);
+PALEXPORT int32_t SystemNative_MUnmap(void* address, uint64_t length);
/**
* Give advice about use of memory. Implemented as shim to madvise(2).
*
* Returns 0 for success, -1 for failure. Sets errno on failure.
*/
-DLLEXPORT int32_t SystemNative_MAdvise(void* address, uint64_t length, int32_t advice);
+PALEXPORT int32_t SystemNative_MAdvise(void* address, uint64_t length, int32_t advice);
/**
* Sycnhronize a file with a memory map. Implemented as shim to mmap(2).
*
* Returns 0 for success, -1 for failure. Sets errno on failure.
*/
-DLLEXPORT int32_t SystemNative_MSync(void* address, uint64_t length, int32_t flags);
+PALEXPORT int32_t SystemNative_MSync(void* address, uint64_t length, int32_t flags);
/**
* Get system configuration value. Implemented as shim to sysconf(3).
* note that -1 can also be a meaningful successful return value, in
* which case errno is unchanged.
*/
-DLLEXPORT int64_t SystemNative_SysConf(int32_t name);
+PALEXPORT int64_t SystemNative_SysConf(int32_t name);
/**
* Truncate a file to given length. Implemented as shim to ftruncate(2).
*
* Returns 0 for success, -1 for failure. Sets errno on failure.
*/
-DLLEXPORT int32_t SystemNative_FTruncate(intptr_t fd, int64_t length);
+PALEXPORT int32_t SystemNative_FTruncate(intptr_t fd, int64_t length);
/**
* Examines one or more file descriptors for the specified state(s) and blocks until the state(s) occur or the timeout
* Returns an error or Error_SUCCESS. `triggered` is set to the number of ready descriptors if any. The number of
* triggered descriptors may be zero in the event of a timeout.
*/
-DLLEXPORT int32_t SystemNative_Poll(PollEvent* pollEvents, uint32_t eventCount, int32_t milliseconds, uint32_t* triggered);
+PALEXPORT int32_t SystemNative_Poll(PollEvent* pollEvents, uint32_t eventCount, int32_t milliseconds, uint32_t* triggered);
/**
* Notifies the OS kernel that the specified file will be accessed in a particular way soon; this allows the kernel to
*
* Returns 0 on success; otherwise, the error code is returned and errno is NOT set.
*/
-DLLEXPORT int32_t SystemNative_PosixFAdvise(intptr_t fd, int64_t offset, int64_t length, int32_t advice);
+PALEXPORT int32_t SystemNative_PosixFAdvise(intptr_t fd, int64_t offset, int64_t length, int32_t advice);
/**
* Reads a line from the provided stream.
*
* Returns the read line, or null if no line could be read. The caller is responsible for freeing the malloc'd line.
*/
-DLLEXPORT char* SystemNative_GetLine(FILE* stream);
+PALEXPORT char* SystemNative_GetLine(FILE* stream);
/**
* Reads the number of bytes specified into the provided buffer from the specified, opened file descriptor.
*
* Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info
*/
-DLLEXPORT int32_t SystemNative_Read(intptr_t fd, void* buffer, int32_t bufferSize);
+PALEXPORT int32_t SystemNative_Read(intptr_t fd, void* buffer, int32_t bufferSize);
/**
* Takes a path to a symbolic link and attempts to place the link target path into the buffer. If the buffer is too
*
* Returns the number of bytes placed into the buffer on success; otherwise, -1 is returned and errno is set.
*/
-DLLEXPORT int32_t SystemNative_ReadLink(const char* path, char* buffer, int32_t bufferSize);
+PALEXPORT int32_t SystemNative_ReadLink(const char* path, char* buffer, int32_t bufferSize);
/**
* Renames a file, moving to the correct destination if necessary. There are many edge cases to this call, check man 2
*
* Returns 0 on succes; otherwise, returns -1 and errno is set.
*/
-DLLEXPORT int32_t SystemNative_Rename(const char* oldPath, const char* newPath);
+PALEXPORT int32_t SystemNative_Rename(const char* oldPath, const char* newPath);
/**
* Deletes the specified empty directory.
*
* Returns 0 on success; otherwise, returns -1 and errno is set.
*/
-DLLEXPORT int32_t SystemNative_RmDir(const char* path);
+PALEXPORT int32_t SystemNative_RmDir(const char* path);
/**
* Forces a write of all modified I/O buffers to their storage mediums.
*/
-DLLEXPORT void SystemNative_Sync(void);
+PALEXPORT void SystemNative_Sync(void);
/**
* Writes the specified buffer to the provided open file descriptor
*
* Returns the number of bytes written on success; otherwise, returns -1 and sets errno
*/
-DLLEXPORT int32_t SystemNative_Write(intptr_t fd, const void* buffer, int32_t bufferSize);
+PALEXPORT int32_t SystemNative_Write(intptr_t fd, const void* buffer, int32_t bufferSize);
/**
* Copies all data from the source file descriptor/path to the destination file path.
*
* Returns 0 on success; otherwise, returns -1 and sets errno.
*/
-DLLEXPORT int32_t SystemNative_CopyFile(intptr_t sourceFd, const char* srcPath, const char* destPath, int32_t overwrite);
+PALEXPORT int32_t SystemNative_CopyFile(intptr_t sourceFd, const char* srcPath, const char* destPath, int32_t overwrite);
/**
* Initializes a new inotify instance and returns a file
* Returns a new file descriptor on success.
* On error, -1 is returned, and errno is set to indicate the error.
*/
-DLLEXPORT intptr_t SystemNative_INotifyInit(void);
+PALEXPORT intptr_t SystemNative_INotifyInit(void);
/**
* Adds a new watch, or modifies an existing watch,
* Returns a nonnegative watch descriptor on success.
* On error -1 is returned and errno is set appropriately.
*/
-DLLEXPORT int32_t SystemNative_INotifyAddWatch(intptr_t fd, const char* pathName, uint32_t mask);
+PALEXPORT int32_t SystemNative_INotifyAddWatch(intptr_t fd, const char* pathName, uint32_t mask);
/**
* Removes the watch associated with the watch descriptor wd
*
* Returns 0 on success, or -1 if an error occurred (in which case, errno is set appropriately).
*/
-DLLEXPORT int32_t SystemNative_INotifyRemoveWatch(intptr_t fd, int32_t wd);
+PALEXPORT int32_t SystemNative_INotifyRemoveWatch(intptr_t fd, int32_t wd);
/**
* Expands all symbolic links and expands all paths to return an absolute path
*
* Returns the result absolute path on success or null on error with errno set appropriately.
*/
-DLLEXPORT char* SystemNative_RealPath(const char* path);
+PALEXPORT char* SystemNative_RealPath(const char* path);
/**
* Attempts to retrieve the ID of the process at the end of the given socket
*
* Returns 0 on success, or -1 if an error occurred (in which case, errno is set appropriately).
*/
-DLLEXPORT int32_t SystemNative_GetPeerID(intptr_t socket, uid_t* euid);
+PALEXPORT int32_t SystemNative_GetPeerID(intptr_t socket, uid_t* euid);
/**
* Attempts to lock/unlock the region of the file "fd" specified by the offset and length. lockType
*
* Returns 0 on success, or -1 if an error occurred (in which case, errno is set appropriately).
*/
-DLLEXPORT int32_t SystemNative_LockFileRegion(intptr_t fd, int64_t offset, int64_t length, int16_t lockType);
+PALEXPORT int32_t SystemNative_LockFileRegion(intptr_t fd, int64_t offset, int64_t length, int16_t lockType);
/**
* Changes the file flags of the file whose location is specified in path
*
* Returns 0 for success, -1 for failure. Sets errno for failure.
*/
-DLLEXPORT int32_t SystemNative_LChflags(const char* path, uint32_t flags);
+PALEXPORT int32_t SystemNative_LChflags(const char* path, uint32_t flags);
/**
* Determines if the current platform supports setting UF_HIDDEN (0x8000) flag
*
* Returns true (non-zero) if supported, false (zero) if not.
*/
-DLLEXPORT int32_t SystemNative_LChflagsCanSetHiddenFlag(void);
+PALEXPORT int32_t SystemNative_LChflagsCanSetHiddenFlag(void);
*
* Returns a pointer to the memory.
*/
-DLLEXPORT void* SystemNative_MemSet(void *s, int c, uintptr_t n);
+PALEXPORT void* SystemNative_MemSet(void *s, int c, uintptr_t n);
/**
* Gets the space information for the given mount point and populates the input struct with the data.
*/
-DLLEXPORT int32_t SystemNative_GetSpaceInfoForMountPoint(const char* name, MountPointInformation* mpi);
+PALEXPORT int32_t SystemNative_GetSpaceInfoForMountPoint(const char* name, MountPointInformation* mpi);
/**
* Gets the format information about the given mount point.
* Since C# is much better at enum and string handling, pass either the char buffer or the long type
* back, depending on what the platform gives us, and let C# reason on it in an easy way.
*/
-DLLEXPORT int32_t SystemNative_GetFormatInfoForMountPoint(
+PALEXPORT int32_t SystemNative_GetFormatInfoForMountPoint(
const char* name, char* formatNameBuffer, int32_t bufferLength, int64_t* formatType);
/**
* function pointer once-per-mount-point to prevent heap allocs
* as much as possible.
*/
-DLLEXPORT int32_t SystemNative_GetAllMountPoints(MountPointFound onFound);
+PALEXPORT int32_t SystemNative_GetAllMountPoints(MountPointFound onFound);
typedef void (*NetworkChangeEvent)(int32_t sock, NetworkChangeKind notificationKind);
-DLLEXPORT void SystemNative_ReadEvents(int32_t sock, NetworkChangeEvent onNetworkChange);
+PALEXPORT void SystemNative_ReadEvents(int32_t sock, NetworkChangeEvent onNetworkChange);
-DLLEXPORT Error SystemNative_CreateNetworkChangeListenerSocket(int32_t* retSocket);
+PALEXPORT Error SystemNative_CreateNetworkChangeListenerSocket(int32_t* retSocket);
-DLLEXPORT Error SystemNative_CloseNetworkChangeListenerSocket(int32_t socket);
+PALEXPORT Error SystemNative_CloseNetworkChangeListenerSocket(int32_t socket);
uint32_t Padding; // Pad out to 8-byte alignment
} SocketEvent;
-DLLEXPORT int32_t SystemNative_GetHostEntryForName(const uint8_t* address, HostEntry* entry);
+PALEXPORT int32_t SystemNative_GetHostEntryForName(const uint8_t* address, HostEntry* entry);
-DLLEXPORT void SystemNative_FreeHostEntry(HostEntry* entry);
+PALEXPORT void SystemNative_FreeHostEntry(HostEntry* entry);
-DLLEXPORT int32_t SystemNative_GetNameInfo(const uint8_t* address,
+PALEXPORT int32_t SystemNative_GetNameInfo(const uint8_t* address,
int32_t addressLength,
int8_t isIPv6,
uint8_t* host,
int32_t serviceLength,
int32_t flags);
-DLLEXPORT int32_t SystemNative_GetDomainName(uint8_t* name, int32_t nameLength);
+PALEXPORT int32_t SystemNative_GetDomainName(uint8_t* name, int32_t nameLength);
-DLLEXPORT int32_t SystemNative_GetHostName(uint8_t* name, int32_t nameLength);
+PALEXPORT int32_t SystemNative_GetHostName(uint8_t* name, int32_t nameLength);
-DLLEXPORT int32_t SystemNative_GetIPSocketAddressSizes(int32_t* ipv4SocketAddressSize, int32_t* ipv6SocketAddressSize);
+PALEXPORT int32_t SystemNative_GetIPSocketAddressSizes(int32_t* ipv4SocketAddressSize, int32_t* ipv6SocketAddressSize);
-DLLEXPORT int32_t SystemNative_GetAddressFamily(const uint8_t* socketAddress, int32_t socketAddressLen, int32_t* addressFamily);
+PALEXPORT int32_t SystemNative_GetAddressFamily(const uint8_t* socketAddress, int32_t socketAddressLen, int32_t* addressFamily);
-DLLEXPORT int32_t SystemNative_SetAddressFamily(uint8_t* socketAddress, int32_t socketAddressLen, int32_t addressFamily);
+PALEXPORT int32_t SystemNative_SetAddressFamily(uint8_t* socketAddress, int32_t socketAddressLen, int32_t addressFamily);
-DLLEXPORT int32_t SystemNative_GetPort(const uint8_t* socketAddress, int32_t socketAddressLen, uint16_t* port);
+PALEXPORT int32_t SystemNative_GetPort(const uint8_t* socketAddress, int32_t socketAddressLen, uint16_t* port);
-DLLEXPORT int32_t SystemNative_SetPort(uint8_t* socketAddress, int32_t socketAddressLen, uint16_t port);
+PALEXPORT int32_t SystemNative_SetPort(uint8_t* socketAddress, int32_t socketAddressLen, uint16_t port);
-DLLEXPORT int32_t SystemNative_GetIPv4Address(const uint8_t* socketAddress, int32_t socketAddressLen, uint32_t* address);
+PALEXPORT int32_t SystemNative_GetIPv4Address(const uint8_t* socketAddress, int32_t socketAddressLen, uint32_t* address);
-DLLEXPORT int32_t SystemNative_SetIPv4Address(uint8_t* socketAddress, int32_t socketAddressLen, uint32_t address);
+PALEXPORT int32_t SystemNative_SetIPv4Address(uint8_t* socketAddress, int32_t socketAddressLen, uint32_t address);
-DLLEXPORT int32_t SystemNative_GetIPv6Address(
+PALEXPORT int32_t SystemNative_GetIPv6Address(
const uint8_t* socketAddress, int32_t socketAddressLen, uint8_t* address, int32_t addressLen, uint32_t* scopeId);
-DLLEXPORT int32_t SystemNative_SetIPv6Address(
+PALEXPORT int32_t SystemNative_SetIPv6Address(
uint8_t* socketAddress, int32_t socketAddressLen, uint8_t* address, int32_t addressLen, uint32_t scopeId);
-DLLEXPORT int32_t SystemNative_GetControlMessageBufferSize(int32_t isIPv4, int32_t isIPv6);
+PALEXPORT int32_t SystemNative_GetControlMessageBufferSize(int32_t isIPv4, int32_t isIPv6);
-DLLEXPORT int32_t SystemNative_TryGetIPPacketInformation(MessageHeader* messageHeader, int32_t isIPv4, IPPacketInformation* packetInfo);
+PALEXPORT int32_t SystemNative_TryGetIPPacketInformation(MessageHeader* messageHeader, int32_t isIPv4, IPPacketInformation* packetInfo);
-DLLEXPORT int32_t SystemNative_GetIPv4MulticastOption(intptr_t socket, int32_t multicastOption, IPv4MulticastOption* option);
+PALEXPORT int32_t SystemNative_GetIPv4MulticastOption(intptr_t socket, int32_t multicastOption, IPv4MulticastOption* option);
-DLLEXPORT int32_t SystemNative_SetIPv4MulticastOption(intptr_t socket, int32_t multicastOption, IPv4MulticastOption* option);
+PALEXPORT int32_t SystemNative_SetIPv4MulticastOption(intptr_t socket, int32_t multicastOption, IPv4MulticastOption* option);
-DLLEXPORT int32_t SystemNative_GetIPv6MulticastOption(intptr_t socket, int32_t multicastOption, IPv6MulticastOption* option);
+PALEXPORT int32_t SystemNative_GetIPv6MulticastOption(intptr_t socket, int32_t multicastOption, IPv6MulticastOption* option);
-DLLEXPORT int32_t SystemNative_SetIPv6MulticastOption(intptr_t socket, int32_t multicastOption, IPv6MulticastOption* option);
+PALEXPORT int32_t SystemNative_SetIPv6MulticastOption(intptr_t socket, int32_t multicastOption, IPv6MulticastOption* option);
-DLLEXPORT int32_t SystemNative_GetLingerOption(intptr_t socket, LingerOption* option);
+PALEXPORT int32_t SystemNative_GetLingerOption(intptr_t socket, LingerOption* option);
-DLLEXPORT int32_t SystemNative_SetLingerOption(intptr_t socket, LingerOption* option);
+PALEXPORT int32_t SystemNative_SetLingerOption(intptr_t socket, LingerOption* option);
-DLLEXPORT int32_t SystemNative_SetReceiveTimeout(intptr_t socket, int32_t millisecondsTimeout);
+PALEXPORT int32_t SystemNative_SetReceiveTimeout(intptr_t socket, int32_t millisecondsTimeout);
-DLLEXPORT int32_t SystemNative_SetSendTimeout(intptr_t socket, int32_t millisecondsTimeout);
+PALEXPORT int32_t SystemNative_SetSendTimeout(intptr_t socket, int32_t millisecondsTimeout);
-DLLEXPORT int32_t SystemNative_ReceiveMessage(intptr_t socket, MessageHeader* messageHeader, int32_t flags, int64_t* received);
+PALEXPORT int32_t SystemNative_ReceiveMessage(intptr_t socket, MessageHeader* messageHeader, int32_t flags, int64_t* received);
-DLLEXPORT int32_t SystemNative_SendMessage(intptr_t socket, MessageHeader* messageHeader, int32_t flags, int64_t* sent);
+PALEXPORT int32_t SystemNative_SendMessage(intptr_t socket, MessageHeader* messageHeader, int32_t flags, int64_t* sent);
-DLLEXPORT int32_t SystemNative_Accept(intptr_t socket, uint8_t* socketAddress, int32_t* socketAddressLen, intptr_t* acceptedSocket);
+PALEXPORT int32_t SystemNative_Accept(intptr_t socket, uint8_t* socketAddress, int32_t* socketAddressLen, intptr_t* acceptedSocket);
-DLLEXPORT int32_t SystemNative_Bind(intptr_t socket, int32_t protocolType, uint8_t* socketAddress, int32_t socketAddressLen);
+PALEXPORT int32_t SystemNative_Bind(intptr_t socket, int32_t protocolType, uint8_t* socketAddress, int32_t socketAddressLen);
-DLLEXPORT int32_t SystemNative_Connect(intptr_t socket, uint8_t* socketAddress, int32_t socketAddressLen);
+PALEXPORT int32_t SystemNative_Connect(intptr_t socket, uint8_t* socketAddress, int32_t socketAddressLen);
-DLLEXPORT int32_t SystemNative_GetPeerName(intptr_t socket, uint8_t* socketAddress, int32_t* socketAddressLen);
+PALEXPORT int32_t SystemNative_GetPeerName(intptr_t socket, uint8_t* socketAddress, int32_t* socketAddressLen);
-DLLEXPORT int32_t SystemNative_GetSockName(intptr_t socket, uint8_t* socketAddress, int32_t* socketAddressLen);
+PALEXPORT int32_t SystemNative_GetSockName(intptr_t socket, uint8_t* socketAddress, int32_t* socketAddressLen);
-DLLEXPORT int32_t SystemNative_Listen(intptr_t socket, int32_t backlog);
+PALEXPORT int32_t SystemNative_Listen(intptr_t socket, int32_t backlog);
-DLLEXPORT int32_t SystemNative_Shutdown(intptr_t socket, int32_t socketShutdown);
+PALEXPORT int32_t SystemNative_Shutdown(intptr_t socket, int32_t socketShutdown);
-DLLEXPORT int32_t SystemNative_GetSocketErrorOption(intptr_t socket, int32_t* error);
+PALEXPORT int32_t SystemNative_GetSocketErrorOption(intptr_t socket, int32_t* error);
-DLLEXPORT int32_t SystemNative_GetSockOpt(
+PALEXPORT int32_t SystemNative_GetSockOpt(
intptr_t socket, int32_t socketOptionLevel, int32_t socketOptionName, uint8_t* optionValue, int32_t* optionLen);
-DLLEXPORT int32_t SystemNative_SetSockOpt(
+PALEXPORT int32_t SystemNative_SetSockOpt(
intptr_t socket, int32_t socketOptionLevel, int32_t socketOptionName, uint8_t* optionValue, int32_t optionLen);
-DLLEXPORT int32_t SystemNative_Socket(int32_t addressFamily, int32_t socketType, int32_t protocolType, intptr_t* createdSocket);
+PALEXPORT int32_t SystemNative_Socket(int32_t addressFamily, int32_t socketType, int32_t protocolType, intptr_t* createdSocket);
-DLLEXPORT int32_t SystemNative_GetAtOutOfBandMark(intptr_t socket, int32_t* available);
+PALEXPORT int32_t SystemNative_GetAtOutOfBandMark(intptr_t socket, int32_t* available);
-DLLEXPORT int32_t SystemNative_GetBytesAvailable(intptr_t socket, int32_t* available);
+PALEXPORT int32_t SystemNative_GetBytesAvailable(intptr_t socket, int32_t* available);
-DLLEXPORT int32_t SystemNative_CreateSocketEventPort(intptr_t* port);
+PALEXPORT int32_t SystemNative_CreateSocketEventPort(intptr_t* port);
-DLLEXPORT int32_t SystemNative_CloseSocketEventPort(intptr_t port);
+PALEXPORT int32_t SystemNative_CloseSocketEventPort(intptr_t port);
-DLLEXPORT int32_t SystemNative_CreateSocketEventBuffer(int32_t count, SocketEvent** buffer);
+PALEXPORT int32_t SystemNative_CreateSocketEventBuffer(int32_t count, SocketEvent** buffer);
-DLLEXPORT int32_t SystemNative_FreeSocketEventBuffer(SocketEvent* buffer);
+PALEXPORT int32_t SystemNative_FreeSocketEventBuffer(SocketEvent* buffer);
-DLLEXPORT int32_t SystemNative_TryChangeSocketEventRegistration(
+PALEXPORT int32_t SystemNative_TryChangeSocketEventRegistration(
intptr_t port, intptr_t socket, int32_t currentEvents, int32_t newEvents, uintptr_t data);
-DLLEXPORT int32_t SystemNative_WaitForSocketEvents(intptr_t port, SocketEvent* buffer, int32_t* count);
+PALEXPORT int32_t SystemNative_WaitForSocketEvents(intptr_t port, SocketEvent* buffer, int32_t* count);
-DLLEXPORT int32_t SystemNative_PlatformSupportsDualModeIPv4PacketInfo(void);
+PALEXPORT int32_t SystemNative_PlatformSupportsDualModeIPv4PacketInfo(void);
-DLLEXPORT char* SystemNative_GetPeerUserName(intptr_t socket);
+PALEXPORT char* SystemNative_GetPeerUserName(intptr_t socket);
-DLLEXPORT void SystemNative_GetDomainSocketSizes(int32_t* pathOffset, int32_t* pathSize, int32_t* addressSize);
+PALEXPORT void SystemNative_GetDomainSocketSizes(int32_t* pathOffset, int32_t* pathSize, int32_t* addressSize);
-DLLEXPORT int32_t SystemNative_SendFile(intptr_t out_fd, intptr_t in_fd, int64_t offset, int64_t count, int64_t* sent);
+PALEXPORT int32_t SystemNative_SendFile(intptr_t out_fd, intptr_t in_fd, int64_t offset, int64_t count, int64_t* sent);
-DLLEXPORT int32_t SystemNative_Disconnect(intptr_t socket);
+PALEXPORT int32_t SystemNative_Disconnect(intptr_t socket);
-DLLEXPORT uint32_t SystemNative_InterfaceNameToIndex(char* interfaceName);
+PALEXPORT uint32_t SystemNative_InterfaceNameToIndex(char* interfaceName);
uint64_t Flags;
} NativeIPInterfaceStatistics;
-DLLEXPORT int32_t SystemNative_GetTcpGlobalStatistics(TcpGlobalStatistics* retStats);
+PALEXPORT int32_t SystemNative_GetTcpGlobalStatistics(TcpGlobalStatistics* retStats);
-DLLEXPORT int32_t SystemNative_GetIPv4GlobalStatistics(IPv4GlobalStatistics* retStats);
+PALEXPORT int32_t SystemNative_GetIPv4GlobalStatistics(IPv4GlobalStatistics* retStats);
-DLLEXPORT int32_t SystemNative_GetUdpGlobalStatistics(UdpGlobalStatistics* retStats);
+PALEXPORT int32_t SystemNative_GetUdpGlobalStatistics(UdpGlobalStatistics* retStats);
-DLLEXPORT int32_t SystemNative_GetIcmpv4GlobalStatistics(Icmpv4GlobalStatistics* retStats);
+PALEXPORT int32_t SystemNative_GetIcmpv4GlobalStatistics(Icmpv4GlobalStatistics* retStats);
-DLLEXPORT int32_t SystemNative_GetIcmpv6GlobalStatistics(Icmpv6GlobalStatistics* retStats);
+PALEXPORT int32_t SystemNative_GetIcmpv6GlobalStatistics(Icmpv6GlobalStatistics* retStats);
-DLLEXPORT int32_t SystemNative_GetEstimatedTcpConnectionCount(void);
+PALEXPORT int32_t SystemNative_GetEstimatedTcpConnectionCount(void);
-DLLEXPORT int32_t SystemNative_GetActiveTcpConnectionInfos(NativeTcpConnectionInformation* infos, int32_t* infoCount);
+PALEXPORT int32_t SystemNative_GetActiveTcpConnectionInfos(NativeTcpConnectionInformation* infos, int32_t* infoCount);
-DLLEXPORT int32_t SystemNative_GetEstimatedUdpListenerCount(void);
+PALEXPORT int32_t SystemNative_GetEstimatedUdpListenerCount(void);
-DLLEXPORT int32_t SystemNative_GetActiveUdpListeners(IPEndPointInfo* infos, int32_t* infoCount);
+PALEXPORT int32_t SystemNative_GetActiveUdpListeners(IPEndPointInfo* infos, int32_t* infoCount);
-DLLEXPORT int32_t SystemNative_GetNativeIPInterfaceStatistics(char* interfaceName, NativeIPInterfaceStatistics* retStats);
+PALEXPORT int32_t SystemNative_GetNativeIPInterfaceStatistics(char* interfaceName, NativeIPInterfaceStatistics* retStats);
-DLLEXPORT int32_t SystemNative_GetNumRoutes(void);
+PALEXPORT int32_t SystemNative_GetNumRoutes(void);
* As would have been the case with fork/execve, a return value of 0 is success and -1
* is failure; if failure, error information is provided in errno.
*/
-DLLEXPORT int32_t SystemNative_ForkAndExecProcess(
+PALEXPORT int32_t SystemNative_ForkAndExecProcess(
const char* filename, // filename argument to execve
char* const argv[], // argv argument to execve
char* const envp[], // envp argument to execve
/**
* Shim for the popen function.
*/
-DLLEXPORT FILE* SystemNative_POpen(const char* command, const char* type);
+PALEXPORT FILE* SystemNative_POpen(const char* command, const char* type);
/**
* Shim for the pclose function.
*/
-DLLEXPORT int32_t SystemNative_PClose(FILE* stream);
+PALEXPORT int32_t SystemNative_PClose(FILE* stream);
/************
* The values below in the header are fixed and correct for managed callers to use forever.
* Get the current limit for the specified resource of the current process.
* Returns 0 on success; returns -1 on failure and errno is set to the error reason.
*/
-DLLEXPORT int32_t SystemNative_GetRLimit(RLimitResources resourceType, RLimit* limits);
+PALEXPORT int32_t SystemNative_GetRLimit(RLimitResources resourceType, RLimit* limits);
/**
* Set the soft and hard limits for the specified resource.
* Only a super-user can increase hard limits for the current process.
* Returns 0 on success; returns -1 on failure and errno is set to the error reason.
*/
-DLLEXPORT int32_t SystemNative_SetRLimit(RLimitResources resourceType, const RLimit* limits);
+PALEXPORT int32_t SystemNative_SetRLimit(RLimitResources resourceType, const RLimit* limits);
/**
* Kill the specified process (or process group) identified by the supplied pid; the
* process or process group will be killed by the specified signal.
* Returns 0 on success; on failure, -1 is returned and errno is set
*/
-DLLEXPORT int32_t SystemNative_Kill(int32_t pid, int32_t signal);
+PALEXPORT int32_t SystemNative_Kill(int32_t pid, int32_t signal);
/**
* Returns the Process ID of the current executing process.
* This call should never fail
*/
-DLLEXPORT int32_t SystemNative_GetPid(void);
+PALEXPORT int32_t SystemNative_GetPid(void);
/**
* Returns the sessions ID of the specified process; if 0 is passed in, returns the
* session ID of the current process.
* Returns a session ID on success; otherwise, returns -1 and sets errno.
*/
-DLLEXPORT int32_t SystemNative_GetSid(int32_t pid);
+PALEXPORT int32_t SystemNative_GetSid(int32_t pid);
/**
* Write a message to the system logger, which in turn writes the message to the system console, log files, etc.
* See man 3 syslog for more info
*/
-DLLEXPORT void SystemNative_SysLog(SysLogPriority priority, const char* message, const char* arg1);
+PALEXPORT void SystemNative_SysLog(SysLogPriority priority, const char* message, const char* arg1);
/**
* Returns the pid of a terminated child without reaping it.
* 2) if no children are terminated, 0 is returned
* 3) on error, -1 is returned
*/
-DLLEXPORT int32_t SystemNative_WaitIdAnyExitedNoHangNoWait(void);
+PALEXPORT int32_t SystemNative_WaitIdAnyExitedNoHangNoWait(void);
/**
* Reaps a terminated child.
* 3) if the child has not yet terminated, 0 is returned
* 4) on error, -1 is returned.
*/
-DLLEXPORT int32_t SystemNative_WaitPidExitedNoHang(int32_t pid, int32_t* exitCode);
+PALEXPORT int32_t SystemNative_WaitPidExitedNoHang(int32_t pid, int32_t* exitCode);
/**
* Gets the configurable limit or variable for system path or file descriptor options.
* Returns the requested variable value on success; if the variable does not have a limit, -1 is returned and errno
* is not set; otherwise, -1 is returned and errno is set.
*/
-DLLEXPORT int64_t SystemNative_PathConf(const char* path, PathConfName name);
+PALEXPORT int64_t SystemNative_PathConf(const char* path, PathConfName name);
/**
* Gets the priority (nice value) of a certain execution group.
* valid nice value, meaning we can't use that value to determine valid output or not. Errno is set on failure so
* we need to reset errno before a call and check the value if we get -1.
*/
-DLLEXPORT int32_t SystemNative_GetPriority(PriorityWhich which, int32_t who);
+PALEXPORT int32_t SystemNative_GetPriority(PriorityWhich which, int32_t who);
/**
* Sets the priority (nice value) of a certain execution group.
*
* Returns 0 on success; otherwise, -1 and errno is set.
*/
-DLLEXPORT int32_t SystemNative_SetPriority(PriorityWhich which, int32_t who, int32_t nice);
+PALEXPORT int32_t SystemNative_SetPriority(PriorityWhich which, int32_t who, int32_t nice);
/**
* Gets the current working directory of the currently executing process.
*/
-DLLEXPORT char* SystemNative_GetCwd(char* buffer, int32_t bufferSize);
+PALEXPORT char* SystemNative_GetCwd(char* buffer, int32_t bufferSize);
#if HAVE_SCHED_SETAFFINITY
/**
*
* Returns 0 on success; otherwise, -1 is returned and errno is set
*/
-DLLEXPORT int32_t SystemNative_SchedSetAffinity(int32_t pid, intptr_t* mask);
+PALEXPORT int32_t SystemNative_SchedSetAffinity(int32_t pid, intptr_t* mask);
#endif
#if HAVE_SCHED_GETAFFINITY
*
* Returns 0 on success; otherwise, -1 is returned and errno is set.
*/
-DLLEXPORT int32_t SystemNative_SchedGetAffinity(int32_t pid, intptr_t* mask);
+PALEXPORT int32_t SystemNative_SchedGetAffinity(int32_t pid, intptr_t* mask);
#endif
#include "pal_compiler.h"
#include "pal_types.h"
-DLLEXPORT void SystemNative_GetNonCryptographicallySecureRandomBytes(uint8_t* buffer, int32_t bufferLength);
+PALEXPORT void SystemNative_GetNonCryptographicallySecureRandomBytes(uint8_t* buffer, int32_t bufferLength);
#include "pal_compiler.h"
#include "pal_types.h"
-DLLEXPORT int32_t SystemNative_GetNodeName(char* version, int* capacity);
+PALEXPORT int32_t SystemNative_GetNodeName(char* version, int* capacity);
#include "pal_compiler.h"
#include "pal_types.h"
-DLLEXPORT const char* SystemNative_GetUnixName(void);
+PALEXPORT const char* SystemNative_GetUnixName(void);
-DLLEXPORT char* SystemNative_GetUnixRelease(void);
+PALEXPORT char* SystemNative_GetUnixRelease(void);
-DLLEXPORT int32_t SystemNative_GetUnixVersion(char* version, int* capacity);
+PALEXPORT int32_t SystemNative_GetUnixVersion(char* version, int* capacity);
-DLLEXPORT int32_t SystemNative_GetOSArchitecture(void);
+PALEXPORT int32_t SystemNative_GetOSArchitecture(void);
-DLLEXPORT int32_t SystemNative_GetProcessArchitecture(void);
+PALEXPORT int32_t SystemNative_GetProcessArchitecture(void);
enum
{
*
* Should only be called when a callback is not currently registered.
*/
-DLLEXPORT void SystemNative_RegisterForCtrl(CtrlCallback callback);
+PALEXPORT void SystemNative_RegisterForCtrl(CtrlCallback callback);
/**
* Unregisters the previously registered ctrlCCallback.
* previously registered must remain valid until all ctrl handling activity
* has quiesced.
*/
-DLLEXPORT void SystemNative_UnregisterForCtrl(void);
+PALEXPORT void SystemNative_UnregisterForCtrl(void);
typedef void (*SigChldCallback)(int reapAll);
*
* Should only be called when a callback is not currently registered.
*/
-DLLEXPORT void SystemNative_RegisterForSigChld(SigChldCallback callback);
+PALEXPORT void SystemNative_RegisterForSigChld(SigChldCallback callback);
/**
* Remove our handler and reissue the signal to be picked up by the previously registered handler.
* In the most common case, this will be the default handler, causing the process to be torn down.
* It could also be a custom handler registered by other code before us.
*/
-DLLEXPORT void SystemNative_RestoreAndHandleCtrl(CtrlCode ctrlCode);
+PALEXPORT void SystemNative_RestoreAndHandleCtrl(CtrlCode ctrlCode);
typedef void (*TerminalInvalidationCallback)(void);
* Hooks up the specified callback for notifications when SIGCHLD, SIGCONT, SIGWINCH are received.
*
*/
-DLLEXPORT void SystemNative_SetTerminalInvalidationHandler(TerminalInvalidationCallback callback);
+PALEXPORT void SystemNative_SetTerminalInvalidationHandler(TerminalInvalidationCallback callback);
* success; if the return value is equal to the size then the result may have been truncated.
* On failure, returns a negative value.
*/
-DLLEXPORT int32_t SystemNative_SNPrintF(char* string, int32_t size, const char* format, ...);
+PALEXPORT int32_t SystemNative_SNPrintF(char* string, int32_t size, const char* format, ...);
#include "pal_types.h"
#include "pal_errno.h"
-DLLEXPORT int32_t SystemNative_Sysctl(int* name, unsigned int namelen, void* value, size_t* len);
+PALEXPORT int32_t SystemNative_Sysctl(int* name, unsigned int namelen, void* value, size_t* len);
TcpState_DeleteTcb
} TcpState;
-DLLEXPORT int32_t SystemNative_MapTcpState(int32_t tcpState);
+PALEXPORT int32_t SystemNative_MapTcpState(int32_t tcpState);
*
* Returns 0 on success; otherwise, returns -1 and errno is set.
*/
-DLLEXPORT int32_t SystemNative_UTimensat(const char* path, TimeSpec* times);
+PALEXPORT int32_t SystemNative_UTimensat(const char* path, TimeSpec* times);
/**
* Gets the resolution of the timestamp, in counts per second.
*/
-DLLEXPORT uint64_t SystemNative_GetTimestampResolution(void);
+PALEXPORT uint64_t SystemNative_GetTimestampResolution(void);
/**
* Gets a high-resolution timestamp that can be used for time-interval measurements.
*/
-DLLEXPORT uint64_t SystemNative_GetTimestamp(void);
+PALEXPORT uint64_t SystemNative_GetTimestamp(void);
/**
* The main purpose of this function is to compute the overall CPU utilization
* returned is sum of utilization accross all processors, e.g. this function will
* return 200 when two cores are running at 100%.
*/
-DLLEXPORT int32_t SystemNative_GetCpuUtilization(ProcessCpuInformation* previousCpuInfo);
+PALEXPORT int32_t SystemNative_GetCpuUtilization(ProcessCpuInformation* previousCpuInfo);
* number for any other failure.
*
*/
-DLLEXPORT int32_t SystemNative_GetPwUidR(uint32_t uid, Passwd* pwd, char* buf, int32_t buflen);
+PALEXPORT int32_t SystemNative_GetPwUidR(uint32_t uid, Passwd* pwd, char* buf, int32_t buflen);
/**
* Gets a password structure for the given user name.
* Returns 0 for success, -1 if no entry found, positive error
* number for any other failure.
*/
-DLLEXPORT int32_t SystemNative_GetPwNamR(const char* name, Passwd* pwd, char* buf, int32_t buflen);
+PALEXPORT int32_t SystemNative_GetPwNamR(const char* name, Passwd* pwd, char* buf, int32_t buflen);
/**
* Gets and returns the effective user's identity.
*
* Always succeeds.
*/
-DLLEXPORT uint32_t SystemNative_GetEUid(void);
+PALEXPORT uint32_t SystemNative_GetEUid(void);
/**
* Gets and returns the effective group's identity.
*
* Always succeeds.
*/
-DLLEXPORT uint32_t SystemNative_GetEGid(void);
+PALEXPORT uint32_t SystemNative_GetEGid(void);
/**
* Sets the effective user ID of the calling process
*
* Returns 0 for success. On error, -1 is returned and errno is set.
*/
-DLLEXPORT int32_t SystemNative_SetEUid(uint32_t euid);
+PALEXPORT int32_t SystemNative_SetEUid(uint32_t euid);
/**
* Gets the list of groups to which a user belongs.
* If the buffer is too small, -1 is returned and ngroups contains the required size.
* On error, -1 is returned and errno is set.
*/
-DLLEXPORT int32_t SystemNative_GetGroupList(const char* name, uint32_t group, uint32_t* groups, int32_t* ngroups);
+PALEXPORT int32_t SystemNative_GetGroupList(const char* name, uint32_t group, uint32_t* groups, int32_t* ngroups);
/**
* Gets and returns the real user's identity.
*
* Always succeeds.
*/
-DLLEXPORT uint32_t SystemNative_GetUid(void);
+PALEXPORT uint32_t SystemNative_GetUid(void);
/*
Shims the gss_release_buffer method.
*/
-DLLEXPORT void NetSecurityNative_ReleaseGssBuffer(void* buffer, uint64_t length);
+PALEXPORT void NetSecurityNative_ReleaseGssBuffer(void* buffer, uint64_t length);
/*
Shims the gss_display_status method for minor status (status_type = GSS_C_MECH_CODE).
*/
-DLLEXPORT uint32_t
+PALEXPORT uint32_t
NetSecurityNative_DisplayMinorStatus(uint32_t* minorStatus, uint32_t statusValue, PAL_GssBuffer* outBuffer);
/*
Shims the gss_display_status method for major status (status_type = GSS_C_GSS_CODE).
*/
-DLLEXPORT uint32_t
+PALEXPORT uint32_t
NetSecurityNative_DisplayMajorStatus(uint32_t* minorStatus, uint32_t statusValue, PAL_GssBuffer* outBuffer);
/*
Shims the gss_import_name method with nametype = GSS_C_NT_USER_NAME.
*/
-DLLEXPORT uint32_t
+PALEXPORT uint32_t
NetSecurityNative_ImportUserName(uint32_t* minorStatus, char* inputName, uint32_t inputNameLen, GssName** outputName);
/*
Shims the gss_import_name method with nametype = GSS_C_NT_USER_NAME.
*/
-DLLEXPORT uint32_t NetSecurityNative_ImportPrincipalName(uint32_t* minorStatus,
+PALEXPORT uint32_t NetSecurityNative_ImportPrincipalName(uint32_t* minorStatus,
char* inputName,
uint32_t inputNameLen,
GssName** outputName);
/*
Shims the gss_release_name method.
*/
-DLLEXPORT uint32_t NetSecurityNative_ReleaseName(uint32_t* minorStatus, GssName** inputName);
+PALEXPORT uint32_t NetSecurityNative_ReleaseName(uint32_t* minorStatus, GssName** inputName);
/*
Shims the gss_acquire_cred method with GSS_C_ACCEPT.
*/
-DLLEXPORT uint32_t NetSecurityNative_AcquireAcceptorCred(uint32_t* minorStatus, GssCredId** outputCredHandle);
+PALEXPORT uint32_t NetSecurityNative_AcquireAcceptorCred(uint32_t* minorStatus, GssCredId** outputCredHandle);
/*
Shims the gss_acquire_cred method with SPNEGO oids with GSS_C_INITIATE.
*/
-DLLEXPORT uint32_t
+PALEXPORT uint32_t
NetSecurityNative_InitiateCredSpNego(uint32_t* minorStatus, GssName* desiredName, GssCredId** outputCredHandle);
/*
Shims the gss_release_cred method.
*/
-DLLEXPORT uint32_t NetSecurityNative_ReleaseCred(uint32_t* minorStatus, GssCredId** credHandle);
+PALEXPORT uint32_t NetSecurityNative_ReleaseCred(uint32_t* minorStatus, GssCredId** credHandle);
/*
Shims the gss_init_sec_context method with SPNEGO oids.
*/
-DLLEXPORT uint32_t NetSecurityNative_InitSecContext(uint32_t* minorStatus,
+PALEXPORT uint32_t NetSecurityNative_InitSecContext(uint32_t* minorStatus,
GssCredId* claimantCredHandle,
GssCtxId** contextHandle,
uint32_t isNtlm,
uint32_t* retFlags,
int32_t* isNtlmUsed);
-DLLEXPORT uint32_t NetSecurityNative_InitSecContextEx(uint32_t* minorStatus,
+PALEXPORT uint32_t NetSecurityNative_InitSecContextEx(uint32_t* minorStatus,
GssCredId* claimantCredHandle,
GssCtxId** contextHandle,
uint32_t isNtlm,
/*
Shims the gss_accept_sec_context method.
*/
-DLLEXPORT uint32_t NetSecurityNative_AcceptSecContext(uint32_t* minorStatus,
+PALEXPORT uint32_t NetSecurityNative_AcceptSecContext(uint32_t* minorStatus,
GssCredId* acceptorCredHandle,
GssCtxId** contextHandle,
uint8_t* inputBytes,
Shims the gss_delete_sec_context method.
*/
-DLLEXPORT uint32_t NetSecurityNative_DeleteSecContext(uint32_t* minorStatus, GssCtxId** contextHandle);
+PALEXPORT uint32_t NetSecurityNative_DeleteSecContext(uint32_t* minorStatus, GssCtxId** contextHandle);
/*
Shims the gss_wrap method.
*/
-DLLEXPORT uint32_t NetSecurityNative_Wrap(uint32_t* minorStatus,
+PALEXPORT uint32_t NetSecurityNative_Wrap(uint32_t* minorStatus,
GssCtxId* contextHandle,
int32_t isEncrypt,
uint8_t* inputBytes,
/*
Shims the gss_unwrap method.
*/
-DLLEXPORT uint32_t NetSecurityNative_Unwrap(uint32_t* minorStatus,
+PALEXPORT uint32_t NetSecurityNative_Unwrap(uint32_t* minorStatus,
GssCtxId* contextHandle,
uint8_t* inputBytes,
int32_t offset,
/*
Shims the gss_acquire_cred_with_password method with GSS_C_INITIATE.
*/
-DLLEXPORT uint32_t NetSecurityNative_InitiateCredWithPassword(uint32_t* minorStatus,
+PALEXPORT uint32_t NetSecurityNative_InitiateCredWithPassword(uint32_t* minorStatus,
int32_t isNtlm,
GssName* desiredName,
char* password,
/*
Shims the gss_indicate_mechs method to detect if NTLM mech is installed.
*/
-DLLEXPORT uint32_t NetSecurityNative_IsNtlmInstalled(void);
+PALEXPORT uint32_t NetSecurityNative_IsNtlmInstalled(void);
/*
Shims gss_inquire_context and gss_display_name to get the remote user principal name.
*/
-DLLEXPORT uint32_t NetSecurityNative_GetUser(uint32_t* minorStatus,
+PALEXPORT uint32_t NetSecurityNative_GetUser(uint32_t* minorStatus,
GssCtxId* contextHandle,
PAL_GssBuffer* outBuffer);
/*
Free the resources held by a DigestCtx
*/
-DLLEXPORT void AppleCryptoNative_DigestFree(DigestCtx* pDigest);
+PALEXPORT void AppleCryptoNative_DigestFree(DigestCtx* pDigest);
/*
Create a digest handle for the specified algorithm.
to a digest context suitable for calling DigestUpdate and DigestFinal on and sets pcbDigest to
the size of the digest output.
*/
-DLLEXPORT DigestCtx* AppleCryptoNative_DigestCreate(PAL_HashAlgorithm algorithm, int32_t* pcbDigest);
+PALEXPORT DigestCtx* AppleCryptoNative_DigestCreate(PAL_HashAlgorithm algorithm, int32_t* pcbDigest);
/*
Apply cbBuf bytes of data from pBuf to the ongoing digest represented in ctx.
Returns 1 on success, 0 on failure, any other value on invalid inputs/state.
*/
-DLLEXPORT int32_t AppleCryptoNative_DigestUpdate(DigestCtx* ctx, uint8_t* pBuf, int32_t cbBuf);
+PALEXPORT int32_t AppleCryptoNative_DigestUpdate(DigestCtx* ctx, uint8_t* pBuf, int32_t cbBuf);
/*
Complete the digest in ctx, copying the results to pOutput, and reset ctx for a new digest.
Returns 1 on success, 0 on failure, any other value on invalid inputs/state.
*/
-DLLEXPORT int32_t AppleCryptoNative_DigestFinal(DigestCtx* ctx, uint8_t* pOutput, int32_t cbOutput);
+PALEXPORT int32_t AppleCryptoNative_DigestFinal(DigestCtx* ctx, uint8_t* pOutput, int32_t cbOutput);
Returns 1 on success, 0 on failure. On failure, *pOSStatus should carry the OS failure code.
*/
-DLLEXPORT int32_t AppleCryptoNative_EccGenerateKey(int32_t keySizeBits,
+PALEXPORT int32_t AppleCryptoNative_EccGenerateKey(int32_t keySizeBits,
SecKeychainRef tempKeychain,
SecKeyRef* pPublicKey,
SecKeyRef* pPrivateKey,
Returns the keysize, in bits, of the ECC key, or 0 on error.
*/
-DLLEXPORT uint64_t AppleCryptoNative_EccGetKeySizeInBits(SecKeyRef publicKey);
+PALEXPORT uint64_t AppleCryptoNative_EccGetKeySizeInBits(SecKeyRef publicKey);
/*
Free a HmacCtx created by AppleCryptoNative_HmacCreate
*/
-DLLEXPORT void AppleCryptoNative_HmacFree(HmacCtx* pHmac);
+PALEXPORT void AppleCryptoNative_HmacFree(HmacCtx* pHmac);
/*
Create an HmacCtx for the specified algorithm, receiving the hash output size in pcbHmac.
Returns NULL on error, an unkeyed HmacCtx otherwise.
*/
-DLLEXPORT HmacCtx* AppleCryptoNative_HmacCreate(PAL_HashAlgorithm algorithm, int32_t* pcbHmac);
+PALEXPORT HmacCtx* AppleCryptoNative_HmacCreate(PAL_HashAlgorithm algorithm, int32_t* pcbHmac);
/*
Initialize an HMAC to the correct key and start state.
Returns 1 on success, 0 on error.
*/
-DLLEXPORT int32_t AppleCryptoNative_HmacInit(HmacCtx* ctx, uint8_t* pbKey, int32_t cbKey);
+PALEXPORT int32_t AppleCryptoNative_HmacInit(HmacCtx* ctx, uint8_t* pbKey, int32_t cbKey);
/*
Add data into the HMAC
Returns 1 on success, 0 on error.
*/
-DLLEXPORT int32_t AppleCryptoNative_HmacUpdate(HmacCtx* ctx, uint8_t* pbData, int32_t cbData);
+PALEXPORT int32_t AppleCryptoNative_HmacUpdate(HmacCtx* ctx, uint8_t* pbData, int32_t cbData);
/*
Complete the HMAC and copy the result into pbOutput.
Returns 1 on success, 0 on error.
*/
-DLLEXPORT int32_t AppleCryptoNative_HmacFinal(HmacCtx* ctx, uint8_t* pbOutput);
+PALEXPORT int32_t AppleCryptoNative_HmacFinal(HmacCtx* ctx, uint8_t* pbOutput);
Follows pal_seckey return conventions.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
AppleCryptoNative_EcdhKeyAgree(SecKeyRef privateKey, SecKeyRef publicKey, CFDataRef* pAgreeOut, CFErrorRef* pErrorOut);
For all other situations, see SecKeychainItemCopyKeychain documentation.
*/
-DLLEXPORT int32_t AppleCryptoNative_SecKeychainItemCopyKeychain(SecKeychainItemRef item, SecKeychainRef* pKeychainOut);
+PALEXPORT int32_t AppleCryptoNative_SecKeychainItemCopyKeychain(SecKeychainItemRef item, SecKeychainRef* pKeychainOut);
/*
Create a keychain at the specified location with a given (UTF-8 encoded) lock passphrase.
Output:
pKeychainOut: The SecKeychainRef created by this function
*/
-DLLEXPORT int32_t AppleCryptoNative_SecKeychainCreate(const char* pathName,
+PALEXPORT int32_t AppleCryptoNative_SecKeychainCreate(const char* pathName,
uint32_t passphraseLength,
const uint8_t* passphraseUtf8,
SecKeychainRef* pKeychainOut);
Returns the result of SecKeychainDelete
*/
-DLLEXPORT int32_t AppleCryptoNative_SecKeychainDelete(SecKeychainRef keychain);
+PALEXPORT int32_t AppleCryptoNative_SecKeychainDelete(SecKeychainRef keychain);
/*
Open the default keychain.
Output:
pKeyChainOut: Receives the SecKeychainRef for the default keychain.
*/
-DLLEXPORT int32_t AppleCryptoNative_SecKeychainCopyDefault(SecKeychainRef* pKeychainOut);
+PALEXPORT int32_t AppleCryptoNative_SecKeychainCopyDefault(SecKeychainRef* pKeychainOut);
/*
Open the named keychain (full path to the file).
Output:
pKeychainOut: Receives the SecKeychainRef for the named keychain.
*/
-DLLEXPORT int32_t AppleCryptoNative_SecKeychainOpen(const char* pszKeychainPath, SecKeychainRef* pKeychainOut);
+PALEXPORT int32_t AppleCryptoNative_SecKeychainOpen(const char* pszKeychainPath, SecKeychainRef* pKeychainOut);
/*
Unlock an opened keychain with a given (UTF-8 encoded) lock passphrase.
Returns the result of SecKeychainUnlock.
*/
-DLLEXPORT int32_t AppleCryptoNative_SecKeychainUnlock(SecKeychainRef keychain,
+PALEXPORT int32_t AppleCryptoNative_SecKeychainUnlock(SecKeychainRef keychain,
uint32_t passphraseLength,
const uint8_t* passphraseUtf8);
Returns the result of SecKeychainSetSettings to a never-auto-lock policy.
*/
-DLLEXPORT int32_t AppleCryptoNative_SetKeychainNeverLock(SecKeychainRef keychain);
+PALEXPORT int32_t AppleCryptoNative_SetKeychainNeverLock(SecKeychainRef keychain);
/*
Enumerate the certificate objects within the given keychain.
(including a single match).
pOSStatus: Receives the last OSStatus value.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
AppleCryptoNative_SecKeychainEnumerateCerts(SecKeychainRef keychain, CFArrayRef* pCertsOut, int32_t* pOSStatus);
/*
(including a single match).
pOSStatus: Receives the last OSStatus value.
*/
-DLLEXPORT int32_t AppleCryptoNative_SecKeychainEnumerateIdentities(SecKeychainRef keychain,
+PALEXPORT int32_t AppleCryptoNative_SecKeychainEnumerateIdentities(SecKeychainRef keychain,
CFArrayRef* pIdentitiesOut,
int32_t* pOSStatus);
Output:
pOSStatus: Receives the last OSStatus value..
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
AppleCryptoNative_X509StoreAddCertificate(CFTypeRef certOrIdentity, SecKeychainRef keychain, int32_t* pOSStatus);
/*
Output:
pOSStatus: Receives the last OSStatus value..
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
AppleCryptoNative_X509StoreRemoveCertificate(CFTypeRef certOrIdentity, SecKeychainRef keychain, uint8_t isReadOnlyMode, int32_t* pOSStatus);
Returns 1 on success, 0 on system error (see pkCCStatus), -1 on input error.
*/
-DLLEXPORT int32_t AppleCryptoNative_GetRandomBytes(uint8_t* pBuf, uint32_t cbBuf, int32_t* pkCCStatus);
+PALEXPORT int32_t AppleCryptoNative_GetRandomBytes(uint8_t* pBuf, uint32_t cbBuf, int32_t* pkCCStatus);
Returns 1 on success, 0 on failure. On failure, *pOSStatus should contain the OS reported error.
*/
-DLLEXPORT int32_t AppleCryptoNative_RsaGenerateKey(int32_t keySizeBits,
+PALEXPORT int32_t AppleCryptoNative_RsaGenerateKey(int32_t keySizeBits,
SecKeychainRef tempKeychain,
SecKeyRef* pPublicKey,
SecKeyRef* pPrivateKey,
Follows pal_seckey return conventions.
*/
-DLLEXPORT int32_t AppleCryptoNative_RsaDecryptOaep(SecKeyRef privateKey,
+PALEXPORT int32_t AppleCryptoNative_RsaDecryptOaep(SecKeyRef privateKey,
uint8_t* pbData,
int32_t cbData,
PAL_HashAlgorithm mfgAlgorithm,
Follows pal_seckey return conventions.
*/
-DLLEXPORT int32_t AppleCryptoNative_RsaDecryptPkcs(
+PALEXPORT int32_t AppleCryptoNative_RsaDecryptPkcs(
SecKeyRef privateKey, uint8_t* pbData, int32_t cbData, CFDataRef* pDecryptedOut, CFErrorRef* pErrorOut);
/*
Follows pal_seckey return conventions.
*/
-DLLEXPORT int32_t AppleCryptoNative_RsaEncryptOaep(SecKeyRef publicKey,
+PALEXPORT int32_t AppleCryptoNative_RsaEncryptOaep(SecKeyRef publicKey,
uint8_t* pbData,
int32_t cbData,
PAL_HashAlgorithm mgfAlgorithm,
Follows pal_seckey return conventions.
*/
-DLLEXPORT int32_t AppleCryptoNative_RsaEncryptPkcs(
+PALEXPORT int32_t AppleCryptoNative_RsaEncryptPkcs(
SecKeyRef publicKey, uint8_t* pbData, int32_t cbData, CFDataRef* pEncryptedOut, CFErrorRef* pErrorOut);
/*
Follows pal_seckey return conventions.
*/
-DLLEXPORT int32_t AppleCryptoNative_RsaSignaturePrimitive(
+PALEXPORT int32_t AppleCryptoNative_RsaSignaturePrimitive(
SecKeyRef privateKey, uint8_t* pbData, int32_t cbData, CFDataRef* pDataOut, CFErrorRef* pErrorOut);
/*
Follows pal_seckey return conventions.
*/
-DLLEXPORT int32_t AppleCryptoNative_RsaDecryptionPrimitive(
+PALEXPORT int32_t AppleCryptoNative_RsaDecryptionPrimitive(
SecKeyRef privateKey, uint8_t* pbData, int32_t cbData, CFDataRef* pDataOut, CFErrorRef* pErrorOut);
/*
Follows pal_seckey return conventions.
*/
-DLLEXPORT int32_t AppleCryptoNative_RsaEncryptionPrimitive(
+PALEXPORT int32_t AppleCryptoNative_RsaEncryptionPrimitive(
SecKeyRef publicKey, uint8_t* pbData, int32_t cbData, CFDataRef* pDataOut, CFErrorRef* pErrorOut);
/*
Follows pal_seckey return conventions.
*/
-DLLEXPORT int32_t AppleCryptoNative_RsaVerificationPrimitive(
+PALEXPORT int32_t AppleCryptoNative_RsaVerificationPrimitive(
SecKeyRef publicKey, uint8_t* pbData, int32_t cbData, CFDataRef* pDataOut, CFErrorRef* pErrorOut);
Returns NULL if no message is available for the code.
*/
-DLLEXPORT CFStringRef AppleCryptoNative_SecCopyErrorMessageString(OSStatus osStatus);
+PALEXPORT CFStringRef AppleCryptoNative_SecCopyErrorMessageString(OSStatus osStatus);
Follows pal_seckey return conventions.
*/
-DLLEXPORT int32_t AppleCryptoNative_SecKeyExport(
+PALEXPORT int32_t AppleCryptoNative_SecKeyExport(
SecKeyRef pKey, int32_t exportPrivate, CFStringRef cfExportPassphrase, CFDataRef* ppDataOut, int32_t* pOSStatus);
/*
Returns 1 on success, 0 on failure (*pOSStatus should be set) and negative numbers for various
state machine errors.
*/
-DLLEXPORT int32_t AppleCryptoNative_SecKeyImportEphemeral(
+PALEXPORT int32_t AppleCryptoNative_SecKeyImportEphemeral(
uint8_t* pbKeyBlob, int32_t cbKeyBlob, int32_t isPrivateKey, SecKeyRef* ppKeyOut, int32_t* pOSStatus);
/*
0 is returned for invalid inputs.
*/
-DLLEXPORT uint64_t AppleCryptoNative_SecKeyGetSimpleKeySizeInBytes(SecKeyRef publicKey);
+PALEXPORT uint64_t AppleCryptoNative_SecKeyGetSimpleKeySizeInBytes(SecKeyRef publicKey);
/*
Export a key and re-import it to the NULL keychain.
Follows pal_seckey return conventions.
*/
-DLLEXPORT int32_t AppleCryptoNative_GenerateSignature(
+PALEXPORT int32_t AppleCryptoNative_GenerateSignature(
SecKeyRef privateKey, uint8_t* pbDataHash, int32_t cbDataHash, CFDataRef* pSignatureOut, CFErrorRef* pErrorOut);
/*
Follows pal_seckey return conventions.
*/
-DLLEXPORT int32_t AppleCryptoNative_GenerateSignatureWithHashAlgorithm(SecKeyRef privateKey,
+PALEXPORT int32_t AppleCryptoNative_GenerateSignatureWithHashAlgorithm(SecKeyRef privateKey,
uint8_t* pbDataHash,
int32_t cbDataHash,
PAL_HashAlgorithm hashAlgorithm,
Returns 1 when the signature is correct, 0 when it is incorrect, and otherwise
follows pal_seckey return conventions.
*/
-DLLEXPORT int32_t AppleCryptoNative_VerifySignatureWithHashAlgorithm(SecKeyRef publicKey,
+PALEXPORT int32_t AppleCryptoNative_VerifySignatureWithHashAlgorithm(SecKeyRef publicKey,
uint8_t* pbDataHash,
int32_t cbDataHash,
uint8_t* pbSignature,
Returns 1 when the signature is correct, 0 when it is incorrect, and otherwise
follows pal_seckey return conventions.
*/
-DLLEXPORT int32_t AppleCryptoNative_VerifySignature(SecKeyRef publicKey,
+PALEXPORT int32_t AppleCryptoNative_VerifySignature(SecKeyRef publicKey,
uint8_t* pbDataHash,
int32_t cbDataHash,
uint8_t* pbSignature,
Returns NULL if an invalid boolean is given for isServer, an SSLContextRef otherwise.
*/
-DLLEXPORT SSLContextRef AppleCryptoNative_SslCreateContext(int32_t isServer);
+PALEXPORT SSLContextRef AppleCryptoNative_SslCreateContext(int32_t isServer);
/*
Indicate that an SSL Context (in server mode) should allow a client to present a mutual auth cert.
Returns The result of SSLSetClientSideAuthenticate
*/
-DLLEXPORT int32_t AppleCryptoNative_SslSetAcceptClientCert(SSLContextRef sslContext);
+PALEXPORT int32_t AppleCryptoNative_SslSetAcceptClientCert(SSLContextRef sslContext);
/*
Assign a minimum to the TLS protocol version for this connection.
Returns the output of SSLSetProtocolVersionMin
*/
-DLLEXPORT int32_t AppleCryptoNative_SslSetMinProtocolVersion(SSLContextRef sslContext, PAL_SslProtocol sslProtocol);
+PALEXPORT int32_t AppleCryptoNative_SslSetMinProtocolVersion(SSLContextRef sslContext, PAL_SslProtocol sslProtocol);
/*
Assign a maximum to the TLS protocol version for this connection.
Returns the output of SSLSetProtocolVersionMax
*/
-DLLEXPORT int32_t AppleCryptoNative_SslSetMaxProtocolVersion(SSLContextRef sslContext, PAL_SslProtocol sslProtocol);
+PALEXPORT int32_t AppleCryptoNative_SslSetMaxProtocolVersion(SSLContextRef sslContext, PAL_SslProtocol sslProtocol);
/*
Get the SecTrustRef from the SSL context which represents the certificte chain.
pChainOut: Receives the SecTrustRef representing the populated chain
pOSStatus: Receives the value returned by SSLCopyPeerTrust
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
AppleCryptoNative_SslCopyCertChain(SSLContextRef sslContext, SecTrustRef* pChainOut, int32_t* pOSStatus);
/*
pOSStatus: Receives the output of SSLCopyDistinguishedNames.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
AppleCryptoNative_SslCopyCADistinguishedNames(SSLContextRef sslContext, CFArrayRef* pArrayOut, int32_t* pOSStatus);
/*
Output:
pOSStatus: Receives the value returned by SSLSetSessionOption
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
AppleCryptoNative_SslSetBreakOnServerAuth(SSLContextRef sslContext, int32_t setBreak, int32_t* pOSStatus);
/*
Output:
pOSStatus: Receives the value returned by SSLSetSessionOption
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
AppleCryptoNative_SslSetBreakOnClientAuth(SSLContextRef sslContext, int32_t setBreak, int32_t* pOSStatus);
/*
Returns the output of SSLSetCertificate
*/
-DLLEXPORT int32_t AppleCryptoNative_SslSetCertificate(SSLContextRef sslContext, CFArrayRef certRefs);
+PALEXPORT int32_t AppleCryptoNative_SslSetCertificate(SSLContextRef sslContext, CFArrayRef certRefs);
/*
Set the target hostname for SNI. pszTargetName must already be converted for IDNA if required.
Output:
pOSStatus: Receives the value for SSLSetPeerDomainName
*/
-DLLEXPORT int32_t AppleCryptoNative_SslSetTargetName(SSLContextRef sslContext,
+PALEXPORT int32_t AppleCryptoNative_SslSetTargetName(SSLContextRef sslContext,
const char* pszTargetName,
int32_t cbTargetName,
int32_t* pOSStatus);
Output:
pOSStatus: Receives the value from SSLSetALPNData()
*/
-DLLEXPORT int32_t AppleCryptoNative_SSLSetALPNProtocols(SSLContextRef sslContext, CFArrayRef protocols, int32_t* pOSStatus);
+PALEXPORT int32_t AppleCryptoNative_SSLSetALPNProtocols(SSLContextRef sslContext, CFArrayRef protocols, int32_t* pOSStatus);
/*
Get negotiated protocol value from ServerHello.
*/
-DLLEXPORT int32_t AppleCryptoNative_SslGetAlpnSelected(SSLContextRef sslContext, CFDataRef *protocol);
+PALEXPORT int32_t AppleCryptoNative_SslGetAlpnSelected(SSLContextRef sslContext, CFDataRef *protocol);
/*
Register the callbacks for reading and writing data to the SSL context.
Returns the output of SSLSetIOFuncs.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
AppleCryptoNative_SslSetIoCallbacks(SSLContextRef sslContext, SSLReadFunc readFunc, SSLWriteFunc writeFunc);
/*
Returns an indication of what state the error is in. Any negative number means an error occurred.
*/
-DLLEXPORT PAL_TlsHandshakeState AppleCryptoNative_SslHandshake(SSLContextRef sslContext);
+PALEXPORT PAL_TlsHandshakeState AppleCryptoNative_SslHandshake(SSLContextRef sslContext);
/*
Take bufLen bytes of cleartext data from buf and encrypt/frame the data.
which were read from buf. On PAL_TlsIo_Success the parameter is not written through (but must still
not be NULL)
*/
-DLLEXPORT PAL_TlsIo
+PALEXPORT PAL_TlsIo
AppleCryptoNative_SslWrite(SSLContextRef sslContext, const uint8_t* buf, uint32_t bufLen, uint32_t* bytesWritten);
/*
Output:
written: Receives the number of bytes written into buf
*/
-DLLEXPORT PAL_TlsIo
+PALEXPORT PAL_TlsIo
AppleCryptoNative_SslRead(SSLContextRef sslContext, uint8_t* buf, uint32_t bufLen, uint32_t* written);
/*
Returns 1 on match, 0 on mismatch, any other value indicates an invalid state.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
AppleCryptoNative_SslIsHostnameMatch(SSLContextRef sslContext, CFStringRef cfHostname, CFDateRef notBefore, int32_t* pOSStatus);
/*
Returns the output of SSLClose
*/
-DLLEXPORT int32_t AppleCryptoNative_SslShutdown(SSLContextRef sslContext);
+PALEXPORT int32_t AppleCryptoNative_SslShutdown(SSLContextRef sslContext);
/*
Retrieve the TLS Protocol Version (e.g. TLS1.2) for the current session.
Output:
pProtocol: Receives the protocol ID. PAL_SslProtocol_None is issued on error or an unknown mapping.
*/
-DLLEXPORT int32_t AppleCryptoNative_SslGetProtocolVersion(SSLContextRef sslContext, PAL_SslProtocol* pProtocol);
+PALEXPORT int32_t AppleCryptoNative_SslGetProtocolVersion(SSLContextRef sslContext, PAL_SslProtocol* pProtocol);
/*
Retrieve the TLS Cipher Suite which was negotiated for the current session.
pProtocol: The TLS CipherSuite value (from the RFC), e.g. ((uint16_t)0xC030) for
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
*/
-DLLEXPORT int32_t AppleCryptoNative_SslGetCipherSuite(SSLContextRef sslContext, uint16_t* pCipherSuiteOut);
+PALEXPORT int32_t AppleCryptoNative_SslGetCipherSuite(SSLContextRef sslContext, uint16_t* pCipherSuiteOut);
/*
Sets enabled cipher suites for the current session.
Returns the output of SSLSetEnabledCiphers.
*/
-DLLEXPORT int32_t AppleCryptoNative_SslSetEnabledCipherSuites(SSLContextRef sslContext, const uint32_t* cipherSuites, int32_t numCipherSuites);
+PALEXPORT int32_t AppleCryptoNative_SslSetEnabledCipherSuites(SSLContextRef sslContext, const uint32_t* cipherSuites, int32_t numCipherSuites);
/*
Free a CCCryptor created by AppleCryptoNative_CryptorCreate.
*/
-DLLEXPORT void AppleCryptoNative_CryptorFree(CCCryptorRef cryptor);
+PALEXPORT void AppleCryptoNative_CryptorFree(CCCryptorRef cryptor);
/*
Create a CCCryptor for the described symmetric algorithm with a chosen operation, chainingMode,
Returns 1 on success, 0 on system error, -1 on input error.
*/
-DLLEXPORT int32_t AppleCryptoNative_CryptorCreate(PAL_SymmetricOperation operation,
+PALEXPORT int32_t AppleCryptoNative_CryptorCreate(PAL_SymmetricOperation operation,
PAL_SymmetricAlgorithm algorithm,
PAL_ChainingMode chainingMode,
PAL_PaddingMode paddingMode,
Returns 1 on success, 0 on system error, -1 on input error.
*/
-DLLEXPORT int32_t AppleCryptoNative_CryptorUpdate(CCCryptorRef cryptor,
+PALEXPORT int32_t AppleCryptoNative_CryptorUpdate(CCCryptorRef cryptor,
const uint8_t* pbData,
int32_t cbData,
uint32_t* pbOutput,
Returns 1 on success, 0 on system error, -1 on input error.
*/
-DLLEXPORT int32_t AppleCryptoNative_CryptorFinal(
+PALEXPORT int32_t AppleCryptoNative_CryptorFinal(
CCCryptorRef cryptor, uint8_t* pbOutput, int32_t cbOutput, int32_t* pcbWritten, int32_t* pkCCStatus);
/*
Returns 1 on success, 0 on system error, -1 on input error.
*/
-DLLEXPORT int32_t AppleCryptoNative_CryptorReset(CCCryptorRef cryptor, const uint8_t* pbIv, int32_t* pkCCStatus);
+PALEXPORT int32_t AppleCryptoNative_CryptorReset(CCCryptorRef cryptor, const uint8_t* pbIv, int32_t* pkCCStatus);
(including a single match).
pOSStatus: Receives the last OSStatus value.
*/
-DLLEXPORT int32_t AppleCryptoNative_StoreEnumerateUserRoot(CFArrayRef* pCertsOut, int32_t* pOSStatusOut);
+PALEXPORT int32_t AppleCryptoNative_StoreEnumerateUserRoot(CFArrayRef* pCertsOut, int32_t* pOSStatusOut);
/*
Enumerate the certificates which are root trusted by the machine ("admin" and "system" domains).
(including a single match).
pOSStatus: Receives the last OSStatus value.
*/
-DLLEXPORT int32_t AppleCryptoNative_StoreEnumerateMachineRoot(CFArrayRef* pCertsOut, int32_t* pOSStatusOut);
+PALEXPORT int32_t AppleCryptoNative_StoreEnumerateMachineRoot(CFArrayRef* pCertsOut, int32_t* pOSStatusOut);
/*
Enumerate the certificates which are disallowed by the user.
(including a single match).
pOSStatus: Receives the last OSStatus value.
*/
-DLLEXPORT int32_t AppleCryptoNative_StoreEnumerateUserDisallowed(CFArrayRef* pCertsOut, int32_t* pOSStatusOut);
+PALEXPORT int32_t AppleCryptoNative_StoreEnumerateUserDisallowed(CFArrayRef* pCertsOut, int32_t* pOSStatusOut);
/*
Enumerate the certificates which are disallowed by the machine ("admin" and "system" domains).
(including a single match).
pOSStatus: Receives the last OSStatus value.
*/
-DLLEXPORT int32_t AppleCryptoNative_StoreEnumerateMachineDisallowed(CFArrayRef* pCertsOut, int32_t* pOSStatusOut);
+PALEXPORT int32_t AppleCryptoNative_StoreEnumerateMachineDisallowed(CFArrayRef* pCertsOut, int32_t* pOSStatusOut);
pCertOut: If handle is a certificate, receives handle, otherwise NULL
pIdentityut: If handle is an identity, receives handle, otherwise NULL
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
AppleCryptoNative_X509DemuxAndRetainHandle(CFTypeRef handle, SecCertificateRef* pCertOut, SecIdentityRef* pIdentityOut);
/*
pPublicKeyOut: Receives a CFRetain()ed SecKeyRef for the public key
pOSStatusOut: Receives the result of SecCertificateCopyKey or SecCertificateCopyPublicKey, depending on the OS version.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
AppleCryptoNative_X509GetPublicKey(SecCertificateRef cert, SecKeyRef* pPublicKeyOut, int32_t* pOSStatusOut);
/*
Returns the data (format) type of the provided input, PAL_X509Unknown if it cannot be determined.
*/
-DLLEXPORT PAL_X509ContentType AppleCryptoNative_X509GetContentType(uint8_t* pbData, int32_t cbData);
+PALEXPORT PAL_X509ContentType AppleCryptoNative_X509GetContentType(uint8_t* pbData, int32_t cbData);
/*
Extract a SecCertificateRef for the certificate from an identity handle.
Output:
pCertOut: Receives a SecCertificateRef for the certificate associated with the identity
*/
-DLLEXPORT int32_t AppleCryptoNative_X509CopyCertFromIdentity(SecIdentityRef identity, SecCertificateRef* pCertOut);
+PALEXPORT int32_t AppleCryptoNative_X509CopyCertFromIdentity(SecIdentityRef identity, SecCertificateRef* pCertOut);
/*
Extract a SecKeyRef for the private key from an identity handle.
Output:
pPrivateKeyOut: Receives a SecKeyRef for the private key associated with the identity
*/
-DLLEXPORT int32_t AppleCryptoNative_X509CopyPrivateKeyFromIdentity(SecIdentityRef identity, SecKeyRef* pPrivateKeyOut);
+PALEXPORT int32_t AppleCryptoNative_X509CopyPrivateKeyFromIdentity(SecIdentityRef identity, SecKeyRef* pPrivateKeyOut);
/*
Read cbData bytes of data from pbData and interpret it to a collection of certificates (or identities).
read out of the provided blob
pOSStatus: Receives the output of SecItemImport for the last attempted read
*/
-DLLEXPORT int32_t AppleCryptoNative_X509ImportCollection(uint8_t* pbData,
+PALEXPORT int32_t AppleCryptoNative_X509ImportCollection(uint8_t* pbData,
int32_t cbData,
PAL_X509ContentType contentType,
CFStringRef cfPfxPassphrase,
pIdentityOut: If the best matched value was an identity, receives the SecIdentityRef, otherwise receives NULL
pOSStatus: Receives the return of the last call to SecItemImport
*/
-DLLEXPORT int32_t AppleCryptoNative_X509ImportCertificate(uint8_t* pbData,
+PALEXPORT int32_t AppleCryptoNative_X509ImportCertificate(uint8_t* pbData,
int32_t cbData,
PAL_X509ContentType contentType,
CFStringRef cfPfxPassphrase,
pExportOut: Receives a CFDataRef with the exported blob
pOSStatus: Receives the result of SecItemExport
*/
-DLLEXPORT int32_t AppleCryptoNative_X509ExportData(CFArrayRef data,
+PALEXPORT int32_t AppleCryptoNative_X509ExportData(CFArrayRef data,
PAL_X509ContentType type,
CFStringRef cfExportPassphrase,
CFDataRef* pExportOut,
ppDataOut: Receives a CFDataRef with the exported blob
pOSStatus: Receives the result of SecItemExport
*/
-DLLEXPORT int32_t AppleCryptoNative_X509GetRawData(SecCertificateRef cert, CFDataRef* ppDataOut, int32_t* pOSStatus);
+PALEXPORT int32_t AppleCryptoNative_X509GetRawData(SecCertificateRef cert, CFDataRef* ppDataOut, int32_t* pOSStatus);
/*
Find a SecIdentityRef for the given cert and private key in the target keychain.
pIdentityOut: Receives the SecIdentityRef of the mated cert/key pair.
pOSStatus: Receives the result of the last executed system call.
*/
-DLLEXPORT int32_t AppleCryptoNative_X509CopyWithPrivateKey(SecCertificateRef cert,
+PALEXPORT int32_t AppleCryptoNative_X509CopyWithPrivateKey(SecCertificateRef cert,
SecKeyRef privateKey,
SecKeychainRef targetKeychain,
SecIdentityRef* pIdentityOut,
pIdentityOut: Receives the SecIdentityRef of the mated cert/key pair, when applicable.
pOSStatus: Receives the result of the last executed system call.
*/
-DLLEXPORT int32_t AppleCryptoNative_X509MoveToKeychain(SecCertificateRef cert,
+PALEXPORT int32_t AppleCryptoNative_X509MoveToKeychain(SecCertificateRef cert,
SecKeychainRef keychain,
SecKeyRef privateKey,
SecIdentityRef* pIdentityOut,
/*
Create a SecPolicyRef representing the basic X.509 policy
*/
-DLLEXPORT SecPolicyRef AppleCryptoNative_X509ChainCreateDefaultPolicy(void);
+PALEXPORT SecPolicyRef AppleCryptoNative_X509ChainCreateDefaultPolicy(void);
/*
Create a SecPolicyRef which checks for revocation (OCSP or CRL)
*/
-DLLEXPORT SecPolicyRef AppleCryptoNative_X509ChainCreateRevocationPolicy(void);
+PALEXPORT SecPolicyRef AppleCryptoNative_X509ChainCreateRevocationPolicy(void);
/*
Create a SecTrustRef to build a chain over the specified certificates with the given policies.
pTrustOut: Receives the SecTrustRef to build the chain, in an unbuilt state
pOSStatus: Receives the result of SecTrustCreateWithCertificates
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
AppleCryptoNative_X509ChainCreate(CFTypeRef certs, CFTypeRef policies, SecTrustRef* pTrustOut, int32_t* pOSStatus);
/*
Output:
pOSStatus: Receives the result of SecTrustEvaluate
*/
-DLLEXPORT int32_t AppleCryptoNative_X509ChainEvaluate(SecTrustRef chain,
+PALEXPORT int32_t AppleCryptoNative_X509ChainEvaluate(SecTrustRef chain,
CFDateRef cfEvaluationTime,
bool allowNetwork,
int32_t* pOSStatus);
/*
Gets the number of certificates in the chain.
*/
-DLLEXPORT int64_t AppleCryptoNative_X509ChainGetChainSize(SecTrustRef chain);
+PALEXPORT int64_t AppleCryptoNative_X509ChainGetChainSize(SecTrustRef chain);
/*
Fetches the SecCertificateRef at a given position in the chain. Position 0 is the End-Entity
certificate, postiion 1 is the issuer of position 0, et cetera.
*/
-DLLEXPORT SecCertificateRef AppleCryptoNative_X509ChainGetCertificateAtIndex(SecTrustRef chain, int64_t index);
+PALEXPORT SecCertificateRef AppleCryptoNative_X509ChainGetCertificateAtIndex(SecTrustRef chain, int64_t index);
/*
Get a CFRetain()ed array of dictionaries which contain the detailed results for each element in
the certificate chain.
*/
-DLLEXPORT CFArrayRef AppleCryptoNative_X509ChainGetTrustResults(SecTrustRef chain);
+PALEXPORT CFArrayRef AppleCryptoNative_X509ChainGetTrustResults(SecTrustRef chain);
/*
Get the PAL_X509ChainStatusFlags values for the certificate at the requested position within the
Output:
pdwStatus: Receives a flags value for the various status codes that went awry at the given position
*/
-DLLEXPORT int32_t AppleCryptoNative_X509ChainGetStatusAtIndex(CFArrayRef details, int64_t index, int32_t* pdwStatus);
+PALEXPORT int32_t AppleCryptoNative_X509ChainGetStatusAtIndex(CFArrayRef details, int64_t index, int32_t* pdwStatus);
/*
Looks up the equivalent OSStatus code for a given PAL_X509ChainStatusFlags single-bit value.
Note that PAL_X509ChainNotTimeValid is an ambiguous code, it could be errSecCertificateExpired or
errSecCertificateNotValidYet. A caller should resolve that code via other means.
*/
-DLLEXPORT int32_t AppleCryptoNative_GetOSStatusForChainStatus(PAL_X509ChainStatusFlags chainStatusFlag);
+PALEXPORT int32_t AppleCryptoNative_GetOSStatusForChainStatus(PAL_X509ChainStatusFlags chainStatusFlag);
/*
Sets the trusted certificates used when evaluating a chain.
*/
-DLLEXPORT int32_t AppleCryptoNative_X509ChainSetTrustAnchorCertificates(SecTrustRef chain, CFArrayRef anchorCertificates);
+PALEXPORT int32_t AppleCryptoNative_X509ChainSetTrustAnchorCertificates(SecTrustRef chain, CFArrayRef anchorCertificates);
#include "pal_compiler.h"
#include "opensslshim.h"
-DLLEXPORT int32_t CryptoNative_GetX509Thumbprint(X509* x509, uint8_t* pBuf, int32_t cBuf);
+PALEXPORT int32_t CryptoNative_GetX509Thumbprint(X509* x509, uint8_t* pBuf, int32_t cBuf);
-DLLEXPORT const ASN1_TIME* CryptoNative_GetX509NotBefore(X509* x509);
+PALEXPORT const ASN1_TIME* CryptoNative_GetX509NotBefore(X509* x509);
-DLLEXPORT const ASN1_TIME* CryptoNative_GetX509NotAfter(X509* x509);
+PALEXPORT const ASN1_TIME* CryptoNative_GetX509NotAfter(X509* x509);
-DLLEXPORT const ASN1_TIME* CryptoNative_GetX509CrlNextUpdate(X509_CRL* crl);
+PALEXPORT const ASN1_TIME* CryptoNative_GetX509CrlNextUpdate(X509_CRL* crl);
-DLLEXPORT int32_t CryptoNative_GetX509Version(X509* x509);
+PALEXPORT int32_t CryptoNative_GetX509Version(X509* x509);
-DLLEXPORT ASN1_OBJECT* CryptoNative_GetX509PublicKeyAlgorithm(X509* x509);
+PALEXPORT ASN1_OBJECT* CryptoNative_GetX509PublicKeyAlgorithm(X509* x509);
-DLLEXPORT ASN1_OBJECT* CryptoNative_GetX509SignatureAlgorithm(X509* x509);
+PALEXPORT ASN1_OBJECT* CryptoNative_GetX509SignatureAlgorithm(X509* x509);
-DLLEXPORT int32_t CryptoNative_GetX509PublicKeyParameterBytes(X509* x509, uint8_t* pBuf, int32_t cBuf);
+PALEXPORT int32_t CryptoNative_GetX509PublicKeyParameterBytes(X509* x509, uint8_t* pBuf, int32_t cBuf);
-DLLEXPORT ASN1_BIT_STRING* CryptoNative_GetX509PublicKeyBytes(X509* x509);
+PALEXPORT ASN1_BIT_STRING* CryptoNative_GetX509PublicKeyBytes(X509* x509);
-DLLEXPORT int32_t CryptoNative_GetAsn1StringBytes(ASN1_STRING* asn1, uint8_t* pBuf, int32_t cBuf);
+PALEXPORT int32_t CryptoNative_GetAsn1StringBytes(ASN1_STRING* asn1, uint8_t* pBuf, int32_t cBuf);
-DLLEXPORT int32_t CryptoNative_GetX509NameRawBytes(X509_NAME* x509Name, uint8_t* pBuf, int32_t cBuf);
+PALEXPORT int32_t CryptoNative_GetX509NameRawBytes(X509_NAME* x509Name, uint8_t* pBuf, int32_t cBuf);
-DLLEXPORT int32_t CryptoNative_GetX509EkuFieldCount(EXTENDED_KEY_USAGE* eku);
+PALEXPORT int32_t CryptoNative_GetX509EkuFieldCount(EXTENDED_KEY_USAGE* eku);
-DLLEXPORT ASN1_OBJECT* CryptoNative_GetX509EkuField(EXTENDED_KEY_USAGE* eku, int32_t loc);
+PALEXPORT ASN1_OBJECT* CryptoNative_GetX509EkuField(EXTENDED_KEY_USAGE* eku, int32_t loc);
-DLLEXPORT BIO* CryptoNative_GetX509NameInfo(X509* x509, int32_t nameType, int32_t forIssuer);
+PALEXPORT BIO* CryptoNative_GetX509NameInfo(X509* x509, int32_t nameType, int32_t forIssuer);
-DLLEXPORT int32_t CryptoNative_CheckX509Hostname(X509* x509, const char* hostname, int32_t cchHostname);
+PALEXPORT int32_t CryptoNative_CheckX509Hostname(X509* x509, const char* hostname, int32_t cchHostname);
-DLLEXPORT int32_t CryptoNative_CheckX509IpAddress(
+PALEXPORT int32_t CryptoNative_CheckX509IpAddress(
X509* x509, const uint8_t* addressBytes, int32_t addressBytesLen, const char* hostname, int32_t cchHostname);
-DLLEXPORT int32_t CryptoNative_GetX509StackFieldCount(STACK_OF(X509) * stack);
+PALEXPORT int32_t CryptoNative_GetX509StackFieldCount(STACK_OF(X509) * stack);
-DLLEXPORT X509* CryptoNative_GetX509StackField(STACK_OF(X509) * stack, int loc);
+PALEXPORT X509* CryptoNative_GetX509StackField(STACK_OF(X509) * stack, int loc);
-DLLEXPORT void CryptoNative_RecursiveFreeX509Stack(STACK_OF(X509) * stack);
+PALEXPORT void CryptoNative_RecursiveFreeX509Stack(STACK_OF(X509) * stack);
-DLLEXPORT int32_t CryptoNative_X509StoreSetVerifyTime(X509_STORE* ctx,
+PALEXPORT int32_t CryptoNative_X509StoreSetVerifyTime(X509_STORE* ctx,
int32_t year,
int32_t month,
int32_t day,
int32_t second,
int32_t isDst);
-DLLEXPORT X509* CryptoNative_ReadX509AsDerFromBio(BIO* bio);
+PALEXPORT X509* CryptoNative_ReadX509AsDerFromBio(BIO* bio);
-DLLEXPORT int32_t CryptoNative_BioTell(BIO* bio);
+PALEXPORT int32_t CryptoNative_BioTell(BIO* bio);
-DLLEXPORT int32_t CryptoNative_BioSeek(BIO* bio, int32_t ofs);
+PALEXPORT int32_t CryptoNative_BioSeek(BIO* bio, int32_t ofs);
-DLLEXPORT STACK_OF(X509) * CryptoNative_NewX509Stack(void);
+PALEXPORT STACK_OF(X509) * CryptoNative_NewX509Stack(void);
-DLLEXPORT int32_t CryptoNative_PushX509StackField(STACK_OF(X509) * stack, X509* x509);
+PALEXPORT int32_t CryptoNative_PushX509StackField(STACK_OF(X509) * stack, X509* x509);
-DLLEXPORT int32_t CryptoNative_GetRandomBytes(uint8_t* buf, int32_t num);
+PALEXPORT int32_t CryptoNative_GetRandomBytes(uint8_t* buf, int32_t num);
-DLLEXPORT int32_t CryptoNative_LookupFriendlyNameByOid(const char* oidValue, const char** friendlyName);
+PALEXPORT int32_t CryptoNative_LookupFriendlyNameByOid(const char* oidValue, const char** friendlyName);
-DLLEXPORT int32_t CryptoNative_EnsureOpenSslInitialized(void);
+PALEXPORT int32_t CryptoNative_EnsureOpenSslInitialized(void);
-DLLEXPORT int64_t CryptoNative_OpenSslVersionNumber(void);
+PALEXPORT int64_t CryptoNative_OpenSslVersionNumber(void);
/*
Direct shim to OBJ_txt2obj.
*/
-DLLEXPORT const ASN1_OBJECT* CryptoNative_ObjTxt2Obj(const char* s);
+PALEXPORT const ASN1_OBJECT* CryptoNative_ObjTxt2Obj(const char* s);
/*
Direct shim to OBJ_obj2txt.
*/
-DLLEXPORT int32_t CryptoNative_ObjObj2Txt(char* buf, int32_t buf_len, const ASN1_OBJECT* a);
+PALEXPORT int32_t CryptoNative_ObjObj2Txt(char* buf, int32_t buf_len, const ASN1_OBJECT* a);
/*
Retrieves the ASN1_OBJECT for the specified friendly name.
Can return nullptr if there isn't a corresponding shared object.
*/
-DLLEXPORT const ASN1_OBJECT* CryptoNative_GetObjectDefinitionByName(const char* friendlyName);
+PALEXPORT const ASN1_OBJECT* CryptoNative_GetObjectDefinitionByName(const char* friendlyName);
/*
Direct shim to OBJ_sn2nid.
*/
-DLLEXPORT int32_t CryptoNative_ObjSn2Nid(const char* sn);
+PALEXPORT int32_t CryptoNative_ObjSn2Nid(const char* sn);
/*
Direct shim to OBJ_txt2nid.
*/
-DLLEXPORT int32_t CryptoNative_ObjTxt2Nid(const char* sn);
+PALEXPORT int32_t CryptoNative_ObjTxt2Nid(const char* sn);
/*
Direct shim to OBJ_nid2obj.
*/
-DLLEXPORT const ASN1_OBJECT* CryptoNative_ObjNid2Obj(int32_t nid);
+PALEXPORT const ASN1_OBJECT* CryptoNative_ObjNid2Obj(int32_t nid);
/*
Direct shim to ASN1_OBJECT_free.
*/
-DLLEXPORT void CryptoNative_Asn1ObjectFree(ASN1_OBJECT* a);
+PALEXPORT void CryptoNative_Asn1ObjectFree(ASN1_OBJECT* a);
/*
Shims the d2i_ASN1_BIT_STRING method and makes it easier to invoke from managed code.
*/
-DLLEXPORT ASN1_BIT_STRING* CryptoNative_DecodeAsn1BitString(const uint8_t* buf, int32_t len);
+PALEXPORT ASN1_BIT_STRING* CryptoNative_DecodeAsn1BitString(const uint8_t* buf, int32_t len);
/*
Direct shim to ASN1_BIT_STRING_free.
*/
-DLLEXPORT void CryptoNative_Asn1BitStringFree(ASN1_STRING* a);
+PALEXPORT void CryptoNative_Asn1BitStringFree(ASN1_STRING* a);
/*
Direct shim to ASN1_OCTET_STRING_new.
*/
-DLLEXPORT ASN1_OCTET_STRING* CryptoNative_Asn1OctetStringNew(void);
+PALEXPORT ASN1_OCTET_STRING* CryptoNative_Asn1OctetStringNew(void);
/*
Direct shim to ASN1_OCTET_STRING_set.
*/
-DLLEXPORT int32_t CryptoNative_Asn1OctetStringSet(ASN1_OCTET_STRING* s, const uint8_t* data, int32_t len);
+PALEXPORT int32_t CryptoNative_Asn1OctetStringSet(ASN1_OCTET_STRING* s, const uint8_t* data, int32_t len);
/*
Direct shim to ASN1_OCTET_STRING_free.
*/
-DLLEXPORT void CryptoNative_Asn1OctetStringFree(ASN1_STRING* a);
+PALEXPORT void CryptoNative_Asn1OctetStringFree(ASN1_STRING* a);
/*
Direct shim to ASN1_STRING_free.
*/
-DLLEXPORT void CryptoNative_Asn1StringFree(ASN1_STRING* a);
+PALEXPORT void CryptoNative_Asn1StringFree(ASN1_STRING* a);
/*
Returns the number of bytes it will take to convert
the ASN1_INTEGER to a DER format.
*/
-DLLEXPORT int32_t CryptoNative_GetAsn1IntegerDerSize(ASN1_INTEGER* i);
+PALEXPORT int32_t CryptoNative_GetAsn1IntegerDerSize(ASN1_INTEGER* i);
/*
Shims the i2d_ASN1_INTEGER method.
Returns the number of bytes written to buf.
*/
-DLLEXPORT int32_t CryptoNative_EncodeAsn1Integer(ASN1_INTEGER* i, uint8_t* buf);
+PALEXPORT int32_t CryptoNative_EncodeAsn1Integer(ASN1_INTEGER* i, uint8_t* buf);
The given BIGNUM pointer is invalid after this call.
Always succeeds.
*/
-DLLEXPORT void CryptoNative_BigNumDestroy(BIGNUM* a);
+PALEXPORT void CryptoNative_BigNumDestroy(BIGNUM* a);
/*
Shims the BN_bin2bn method.
*/
-DLLEXPORT BIGNUM* CryptoNative_BigNumFromBinary(const uint8_t* s, int32_t len);
+PALEXPORT BIGNUM* CryptoNative_BigNumFromBinary(const uint8_t* s, int32_t len);
/*
Shims the BN_bn2bin method.
*/
-DLLEXPORT int32_t CryptoNative_BigNumToBinary(const BIGNUM* a, uint8_t* to);
+PALEXPORT int32_t CryptoNative_BigNumToBinary(const BIGNUM* a, uint8_t* to);
/*
Returns the number of bytes needed to export a BIGNUM.
*/
-DLLEXPORT int32_t CryptoNative_GetBigNumBytes(const BIGNUM* a);
+PALEXPORT int32_t CryptoNative_GetBigNumBytes(const BIGNUM* a);
/*
Creates a new memory-backed BIO instance.
*/
-DLLEXPORT BIO* CryptoNative_CreateMemoryBio(void);
+PALEXPORT BIO* CryptoNative_CreateMemoryBio(void);
/*
Direct shim to BIO_new_file.
*/
-DLLEXPORT BIO* CryptoNative_BioNewFile(const char* filename, const char* mode);
+PALEXPORT BIO* CryptoNative_BioNewFile(const char* filename, const char* mode);
/*
Cleans up and deletes a BIO instance.
No-op if a is null.
The given BIO pointer is invalid after this call.
*/
-DLLEXPORT int32_t CryptoNative_BioDestroy(BIO* a);
+PALEXPORT int32_t CryptoNative_BioDestroy(BIO* a);
/*
Direct shim to BIO_gets.
*/
-DLLEXPORT int32_t CryptoNative_BioGets(BIO* b, char* buf, int32_t size);
+PALEXPORT int32_t CryptoNative_BioGets(BIO* b, char* buf, int32_t size);
/*
Direct shim to BIO_read.
*/
-DLLEXPORT int32_t CryptoNative_BioRead(BIO* b, void* buf, int32_t len);
+PALEXPORT int32_t CryptoNative_BioRead(BIO* b, void* buf, int32_t len);
/*
Direct shim to BIO_write.
*/
-DLLEXPORT int32_t CryptoNative_BioWrite(BIO* b, const void* buf, int32_t len);
+PALEXPORT int32_t CryptoNative_BioWrite(BIO* b, const void* buf, int32_t len);
/*
Gets the size of data available in the BIO.
Shims the BIO_get_mem_data method.
*/
-DLLEXPORT int32_t CryptoNative_GetMemoryBioSize(BIO* bio);
+PALEXPORT int32_t CryptoNative_GetMemoryBioSize(BIO* bio);
/*
Shims the BIO_ctrl_pending method.
Returns the number of pending characters in the BIOs read and write buffers.
*/
-DLLEXPORT int32_t CryptoNative_BioCtrlPending(BIO* bio);
+PALEXPORT int32_t CryptoNative_BioCtrlPending(BIO* bio);
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_DsaUpRef(DSA* dsa);
+PALEXPORT int32_t CryptoNative_DsaUpRef(DSA* dsa);
/*
Cleans up and deletes a DSA instance.
The given DSA pointer is invalid after this call.
Always succeeds.
*/
-DLLEXPORT void CryptoNative_DsaDestroy(DSA* dsa);
+PALEXPORT void CryptoNative_DsaDestroy(DSA* dsa);
/*
Shims the DSA_generate_key_ex method.
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_DsaGenerateKey(DSA** dsa, int32_t bits);
+PALEXPORT int32_t CryptoNative_DsaGenerateKey(DSA** dsa, int32_t bits);
/*
Shims the DSA_size method.
Returns the size of the ASN.1 encoded signature.
*/
-DLLEXPORT int32_t CryptoNative_DsaSizeSignature(DSA* dsa);
+PALEXPORT int32_t CryptoNative_DsaSizeSignature(DSA* dsa);
/*
Returns the size of the p parameter in bytes.
*/
-DLLEXPORT int32_t CryptoNative_DsaSizeP(DSA* dsa);
+PALEXPORT int32_t CryptoNative_DsaSizeP(DSA* dsa);
/*
Returns the size of the q parameter in bytes.
*/
-DLLEXPORT int32_t CryptoNative_DsaSizeQ(DSA* dsa);
+PALEXPORT int32_t CryptoNative_DsaSizeQ(DSA* dsa);
/*
Shims the DSA_sign method.
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
CryptoNative_DsaSign(
DSA* dsa,
const uint8_t* hash,
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
CryptoNative_DsaVerify(
DSA* dsa,
const uint8_t* hash,
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_GetDsaParameters(
+PALEXPORT int32_t CryptoNative_GetDsaParameters(
const DSA* dsa,
const BIGNUM** p, int32_t* pLength,
const BIGNUM** q, int32_t* qLength,
/*
Sets all the parameters on the DSA instance.
*/
-DLLEXPORT int32_t CryptoNative_DsaKeyCreateByExplicitParameters(
+PALEXPORT int32_t CryptoNative_DsaKeyCreateByExplicitParameters(
DSA** dsa,
uint8_t* p,
int32_t pLength,
/*
Returns the ECC key parameters.
*/
-DLLEXPORT int32_t CryptoNative_GetECKeyParameters(
+PALEXPORT int32_t CryptoNative_GetECKeyParameters(
const EC_KEY* key,
int32_t includePrivate,
const BIGNUM** qx, int32_t* cbQx,
/*
Returns the ECC key and curve parameters.
*/
-DLLEXPORT int32_t CryptoNative_GetECCurveParameters(
+PALEXPORT int32_t CryptoNative_GetECCurveParameters(
const EC_KEY* key,
int32_t includePrivate,
ECCurveType* curveType,
Creates the new EC_KEY instance using the curve oid (friendly name or value) and public key parameters.
Returns 1 upon success, -1 if oid was not found, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_EcKeyCreateByKeyParameters(
+PALEXPORT int32_t CryptoNative_EcKeyCreateByKeyParameters(
EC_KEY** key,
const char* oid,
uint8_t* qx, int32_t qxLength,
/*
Returns the new EC_KEY instance using the explicit parameters.
*/
-DLLEXPORT EC_KEY* CryptoNative_EcKeyCreateByExplicitParameters(
+PALEXPORT EC_KEY* CryptoNative_EcKeyCreateByExplicitParameters(
ECCurveType curveType,
uint8_t* qx, int32_t qxLength,
uint8_t* qy, int32_t qyLength,
Returns 1 on success, otherwise 0.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
CryptoNative_EcDsaSign(const uint8_t* dgst, int32_t dgstlen, uint8_t* sig, int32_t* siglen, EC_KEY* key);
/*
Returns 1 for a correct signature, 0 for an incorrect signature, -1 on error.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
CryptoNative_EcDsaVerify(const uint8_t* dgst, int32_t dgstlen, const uint8_t* sig, int32_t siglen, EC_KEY* key);
/*
Returns the maximum length of a DER encoded ECDSA signature created with this key.
*/
-DLLEXPORT int32_t CryptoNative_EcDsaSize(const EC_KEY* key);
+PALEXPORT int32_t CryptoNative_EcDsaSize(const EC_KEY* key);
The given EC_KEY pointer is invalid after this call.
Always succeeds.
*/
-DLLEXPORT void CryptoNative_EcKeyDestroy(EC_KEY* r);
+PALEXPORT void CryptoNative_EcKeyDestroy(EC_KEY* r);
/*
Shims the EC_KEY_new_by_curve_name method.
Returns the new EC_KEY instance.
*/
-DLLEXPORT EC_KEY* CryptoNative_EcKeyCreateByOid(const char* oid);
+PALEXPORT EC_KEY* CryptoNative_EcKeyCreateByOid(const char* oid);
/*
Shims the EC_KEY_generate_key method.
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_EcKeyGenerateKey(EC_KEY* eckey);
+PALEXPORT int32_t CryptoNative_EcKeyGenerateKey(EC_KEY* eckey);
/*
Shims the EC_KEY_up_ref method.
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_EcKeyUpRef(EC_KEY* r);
+PALEXPORT int32_t CryptoNative_EcKeyUpRef(EC_KEY* r);
/*
Gets the key size in bits for the specified EC_KEY.
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_EcKeyGetSize(const EC_KEY* key, int32_t* keySize);
+PALEXPORT int32_t CryptoNative_EcKeyGetSize(const EC_KEY* key, int32_t* keySize);
/*
Gets the NID of the curve name as an oid value for the specified EC_KEY.
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_EcKeyGetCurveName2(const EC_KEY* key, int32_t* nidName);
+PALEXPORT int32_t CryptoNative_EcKeyGetCurveName2(const EC_KEY* key, int32_t* nidName);
/*
Shims the ERR_clear_error method.
*/
-DLLEXPORT void CryptoNative_ErrClearError(void);
+PALEXPORT void CryptoNative_ErrClearError(void);
/*
Shim to ERR_get_error which also returns whether the error
was caused by an allocation failure.
*/
-DLLEXPORT uint64_t CryptoNative_ErrGetErrorAlloc(int32_t* isAllocFailure);
+PALEXPORT uint64_t CryptoNative_ErrGetErrorAlloc(int32_t* isAllocFailure);
-DLLEXPORT uint64_t CryptoNative_ErrPeekError(void);
+PALEXPORT uint64_t CryptoNative_ErrPeekError(void);
-DLLEXPORT uint64_t CryptoNative_ErrPeekLastError(void);
+PALEXPORT uint64_t CryptoNative_ErrPeekLastError(void);
/*
Shims the ERR_reason_error_string method.
Returns the string for the specified error.
*/
-DLLEXPORT const char* CryptoNative_ErrReasonErrorString(uint64_t error);
+PALEXPORT const char* CryptoNative_ErrReasonErrorString(uint64_t error);
/*
Direct shim to ERR_error_string_n.
*/
-DLLEXPORT void CryptoNative_ErrErrorStringN(uint64_t e, char* buf, int32_t len);
+PALEXPORT void CryptoNative_ErrErrorStringN(uint64_t e, char* buf, int32_t len);
Returns new EVP_MD_CTX on success, nullptr on failure.
*/
-DLLEXPORT EVP_MD_CTX* CryptoNative_EvpMdCtxCreate(const EVP_MD* type);
+PALEXPORT EVP_MD_CTX* CryptoNative_EvpMdCtxCreate(const EVP_MD* type);
/*
Cleans up and deletes an EVP_MD_CTX instance created by EvpMdCtxCreate.
The given EVP_MD_CTX pointer is invalid after this call.
Always succeeds.
*/
-DLLEXPORT void CryptoNative_EvpMdCtxDestroy(EVP_MD_CTX* ctx);
+PALEXPORT void CryptoNative_EvpMdCtxDestroy(EVP_MD_CTX* ctx);
/*
Resets an EVP_MD_CTX instance for a new computation.
*/
-DLLEXPORT int32_t CryptoNative_EvpDigestReset(EVP_MD_CTX* ctx, const EVP_MD* type);
+PALEXPORT int32_t CryptoNative_EvpDigestReset(EVP_MD_CTX* ctx, const EVP_MD* type);
/*
Function:
Direct shim to EVP_DigestUpdate.
*/
-DLLEXPORT int32_t CryptoNative_EvpDigestUpdate(EVP_MD_CTX* ctx, const void* d, int32_t cnt);
+PALEXPORT int32_t CryptoNative_EvpDigestUpdate(EVP_MD_CTX* ctx, const void* d, int32_t cnt);
/*
Function:
Direct shim to EVP_DigestFinal_ex.
*/
-DLLEXPORT int32_t CryptoNative_EvpDigestFinalEx(EVP_MD_CTX* ctx, uint8_t* md, uint32_t* s);
+PALEXPORT int32_t CryptoNative_EvpDigestFinalEx(EVP_MD_CTX* ctx, uint8_t* md, uint32_t* s);
/*
Function:
Direct shim to EVP_MD_size.
*/
-DLLEXPORT int32_t CryptoNative_EvpMdSize(const EVP_MD* md);
+PALEXPORT int32_t CryptoNative_EvpMdSize(const EVP_MD* md);
/*
Function:
Direct shim to EVP_md5.
*/
-DLLEXPORT const EVP_MD* CryptoNative_EvpMd5(void);
+PALEXPORT const EVP_MD* CryptoNative_EvpMd5(void);
/*
Function:
Direct shim to EVP_sha1.
*/
-DLLEXPORT const EVP_MD* CryptoNative_EvpSha1(void);
+PALEXPORT const EVP_MD* CryptoNative_EvpSha1(void);
/*
Function:
Direct shim to EVP_sha256.
*/
-DLLEXPORT const EVP_MD* CryptoNative_EvpSha256(void);
+PALEXPORT const EVP_MD* CryptoNative_EvpSha256(void);
/*
Function:
Direct shim to EVP_sha384.
*/
-DLLEXPORT const EVP_MD* CryptoNative_EvpSha384(void);
+PALEXPORT const EVP_MD* CryptoNative_EvpSha384(void);
/*
Function:
Direct shim to EVP_sha512.
*/
-DLLEXPORT const EVP_MD* CryptoNative_EvpSha512(void);
+PALEXPORT const EVP_MD* CryptoNative_EvpSha512(void);
/*
Function:
Returns the maxium bytes for a message digest.
*/
-DLLEXPORT int32_t CryptoNative_GetMaxMdSize(void);
+PALEXPORT int32_t CryptoNative_GetMaxMdSize(void);
#include "pal_compiler.h"
#include "opensslshim.h"
-DLLEXPORT EVP_CIPHER_CTX*
+PALEXPORT EVP_CIPHER_CTX*
CryptoNative_EvpCipherCreate2(const EVP_CIPHER* type, uint8_t* key, int32_t keyLength, int32_t effectiveKeyLength, unsigned char* iv, int32_t enc);
-DLLEXPORT EVP_CIPHER_CTX*
+PALEXPORT EVP_CIPHER_CTX*
CryptoNative_EvpCipherCreatePartial(const EVP_CIPHER* type);
-DLLEXPORT int32_t CryptoNative_EvpCipherSetKeyAndIV(EVP_CIPHER_CTX* ctx, uint8_t* key, unsigned char* iv, int32_t enc);
+PALEXPORT int32_t CryptoNative_EvpCipherSetKeyAndIV(EVP_CIPHER_CTX* ctx, uint8_t* key, unsigned char* iv, int32_t enc);
-DLLEXPORT int32_t CryptoNative_EvpCipherSetGcmNonceLength(EVP_CIPHER_CTX* ctx, int32_t ivLength);
-DLLEXPORT int32_t CryptoNative_EvpCipherSetCcmNonceLength(EVP_CIPHER_CTX* ctx, int32_t ivLength);
+PALEXPORT int32_t CryptoNative_EvpCipherSetGcmNonceLength(EVP_CIPHER_CTX* ctx, int32_t ivLength);
+PALEXPORT int32_t CryptoNative_EvpCipherSetCcmNonceLength(EVP_CIPHER_CTX* ctx, int32_t ivLength);
/*
Cleans up and deletes an EVP_CIPHER_CTX instance created by EvpCipherCreate.
The given EVP_CIPHER_CTX pointer is invalid after this call.
Always succeeds.
*/
-DLLEXPORT void CryptoNative_EvpCipherDestroy(EVP_CIPHER_CTX* ctx);
+PALEXPORT void CryptoNative_EvpCipherDestroy(EVP_CIPHER_CTX* ctx);
/*
Function:
Resets an EVP_CIPHER_CTX instance for a new computation.
*/
-DLLEXPORT int32_t CryptoNative_EvpCipherReset(EVP_CIPHER_CTX* ctx);
+PALEXPORT int32_t CryptoNative_EvpCipherReset(EVP_CIPHER_CTX* ctx);
/*
Function:
Direct shim to EVP_CIPHER_CTX_set_padding.
*/
-DLLEXPORT int32_t CryptoNative_EvpCipherCtxSetPadding(EVP_CIPHER_CTX* x, int32_t padding);
+PALEXPORT int32_t CryptoNative_EvpCipherCtxSetPadding(EVP_CIPHER_CTX* x, int32_t padding);
/*
Function:
Direct shim to EVP_CipherUpdate.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
CryptoNative_EvpCipherUpdate(EVP_CIPHER_CTX* ctx, uint8_t* out, int32_t* outl, unsigned char* in, int32_t inl);
/*
Direct shim to EVP_CipherFinal_ex.
*/
-DLLEXPORT int32_t CryptoNative_EvpCipherFinalEx(EVP_CIPHER_CTX* ctx, uint8_t* outm, int32_t* outl);
+PALEXPORT int32_t CryptoNative_EvpCipherFinalEx(EVP_CIPHER_CTX* ctx, uint8_t* outm, int32_t* outl);
/*
Function:
Retrieves tag for authenticated encryption
*/
-DLLEXPORT int32_t CryptoNative_EvpCipherGetGcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength);
+PALEXPORT int32_t CryptoNative_EvpCipherGetGcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength);
/*
Function:
Sets tag for authenticated decryption
*/
-DLLEXPORT int32_t CryptoNative_EvpCipherSetGcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength);
+PALEXPORT int32_t CryptoNative_EvpCipherSetGcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength);
/*
Function:
Retrieves tag for authenticated encryption
*/
-DLLEXPORT int32_t CryptoNative_EvpCipherGetCcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength);
+PALEXPORT int32_t CryptoNative_EvpCipherGetCcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength);
/*
Function:
Sets tag for authenticated decryption
*/
-DLLEXPORT int32_t CryptoNative_EvpCipherSetCcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength);
+PALEXPORT int32_t CryptoNative_EvpCipherSetCcmTag(EVP_CIPHER_CTX* ctx, uint8_t* tag, int32_t tagLength);
/*
Function:
Direct shim to EVP_aes_128_ecb.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Ecb(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Ecb(void);
/*
Function:
Direct shim to EVP_aes_128_cbc.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Cbc(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Cbc(void);
/*
Function:
Direct shim to EVP_aes_128_gcm.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Gcm(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Gcm(void);
/*
Function:
Direct shim to EVP_aes_128_ccm.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Ccm(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes128Ccm(void);
/*
Function:
Direct shim to EVP_aes_192_ecb.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Ecb(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Ecb(void);
/*
Function:
Direct shim to EVP_aes_192_cbc.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Cbc(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Cbc(void);
/*
Function:
Direct shim to EVP_aes_192_gcm.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Gcm(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Gcm(void);
/*
Function:
Direct shim to EVP_aes_192_ccm.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Ccm(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes192Ccm(void);
/*
Function:
Direct shim to EVP_aes_256_ecb.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Ecb(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Ecb(void);
/*
Function:
Direct shim to EVP_aes_256_cbc.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Cbc(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Cbc(void);
/*
Function:
Direct shim to EVP_aes_256_gcm.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Gcm(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Gcm(void);
/*
Function:
Direct shim to EVP_aes_256_ccm.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Ccm(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpAes256Ccm(void);
/*
Function:
Direct shim to EVP_des_ede3.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpDes3Ecb(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpDes3Ecb(void);
/*
Function:
Direct shim to EVP_des_ede3_cbc.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpDes3Cbc(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpDes3Cbc(void);
/*
Function:
Direct shim to EVP_des_ecb.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpDesEcb(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpDesEcb(void);
/*
Function:
Direct shim to EVP_des_ede_cbc.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpDesCbc(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpDesCbc(void);
/*
Function:
Direct shim to EVP_rc2_ecb.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpRC2Ecb(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpRC2Ecb(void);
/*
Function:
Direct shim to EVP_des_rc2_cbc.
*/
-DLLEXPORT const EVP_CIPHER* CryptoNative_EvpRC2Cbc(void);
+PALEXPORT const EVP_CIPHER* CryptoNative_EvpRC2Cbc(void);
Returns the new EVP_PKEY instance.
*/
-DLLEXPORT EVP_PKEY* CryptoNative_EvpPkeyCreate(void);
+PALEXPORT EVP_PKEY* CryptoNative_EvpPkeyCreate(void);
/*
Cleans up and deletes a EVP_PKEY instance.
The given EVP_PKEY pointer is invalid after this call.
Always succeeds.
*/
-DLLEXPORT void CryptoNative_EvpPkeyDestroy(EVP_PKEY* pkey);
+PALEXPORT void CryptoNative_EvpPkeyDestroy(EVP_PKEY* pkey);
/*
Used by System.Security.Cryptography.X509Certificates' OpenSslX509CertificateReader when
Returns the number (as of this call) of references to the EVP_PKEY. Anything less than
2 is an error, because the key is already in the process of being freed.
*/
-DLLEXPORT int32_t CryptoNative_UpRefEvpPkey(EVP_PKEY* pkey);
+PALEXPORT int32_t CryptoNative_UpRefEvpPkey(EVP_PKEY* pkey);
Returns the DSA instance for the EVP_PKEY.
*/
-DLLEXPORT DSA* CryptoNative_EvpPkeyGetDsa(EVP_PKEY* pkey);
+PALEXPORT DSA* CryptoNative_EvpPkeyGetDsa(EVP_PKEY* pkey);
/*
Shims the EVP_PKEY_set1_DSA method to set the DSA
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_EvpPkeySetDsa(EVP_PKEY* pkey, DSA* dsa);
+PALEXPORT int32_t CryptoNative_EvpPkeySetDsa(EVP_PKEY* pkey, DSA* dsa);
#include "pal_compiler.h"
#include "opensslshim.h"
-DLLEXPORT EVP_PKEY_CTX* CryptoNative_EvpPKeyCtxCreate(EVP_PKEY* pkey, EVP_PKEY* peerkey, uint32_t* secretLength);
+PALEXPORT EVP_PKEY_CTX* CryptoNative_EvpPKeyCtxCreate(EVP_PKEY* pkey, EVP_PKEY* peerkey, uint32_t* secretLength);
-DLLEXPORT int32_t CryptoNative_EvpPKeyDeriveSecretAgreement(uint8_t* secret, uint32_t secretLength, EVP_PKEY_CTX* ctx);
+PALEXPORT int32_t CryptoNative_EvpPKeyDeriveSecretAgreement(uint8_t* secret, uint32_t secretLength, EVP_PKEY_CTX* ctx);
-DLLEXPORT void CryptoNative_EvpPKeyCtxDestroy(EVP_PKEY_CTX* ctx);
+PALEXPORT void CryptoNative_EvpPKeyCtxDestroy(EVP_PKEY_CTX* ctx);
Returns the EC_KEY instance for the EVP_PKEY.
*/
-DLLEXPORT EC_KEY* CryptoNative_EvpPkeyGetEcKey(EVP_PKEY* pkey);
+PALEXPORT EC_KEY* CryptoNative_EvpPkeyGetEcKey(EVP_PKEY* pkey);
/*
Shims the EVP_PKEY_set1_EC_KEY method to set the EC_KEY
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_EvpPkeySetEcKey(EVP_PKEY* pkey, EC_KEY* key);
+PALEXPORT int32_t CryptoNative_EvpPkeySetEcKey(EVP_PKEY* pkey, EC_KEY* key);
Returns the RSA instance for the EVP_PKEY.
*/
-DLLEXPORT RSA* CryptoNative_EvpPkeyGetRsa(EVP_PKEY* pkey);
+PALEXPORT RSA* CryptoNative_EvpPkeyGetRsa(EVP_PKEY* pkey);
/*
Shims the EVP_PKEY_set1_RSA method to set the RSA
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_EvpPkeySetRsa(EVP_PKEY* pkey, RSA* rsa);
+PALEXPORT int32_t CryptoNative_EvpPkeySetRsa(EVP_PKEY* pkey, RSA* rsa);
*
* Returns new HMAC_CTX on success, nullptr on failure.
*/
-DLLEXPORT HMAC_CTX* CryptoNative_HmacCreate(const uint8_t* key, int32_t keyLen, const EVP_MD* md);
+PALEXPORT HMAC_CTX* CryptoNative_HmacCreate(const uint8_t* key, int32_t keyLen, const EVP_MD* md);
/**
* Cleans up and deletes an HMAC_CTX instance created by HmacCreate.
* The given HMAC_CTX pointer is invalid after this call.
* Always succeeds.
*/
-DLLEXPORT void CryptoNative_HmacDestroy(HMAC_CTX* ctx);
+PALEXPORT void CryptoNative_HmacDestroy(HMAC_CTX* ctx);
/**
* Resets an HMAC_CTX instance for a new computation, preserving the key and EVP_MD.
*
* Implemented by passing all null/0 values but ctx to HMAC_Init_ex.
*/
-DLLEXPORT int32_t CryptoNative_HmacReset(HMAC_CTX* ctx);
+PALEXPORT int32_t CryptoNative_HmacReset(HMAC_CTX* ctx);
/**
* Appends data to the computation.
*
* Returns 1 for success or 0 for failure. (Always succeeds on platforms where HMAC_Update returns void.)
*/
-DLLEXPORT int32_t CryptoNative_HmacUpdate(HMAC_CTX* ctx, const uint8_t* data, int32_t len);
+PALEXPORT int32_t CryptoNative_HmacUpdate(HMAC_CTX* ctx, const uint8_t* data, int32_t len);
/**
* Finalizes the computation and obtains the result.
*
* Returns 1 for success or 0 for failure. (Always succeeds on platforms where HMAC_Update returns void.)
*/
-DLLEXPORT int32_t CryptoNative_HmacFinal(HMAC_CTX* ctx, uint8_t* md, int32_t* len);
+PALEXPORT int32_t CryptoNative_HmacFinal(HMAC_CTX* ctx, uint8_t* md, int32_t* len);
/*
Direct shim to OCSP_REQUEST_free
*/
-DLLEXPORT void CryptoNative_OcspRequestDestroy(OCSP_REQUEST* request);
+PALEXPORT void CryptoNative_OcspRequestDestroy(OCSP_REQUEST* request);
/*
Returns the number of bytes required to encode an OCSP_REQUEST
*/
-DLLEXPORT int32_t CryptoNative_GetOcspRequestDerSize(OCSP_REQUEST* req);
+PALEXPORT int32_t CryptoNative_GetOcspRequestDerSize(OCSP_REQUEST* req);
/*
Encodes the OCSP_REQUEST req into the destination buffer, returning the number of bytes written.
*/
-DLLEXPORT int32_t CryptoNative_EncodeOcspRequest(OCSP_REQUEST* req, uint8_t* buf);
+PALEXPORT int32_t CryptoNative_EncodeOcspRequest(OCSP_REQUEST* req, uint8_t* buf);
/*
Direct shim to d2i_OCSP_RESPONSE
*/
-DLLEXPORT OCSP_RESPONSE* CryptoNative_DecodeOcspResponse(const uint8_t* buf, int32_t len);
+PALEXPORT OCSP_RESPONSE* CryptoNative_DecodeOcspResponse(const uint8_t* buf, int32_t len);
/*
Direct shim to OCSP_RESPONSE_free
*/
-DLLEXPORT void CryptoNative_OcspResponseDestroy(OCSP_RESPONSE* response);
+PALEXPORT void CryptoNative_OcspResponseDestroy(OCSP_RESPONSE* response);
/*
Shims the d2i_PKCS12 method and makes it easier to invoke from managed code.
*/
-DLLEXPORT PKCS12* CryptoNative_DecodePkcs12(const uint8_t* buf, int32_t len);
+PALEXPORT PKCS12* CryptoNative_DecodePkcs12(const uint8_t* buf, int32_t len);
/*
Shims the d2i_PKCS12_bio method.
Returns the new PKCS12 instance.
*/
-DLLEXPORT PKCS12* CryptoNative_DecodePkcs12FromBio(BIO* bio);
+PALEXPORT PKCS12* CryptoNative_DecodePkcs12FromBio(BIO* bio);
/*
Cleans up and deletes a PKCS12 instance.
The given PKCS12 pointer is invalid after this call.
Always succeeds.
*/
-DLLEXPORT void CryptoNative_Pkcs12Destroy(PKCS12* p12);
+PALEXPORT void CryptoNative_Pkcs12Destroy(PKCS12* p12);
/*
Shims the PKCS12_create method.
Returns the new PKCS12 instance.
*/
-DLLEXPORT PKCS12* CryptoNative_Pkcs12Create(char* pass, EVP_PKEY* pkey, X509* cert, X509Stack* ca);
+PALEXPORT PKCS12* CryptoNative_Pkcs12Create(char* pass, EVP_PKEY* pkey, X509* cert, X509Stack* ca);
/*
Returns the number of bytes it will take to convert
the PKCS12 to a DER format.
*/
-DLLEXPORT int32_t CryptoNative_GetPkcs12DerSize(PKCS12* p12);
+PALEXPORT int32_t CryptoNative_GetPkcs12DerSize(PKCS12* p12);
/*
Shims the i2d_PKCS12 method.
Returns the number of bytes written to buf.
*/
-DLLEXPORT int32_t CryptoNative_EncodePkcs12(PKCS12* p12, uint8_t* buf);
+PALEXPORT int32_t CryptoNative_EncodePkcs12(PKCS12* p12, uint8_t* buf);
/*
Shims the PKCS12_parse method.
Returns 1 on success, otherwise 0.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
CryptoNative_Pkcs12Parse(PKCS12* p12, const char* pass, EVP_PKEY** pkey, X509** cert, X509Stack** ca);
Returns the new PKCS7 instance.
*/
-DLLEXPORT PKCS7* CryptoNative_PemReadBioPkcs7(BIO* bp);
+PALEXPORT PKCS7* CryptoNative_PemReadBioPkcs7(BIO* bp);
/*
Shims the d2i_PKCS7 method and makes it easier to invoke from managed code.
*/
-DLLEXPORT PKCS7* CryptoNative_DecodePkcs7(const uint8_t* buf, int32_t len);
+PALEXPORT PKCS7* CryptoNative_DecodePkcs7(const uint8_t* buf, int32_t len);
/*
Reads a PKCS7 instance in DER format from a BIO.
Returns the new PKCS7 instance.
*/
-DLLEXPORT PKCS7* CryptoNative_D2IPkcs7Bio(BIO* bp);
+PALEXPORT PKCS7* CryptoNative_D2IPkcs7Bio(BIO* bp);
/*
Create a new PKCS7 instance and prepare it to be a signed PKCS7 object
Returns the new PKCS7 instance.
*/
-DLLEXPORT PKCS7* CryptoNative_Pkcs7CreateCertificateCollection(X509Stack* certs);
+PALEXPORT PKCS7* CryptoNative_Pkcs7CreateCertificateCollection(X509Stack* certs);
/*
Cleans up and deletes a PKCS7 instance.
The given PKCS7 pointer is invalid after this call.
Always succeeds.
*/
-DLLEXPORT void CryptoNative_Pkcs7Destroy(PKCS7* p7);
+PALEXPORT void CryptoNative_Pkcs7Destroy(PKCS7* p7);
/*
Function:
1 when the file format is understood, and *certs is assigned to the
certificate contents of the structure.
*/
-DLLEXPORT int32_t CryptoNative_GetPkcs7Certificates(PKCS7* p7, X509Stack** certs);
+PALEXPORT int32_t CryptoNative_GetPkcs7Certificates(PKCS7* p7, X509Stack** certs);
/*
Returns the number of bytes it will take to convert
the PKCS7 to a DER format.
*/
-DLLEXPORT int32_t CryptoNative_GetPkcs7DerSize(PKCS7* p7);
+PALEXPORT int32_t CryptoNative_GetPkcs7DerSize(PKCS7* p7);
/*
Shims the i2d_PKCS7 method.
Returns the number of bytes written to buf.
*/
-DLLEXPORT int32_t CryptoNative_EncodePkcs7(PKCS7* p7, uint8_t* buf);
+PALEXPORT int32_t CryptoNative_EncodePkcs7(PKCS7* p7, uint8_t* buf);
Returns the new RSA instance.
*/
-DLLEXPORT RSA* CryptoNative_RsaCreate(void);
+PALEXPORT RSA* CryptoNative_RsaCreate(void);
/*
Shims the RSA_up_ref method.
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_RsaUpRef(RSA* rsa);
+PALEXPORT int32_t CryptoNative_RsaUpRef(RSA* rsa);
/*
Cleans up and deletes a RSA instance.
The given RSA pointer is invalid after this call.
Always succeeds.
*/
-DLLEXPORT void CryptoNative_RsaDestroy(RSA* rsa);
+PALEXPORT void CryptoNative_RsaDestroy(RSA* rsa);
/*
Shims the d2i_RSAPublicKey method and makes it easier to invoke from managed code.
*/
-DLLEXPORT RSA* CryptoNative_DecodeRsaPublicKey(const uint8_t* buf, int32_t len);
+PALEXPORT RSA* CryptoNative_DecodeRsaPublicKey(const uint8_t* buf, int32_t len);
/*
Shims the RSA_public_encrypt method.
Returns the size of the signature, or -1 on error.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
CryptoNative_RsaPublicEncrypt(int32_t flen, const uint8_t* from, uint8_t* to, RSA* rsa, RsaPadding padding);
/*
Returns the size of the signature, or -1 on error.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
CryptoNative_RsaPrivateDecrypt(int32_t flen, const uint8_t* from, uint8_t* to, RSA* rsa, RsaPadding padding);
/*
Requires that the input be the size of the key.
Returns the number of bytes written (which should be flen), or -1 on error.
*/
-DLLEXPORT int32_t CryptoNative_RsaSignPrimitive(int32_t flen, const uint8_t* from, uint8_t* to, RSA* rsa);
+PALEXPORT int32_t CryptoNative_RsaSignPrimitive(int32_t flen, const uint8_t* from, uint8_t* to, RSA* rsa);
/*
Shims RSA_public_decrypt with a fixed value of RSA_NO_PADDING.
Requires that the input be the size of the key.
Returns the number of bytes written (which should be flen), or -1 on error.
*/
-DLLEXPORT int32_t CryptoNative_RsaVerificationPrimitive(int32_t flen, const uint8_t* from, uint8_t* to, RSA* rsa);
+PALEXPORT int32_t CryptoNative_RsaVerificationPrimitive(int32_t flen, const uint8_t* from, uint8_t* to, RSA* rsa);
/*
Shims the RSA_size method.
Returns the RSA modulus size in bytes.
*/
-DLLEXPORT int32_t CryptoNative_RsaSize(RSA* rsa);
+PALEXPORT int32_t CryptoNative_RsaSize(RSA* rsa);
/*
Shims the RSA_generate_key_ex method.
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_RsaGenerateKeyEx(RSA* rsa, int32_t bits, BIGNUM* e);
+PALEXPORT int32_t CryptoNative_RsaGenerateKeyEx(RSA* rsa, int32_t bits, BIGNUM* e);
/*
Shims the RSA_sign method.
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
CryptoNative_RsaSign(int32_t type, const uint8_t* m, int32_t mlen, uint8_t* sigret, int32_t* siglen, RSA* rsa);
/*
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t
+PALEXPORT int32_t
CryptoNative_RsaVerify(int32_t type, const uint8_t* m, int32_t mlen, uint8_t* sigbuf, int32_t siglen, RSA* rsa);
/*
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_GetRsaParameters(const RSA* rsa,
+PALEXPORT int32_t CryptoNative_GetRsaParameters(const RSA* rsa,
const BIGNUM** n,
const BIGNUM** e,
const BIGNUM** d,
/*
Sets all the parameters on the RSA instance.
*/
-DLLEXPORT int32_t CryptoNative_SetRsaParameters(RSA* rsa,
+PALEXPORT int32_t CryptoNative_SetRsaParameters(RSA* rsa,
uint8_t* n,
int32_t nLength,
uint8_t* e,
/*
Ensures that libssl is correctly initialized and ready to use.
*/
-DLLEXPORT void CryptoNative_EnsureLibSslInitialized(void);
+PALEXPORT void CryptoNative_EnsureLibSslInitialized(void);
/*
Shims the SSLv23_method method.
Returns the requested SSL_METHOD.
*/
-DLLEXPORT const SSL_METHOD* CryptoNative_SslV2_3Method(void);
+PALEXPORT const SSL_METHOD* CryptoNative_SslV2_3Method(void);
/*
Shims the SSL_CTX_new method.
Returns the new SSL_CTX instance.
*/
-DLLEXPORT SSL_CTX* CryptoNative_SslCtxCreate(SSL_METHOD* method);
+PALEXPORT SSL_CTX* CryptoNative_SslCtxCreate(SSL_METHOD* method);
/*
Sets the specified protocols in the SSL_CTX options.
*/
-DLLEXPORT void CryptoNative_SetProtocolOptions(SSL_CTX* ctx, SslProtocols protocols);
+PALEXPORT void CryptoNative_SetProtocolOptions(SSL_CTX* ctx, SslProtocols protocols);
/*
Shims the SSL_new method.
Returns the new SSL instance.
*/
-DLLEXPORT SSL* CryptoNative_SslCreate(SSL_CTX* ctx);
+PALEXPORT SSL* CryptoNative_SslCreate(SSL_CTX* ctx);
/*
Shims the SSL_get_error method.
Returns the error code for the specified result.
*/
-DLLEXPORT int32_t CryptoNative_SslGetError(SSL* ssl, int32_t ret);
+PALEXPORT int32_t CryptoNative_SslGetError(SSL* ssl, int32_t ret);
/*
Cleans up and deletes an SSL instance.
The given X509 SSL is invalid after this call.
Always succeeds.
*/
-DLLEXPORT void CryptoNative_SslDestroy(SSL* ssl);
+PALEXPORT void CryptoNative_SslDestroy(SSL* ssl);
/*
Cleans up and deletes an SSL_CTX instance.
The given X509 SSL_CTX is invalid after this call.
Always succeeds.
*/
-DLLEXPORT void CryptoNative_SslCtxDestroy(SSL_CTX* ctx);
+PALEXPORT void CryptoNative_SslCtxDestroy(SSL_CTX* ctx);
/*
Shims the SSL_set_connect_state method.
*/
-DLLEXPORT void CryptoNative_SslSetConnectState(SSL* ssl);
+PALEXPORT void CryptoNative_SslSetConnectState(SSL* ssl);
/*
Shims the SSL_set_accept_state method.
*/
-DLLEXPORT void CryptoNative_SslSetAcceptState(SSL* ssl);
+PALEXPORT void CryptoNative_SslSetAcceptState(SSL* ssl);
/*
Shims the SSL_get_version method.
Returns the protocol version string for the SSL instance.
*/
-DLLEXPORT const char* CryptoNative_SslGetVersion(SSL* ssl);
+PALEXPORT const char* CryptoNative_SslGetVersion(SSL* ssl);
/*
Shims the SSL_write method.
Returns the positive number of bytes written when successful, 0 or a negative number
when an error is encountered.
*/
-DLLEXPORT int32_t CryptoNative_SslWrite(SSL* ssl, const void* buf, int32_t num);
+PALEXPORT int32_t CryptoNative_SslWrite(SSL* ssl, const void* buf, int32_t num);
/*
Shims the SSL_read method.
Returns the positive number of bytes read when successful, 0 or a negative number
when an error is encountered.
*/
-DLLEXPORT int32_t CryptoNative_SslRead(SSL* ssl, void* buf, int32_t num);
+PALEXPORT int32_t CryptoNative_SslRead(SSL* ssl, void* buf, int32_t num);
/*
Shims the SSL_renegotiate_pending method.
Returns 1 when negotiation is requested; 0 once a handshake has finished.
*/
-DLLEXPORT int32_t CryptoNative_IsSslRenegotiatePending(SSL* ssl);
+PALEXPORT int32_t CryptoNative_IsSslRenegotiatePending(SSL* ssl);
/*
Shims the SSL_shutdown method.
0 if the shutdown is not yet finished;
<0 if the shutdown was not successful because a fatal error.
*/
-DLLEXPORT int32_t CryptoNative_SslShutdown(SSL* ssl);
+PALEXPORT int32_t CryptoNative_SslShutdown(SSL* ssl);
/*
Shims the SSL_set_bio method.
*/
-DLLEXPORT void CryptoNative_SslSetBio(SSL* ssl, BIO* rbio, BIO* wbio);
+PALEXPORT void CryptoNative_SslSetBio(SSL* ssl, BIO* rbio, BIO* wbio);
/*
Shims the SSL_do_handshake method.
and by the specifications of the TLS/SSL protocol;
<0 if the handshake was not successful because of a fatal error.
*/
-DLLEXPORT int32_t CryptoNative_SslDoHandshake(SSL* ssl);
+PALEXPORT int32_t CryptoNative_SslDoHandshake(SSL* ssl);
/*
Gets a value indicating whether the SSL_state is SSL_ST_OK.
Returns 1 if the state is OK, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_IsSslStateOK(SSL* ssl);
+PALEXPORT int32_t CryptoNative_IsSslStateOK(SSL* ssl);
/*
Shims the SSL_get_peer_certificate method.
Returns the certificate presented by the peer.
*/
-DLLEXPORT X509* CryptoNative_SslGetPeerCertificate(SSL* ssl);
+PALEXPORT X509* CryptoNative_SslGetPeerCertificate(SSL* ssl);
/*
Shims the SSL_get_peer_cert_chain method.
Returns the certificate chain presented by the peer.
*/
-DLLEXPORT X509Stack* CryptoNative_SslGetPeerCertChain(SSL* ssl);
+PALEXPORT X509Stack* CryptoNative_SslGetPeerCertChain(SSL* ssl);
/*
Shims the SSL_CTX_use_certificate method.
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_SslCtxUseCertificate(SSL_CTX* ctx, X509* x);
+PALEXPORT int32_t CryptoNative_SslCtxUseCertificate(SSL_CTX* ctx, X509* x);
/*
Shims the SSL_CTX_use_PrivateKey method.
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_SslCtxUsePrivateKey(SSL_CTX* ctx, EVP_PKEY* pkey);
+PALEXPORT int32_t CryptoNative_SslCtxUsePrivateKey(SSL_CTX* ctx, EVP_PKEY* pkey);
/*
Shims the SSL_CTX_check_private_key method.
Returns 1 upon success, otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_SslCtxCheckPrivateKey(SSL_CTX* ctx);
+PALEXPORT int32_t CryptoNative_SslCtxCheckPrivateKey(SSL_CTX* ctx);
/*
Shims the SSL_CTX_set_quiet_shutdown method.
*/
-DLLEXPORT void CryptoNative_SslCtxSetQuietShutdown(SSL_CTX* ctx);
+PALEXPORT void CryptoNative_SslCtxSetQuietShutdown(SSL_CTX* ctx);
/*
Shims the SSL_set_quiet_shutdown method.
*/
-DLLEXPORT void CryptoNative_SslSetQuietShutdown(SSL* ctx, int mode);
+PALEXPORT void CryptoNative_SslSetQuietShutdown(SSL* ctx, int mode);
/*
Shims the SSL_get_client_CA_list method.
Returns the list of CA names explicity set.
*/
-DLLEXPORT X509NameStack* CryptoNative_SslGetClientCAList(SSL* ssl);
+PALEXPORT X509NameStack* CryptoNative_SslGetClientCAList(SSL* ssl);
/*
Shims the SSL_CTX_set_verify method.
*/
-DLLEXPORT void CryptoNative_SslCtxSetVerify(SSL_CTX* ctx, SslCtxSetVerifyCallback callback);
+PALEXPORT void CryptoNative_SslCtxSetVerify(SSL_CTX* ctx, SslCtxSetVerifyCallback callback);
/*
Shims the SSL_CTX_set_cert_verify_callback method.
*/
-DLLEXPORT void
+PALEXPORT void
CryptoNative_SslCtxSetCertVerifyCallback(SSL_CTX* ctx, SslCtxSetCertVerifyCallbackCallback callback, void* arg);
/*
Sets the specified encryption policy on the SSL_CTX.
*/
-DLLEXPORT int32_t CryptoNative_SetEncryptionPolicy(SSL_CTX* ctx, EncryptionPolicy policy);
+PALEXPORT int32_t CryptoNative_SetEncryptionPolicy(SSL_CTX* ctx, EncryptionPolicy policy);
/*
Sets ciphers (< TLS 1.3) and cipher suites (TLS 1.3) on the SSL_CTX
*/
-DLLEXPORT int32_t CryptoNative_SetCiphers(SSL_CTX* ctx, const char* cipherList, const char* cipherSuites);
+PALEXPORT int32_t CryptoNative_SetCiphers(SSL_CTX* ctx, const char* cipherList, const char* cipherSuites);
/*
Determines if TLS 1.3 is supported by this OpenSSL implementation
*/
-DLLEXPORT int32_t CryptoNative_Tls13Supported(void);
+PALEXPORT int32_t CryptoNative_Tls13Supported(void);
/*
Shims the SSL_CTX_set_client_cert_cb method
*/
-DLLEXPORT void CryptoNative_SslCtxSetClientCertCallback(SSL_CTX* ctx, SslClientCertCallback callback);
+PALEXPORT void CryptoNative_SslCtxSetClientCertCallback(SSL_CTX* ctx, SslClientCertCallback callback);
/*
Shims the SSL_get_finished method.
*/
-DLLEXPORT int32_t CryptoNative_SslGetFinished(SSL* ssl, void* buf, int32_t count);
+PALEXPORT int32_t CryptoNative_SslGetFinished(SSL* ssl, void* buf, int32_t count);
/*
Shims the SSL_get_peer_finished method.
*/
-DLLEXPORT int32_t CryptoNative_SslGetPeerFinished(SSL* ssl, void* buf, int32_t count);
+PALEXPORT int32_t CryptoNative_SslGetPeerFinished(SSL* ssl, void* buf, int32_t count);
/*
Returns true/false based on if existing ssl session was re-used or not.
Shims the SSL_session_reused macro.
*/
-DLLEXPORT int32_t CryptoNative_SslSessionReused(SSL* ssl);
+PALEXPORT int32_t CryptoNative_SslSessionReused(SSL* ssl);
/*
adds the given certificate to the extra chain certificates associated with ctx that is associated with the ssl.
libssl frees the x509 object.
Returns 1 if success and 0 in case of failure
*/
-DLLEXPORT int32_t CryptoNative_SslAddExtraChainCert(SSL* ssl, X509* x509);
+PALEXPORT int32_t CryptoNative_SslAddExtraChainCert(SSL* ssl, X509* x509);
/*
Shims the ssl_ctx_set_alpn_select_cb method.
*/
-DLLEXPORT void CryptoNative_SslCtxSetAlpnSelectCb(SSL_CTX* ctx, SslCtxSetAlpnCallback cb, void *arg);
+PALEXPORT void CryptoNative_SslCtxSetAlpnSelectCb(SSL_CTX* ctx, SslCtxSetAlpnCallback cb, void *arg);
/*
Shims the ssl_ctx_set_alpn_protos method.
Returns 0 on success, non-zero on failure.
*/
-DLLEXPORT int32_t CryptoNative_SslCtxSetAlpnProtos(SSL_CTX* ctx, const uint8_t* protos, uint32_t protos_len);
+PALEXPORT int32_t CryptoNative_SslCtxSetAlpnProtos(SSL_CTX* ctx, const uint8_t* protos, uint32_t protos_len);
/*
Shims the ssl_get0_alpn_selected method.
*/
-DLLEXPORT void CryptoNative_SslGet0AlpnSelected(SSL* ssl, const uint8_t** protocol, uint32_t* len);
+PALEXPORT void CryptoNative_SslGet0AlpnSelected(SSL* ssl, const uint8_t** protocol, uint32_t* len);
/*
Shims the SSL_set_tlsext_host_name method.
*/
-DLLEXPORT int32_t CryptoNative_SslSetTlsExtHostName(SSL* ssl, uint8_t* name);
+PALEXPORT int32_t CryptoNative_SslSetTlsExtHostName(SSL* ssl, uint8_t* name);
/*
Shims the SSL_get_current_cipher and SSL_CIPHER_get_id.
*/
-DLLEXPORT int32_t CryptoNative_SslGetCurrentCipherId(SSL* ssl, int32_t* cipherId);
+PALEXPORT int32_t CryptoNative_SslGetCurrentCipherId(SSL* ssl, int32_t* cipherId);
/*
Looks up a cipher by the IANA identifier, returns a shared string for the OpenSSL name for the cipher,
and emits a value indicating if the cipher belongs to the SSL2-TLS1.2 list, or the TLS1.3+ list.
*/
-DLLEXPORT const char* CryptoNative_GetOpenSslCipherSuiteName(SSL* ssl, int32_t cipherSuite, int32_t* isTls12OrLower);
+PALEXPORT const char* CryptoNative_GetOpenSslCipherSuiteName(SSL* ssl, int32_t cipherSuite, int32_t* isTls12OrLower);
Returns a EVP_PKEY* equivalent to the public key of the certificate.
*/
-DLLEXPORT EVP_PKEY* CryptoNative_GetX509EvpPublicKey(X509* x509);
+PALEXPORT EVP_PKEY* CryptoNative_GetX509EvpPublicKey(X509* x509);
/*
Shims the d2i_X509_CRL method and makes it easier to invoke from managed code.
*/
-DLLEXPORT X509_CRL* CryptoNative_DecodeX509Crl(const uint8_t* buf, int32_t len);
+PALEXPORT X509_CRL* CryptoNative_DecodeX509Crl(const uint8_t* buf, int32_t len);
/*
Shims the d2i_X509 method and makes it easier to invoke from managed code.
*/
-DLLEXPORT X509* CryptoNative_DecodeX509(const uint8_t* buf, int32_t len);
+PALEXPORT X509* CryptoNative_DecodeX509(const uint8_t* buf, int32_t len);
/*
Returns the number of bytes it will take to convert
the X509 to a DER format.
*/
-DLLEXPORT int32_t CryptoNative_GetX509DerSize(X509* x);
+PALEXPORT int32_t CryptoNative_GetX509DerSize(X509* x);
/*
Shims the i2d_X509 method.
Returns the number of bytes written to buf.
*/
-DLLEXPORT int32_t CryptoNative_EncodeX509(X509* x, uint8_t* buf);
+PALEXPORT int32_t CryptoNative_EncodeX509(X509* x, uint8_t* buf);
/*
Cleans up and deletes an X509 instance.
The given X509 pointer is invalid after this call.
Always succeeds.
*/
-DLLEXPORT void CryptoNative_X509Destroy(X509* a);
+PALEXPORT void CryptoNative_X509Destroy(X509* a);
/*
Shims the X509_dup method.
Returns the duplicated X509 instance.
*/
-DLLEXPORT X509* CryptoNative_X509Duplicate(X509* x509);
+PALEXPORT X509* CryptoNative_X509Duplicate(X509* x509);
/*
Shims the PEM_read_bio_X509 method.
Returns the read X509 instance.
*/
-DLLEXPORT X509* CryptoNative_PemReadX509FromBio(BIO* bio);
+PALEXPORT X509* CryptoNative_PemReadX509FromBio(BIO* bio);
/*
Shims the PEM_read_bio_X509_AUX method.
Returns the read X509 instance.
*/
-DLLEXPORT X509* CryptoNative_PemReadX509FromBioAux(BIO* bio);
+PALEXPORT X509* CryptoNative_PemReadX509FromBioAux(BIO* bio);
/*
Shims the X509_get_serialNumber method.
Returns the ASN1_INTEGER for the serial number.
*/
-DLLEXPORT ASN1_INTEGER* CryptoNative_X509GetSerialNumber(X509* x509);
+PALEXPORT ASN1_INTEGER* CryptoNative_X509GetSerialNumber(X509* x509);
/*
Shims the X509_get_issuer_name method.
Returns the ASN1_INTEGER for the issuer name.
*/
-DLLEXPORT X509_NAME* CryptoNative_X509GetIssuerName(X509* x509);
+PALEXPORT X509_NAME* CryptoNative_X509GetIssuerName(X509* x509);
/*
Shims the X509_get_subject_name method.
Returns the X509_NAME for the subject name.
*/
-DLLEXPORT X509_NAME* CryptoNative_X509GetSubjectName(X509* x509);
+PALEXPORT X509_NAME* CryptoNative_X509GetSubjectName(X509* x509);
/*
Shims the X509_check_purpose method.
*/
-DLLEXPORT int32_t CryptoNative_X509CheckPurpose(X509* x, int32_t id, int32_t ca);
+PALEXPORT int32_t CryptoNative_X509CheckPurpose(X509* x, int32_t id, int32_t ca);
/*
Shims the X509_issuer_name_hash method.
*/
-DLLEXPORT uint64_t CryptoNative_X509IssuerNameHash(X509* x);
+PALEXPORT uint64_t CryptoNative_X509IssuerNameHash(X509* x);
/*
Shims the X509_get_ext_count method.
*/
-DLLEXPORT int32_t CryptoNative_X509GetExtCount(X509* x);
+PALEXPORT int32_t CryptoNative_X509GetExtCount(X509* x);
/*
Shims the X509_get_ext method.
*/
-DLLEXPORT X509_EXTENSION* CryptoNative_X509GetExt(X509* x, int32_t loc);
+PALEXPORT X509_EXTENSION* CryptoNative_X509GetExt(X509* x, int32_t loc);
/*
Shims the X509_EXTENSION_get_object method.
*/
-DLLEXPORT ASN1_OBJECT* CryptoNative_X509ExtensionGetOid(X509_EXTENSION* x);
+PALEXPORT ASN1_OBJECT* CryptoNative_X509ExtensionGetOid(X509_EXTENSION* x);
/*
Shims the X509_EXTENSION_get_data method.
*/
-DLLEXPORT ASN1_OCTET_STRING* CryptoNative_X509ExtensionGetData(X509_EXTENSION* x);
+PALEXPORT ASN1_OCTET_STRING* CryptoNative_X509ExtensionGetData(X509_EXTENSION* x);
/*
Shims the X509_EXTENSION_get_critical method.
*/
-DLLEXPORT int32_t CryptoNative_X509ExtensionGetCritical(X509_EXTENSION* x);
+PALEXPORT int32_t CryptoNative_X509ExtensionGetCritical(X509_EXTENSION* x);
/*
Returns the data portion of the first matched extension.
*/
-DLLEXPORT ASN1_OCTET_STRING* CryptoNative_X509FindExtensionData(X509* x, int32_t nid);
+PALEXPORT ASN1_OCTET_STRING* CryptoNative_X509FindExtensionData(X509* x, int32_t nid);
/*
Shims the X509_STORE_free method.
*/
-DLLEXPORT void CryptoNative_X509StoreDestory(X509_STORE* v);
+PALEXPORT void CryptoNative_X509StoreDestory(X509_STORE* v);
/*
Shims the X509_STORE_add_crl method.
*/
-DLLEXPORT int32_t CryptoNative_X509StoreAddCrl(X509_STORE* ctx, X509_CRL* x);
+PALEXPORT int32_t CryptoNative_X509StoreAddCrl(X509_STORE* ctx, X509_CRL* x);
/*
Sets the correct flags on the X509_STORE for the specified X509RevocationFlag.
Shims the X509_STORE_set_flags method.
*/
-DLLEXPORT int32_t CryptoNative_X509StoreSetRevocationFlag(X509_STORE* ctx, X509RevocationFlag revocationFlag);
+PALEXPORT int32_t CryptoNative_X509StoreSetRevocationFlag(X509_STORE* ctx, X509RevocationFlag revocationFlag);
/*
Shims the X509_STORE_CTX_new method.
*/
-DLLEXPORT X509_STORE_CTX* CryptoNative_X509StoreCtxCreate(void);
+PALEXPORT X509_STORE_CTX* CryptoNative_X509StoreCtxCreate(void);
/*
Shims the X509_STORE_CTX_free method.
*/
-DLLEXPORT void CryptoNative_X509StoreCtxDestroy(X509_STORE_CTX* v);
+PALEXPORT void CryptoNative_X509StoreCtxDestroy(X509_STORE_CTX* v);
/*
Shims the X509_STORE_CTX_init method.
*/
-DLLEXPORT int32_t CryptoNative_X509StoreCtxInit(X509_STORE_CTX* ctx,
+PALEXPORT int32_t CryptoNative_X509StoreCtxInit(X509_STORE_CTX* ctx,
X509_STORE* store,
X509* x509,
X509Stack* extraStore);
/*
Shims the X509_verify_cert method.
*/
-DLLEXPORT int32_t CryptoNative_X509VerifyCert(X509_STORE_CTX* ctx);
+PALEXPORT int32_t CryptoNative_X509VerifyCert(X509_STORE_CTX* ctx);
/*
Shims the X509_STORE_CTX_get1_chain method.
*/
-DLLEXPORT X509Stack* CryptoNative_X509StoreCtxGetChain(X509_STORE_CTX* ctx);
+PALEXPORT X509Stack* CryptoNative_X509StoreCtxGetChain(X509_STORE_CTX* ctx);
/*
Shims the X509_STORE_CTX_get_current_cert function.
*/
-DLLEXPORT X509* CryptoNative_X509StoreCtxGetCurrentCert(X509_STORE_CTX* ctx);
+PALEXPORT X509* CryptoNative_X509StoreCtxGetCurrentCert(X509_STORE_CTX* ctx);
/*
Returns the interior pointer to the "untrusted" certificates collection for this X509_STORE_CTX
*/
-DLLEXPORT X509Stack* CryptoNative_X509StoreCtxGetSharedUntrusted(X509_STORE_CTX* ctx);
+PALEXPORT X509Stack* CryptoNative_X509StoreCtxGetSharedUntrusted(X509_STORE_CTX* ctx);
/*
Returns the interior pointer to the target certificate for an X509 certificate chain
*/
-DLLEXPORT X509* CryptoNative_X509StoreCtxGetTargetCert(X509_STORE_CTX* ctx);
+PALEXPORT X509* CryptoNative_X509StoreCtxGetTargetCert(X509_STORE_CTX* ctx);
/*
Shims the X509_STORE_CTX_get_error method.
*/
-DLLEXPORT X509VerifyStatusCode CryptoNative_X509StoreCtxGetError(X509_STORE_CTX* ctx);
+PALEXPORT X509VerifyStatusCode CryptoNative_X509StoreCtxGetError(X509_STORE_CTX* ctx);
/*
Resets ctx to before the chain was built, preserving the target cert, trust store, extra cert context,
and verify parameters.
*/
-DLLEXPORT int32_t CryptoNative_X509StoreCtxReset(X509_STORE_CTX* ctx);
+PALEXPORT int32_t CryptoNative_X509StoreCtxReset(X509_STORE_CTX* ctx);
/*
Reset ctx and rebuild the chain.
Returns -1 if CryptoNative_X509StoreCtxReset failed, otherwise returns the result of
X509_verify_cert.
*/
-DLLEXPORT int32_t CryptoNative_X509StoreCtxRebuildChain(X509_STORE_CTX* ctx);
+PALEXPORT int32_t CryptoNative_X509StoreCtxRebuildChain(X509_STORE_CTX* ctx);
/*
Shims the X509_STORE_CTX_get_error_depth method.
*/
-DLLEXPORT int32_t CryptoNative_X509StoreCtxGetErrorDepth(X509_STORE_CTX* ctx);
+PALEXPORT int32_t CryptoNative_X509StoreCtxGetErrorDepth(X509_STORE_CTX* ctx);
/*
Shims the X509_STORE_CTX_set_verify_cb function.
*/
-DLLEXPORT void CryptoNative_X509StoreCtxSetVerifyCallback(X509_STORE_CTX* ctx, X509StoreVerifyCallback callback);
+PALEXPORT void CryptoNative_X509StoreCtxSetVerifyCallback(X509_STORE_CTX* ctx, X509StoreVerifyCallback callback);
/*
Shims the X509_verify_cert_error_string method.
*/
-DLLEXPORT const char* CryptoNative_X509VerifyCertErrorString(X509VerifyStatusCode n);
+PALEXPORT const char* CryptoNative_X509VerifyCertErrorString(X509VerifyStatusCode n);
/*
Shims the X509_CRL_free method.
*/
-DLLEXPORT void CryptoNative_X509CrlDestroy(X509_CRL* a);
+PALEXPORT void CryptoNative_X509CrlDestroy(X509_CRL* a);
/*
Shims the PEM_write_bio_X509_CRL method.
Returns the number of bytes written.
*/
-DLLEXPORT int32_t CryptoNative_PemWriteBioX509Crl(BIO* bio, X509_CRL* crl);
+PALEXPORT int32_t CryptoNative_PemWriteBioX509Crl(BIO* bio, X509_CRL* crl);
/*
Shims the PEM_read_bio_X509_CRL method.
The new X509_CRL instance.
*/
-DLLEXPORT X509_CRL* CryptoNative_PemReadBioX509Crl(BIO* bio);
+PALEXPORT X509_CRL* CryptoNative_PemReadBioX509Crl(BIO* bio);
/*
Returns the number of bytes it will take to convert the SubjectPublicKeyInfo
portion of the X509 to DER format.
*/
-DLLEXPORT int32_t CryptoNative_GetX509SubjectPublicKeyInfoDerSize(X509* x);
+PALEXPORT int32_t CryptoNative_GetX509SubjectPublicKeyInfoDerSize(X509* x);
/*
Shims the i2d_X509_PUBKEY method, providing X509_get_X509_PUBKEY(x) as the input.
Returns the number of bytes written to buf.
*/
-DLLEXPORT int32_t CryptoNative_EncodeX509SubjectPublicKeyInfo(X509* x, uint8_t* buf);
+PALEXPORT int32_t CryptoNative_EncodeX509SubjectPublicKeyInfo(X509* x, uint8_t* buf);
/*
Increases the reference count of the X509*, thereby increasing the number of calls
Returns the input value.
*/
-DLLEXPORT X509* CryptoNative_X509UpRef(X509* x509);
+PALEXPORT X509* CryptoNative_X509UpRef(X509* x509);
/*
Create a new X509_STORE, considering the certificates from systemTrust and userTrust
*/
-DLLEXPORT X509_STORE* CryptoNative_X509ChainNew(X509Stack* systemTrust, X509Stack* userTrust);
+PALEXPORT X509_STORE* CryptoNative_X509ChainNew(X509Stack* systemTrust, X509Stack* userTrust);
/*
Adds all of the simple certificates from null-or-empty-password PFX files in storePath to stack.
*/
-DLLEXPORT int32_t CryptoNative_X509StackAddDirectoryStore(X509Stack* stack, char* storePath);
+PALEXPORT int32_t CryptoNative_X509StackAddDirectoryStore(X509Stack* stack, char* storePath);
/*
Adds all of the certificates in src to dest and increases their reference count.
*/
-DLLEXPORT int32_t CryptoNative_X509StackAddMultiple(X509Stack* dest, X509Stack* src);
+PALEXPORT int32_t CryptoNative_X509StackAddMultiple(X509Stack* dest, X509Stack* src);
/*
Removes any untrusted/extra certificates from the unstrusted collection that are not part of
the current chain to make chain builds after Reset faster.
*/
-DLLEXPORT int32_t CryptoNative_X509StoreCtxCommitToChain(X509_STORE_CTX* storeCtx);
+PALEXPORT int32_t CryptoNative_X509StoreCtxCommitToChain(X509_STORE_CTX* storeCtx);
/*
Duplicates any certificate at or below the level where the error marker is.
Outputs a new store with a clone of the root, if necessary.
The new store does not have any properties set other than the trust. (Mainly, CRLs are lost)
*/
-DLLEXPORT int32_t CryptoNative_X509StoreCtxResetForSignatureError(X509_STORE_CTX* storeCtx, X509_STORE** newStore);
+PALEXPORT int32_t CryptoNative_X509StoreCtxResetForSignatureError(X509_STORE_CTX* storeCtx, X509_STORE** newStore);
/*
Look for a cached OCSP response appropriate to the end-entity certificate using the issuer as
determined by the chain in storeCtx.
*/
-DLLEXPORT X509VerifyStatusCode CryptoNative_X509ChainGetCachedOcspStatus(X509_STORE_CTX* storeCtx, char* cachePath, int chainDepth);
+PALEXPORT X509VerifyStatusCode CryptoNative_X509ChainGetCachedOcspStatus(X509_STORE_CTX* storeCtx, char* cachePath, int chainDepth);
/*
Build an OCSP request appropriate for the end-entity certificate using the issuer (and trust) as
determined by the chain in storeCtx.
*/
-DLLEXPORT OCSP_REQUEST* CryptoNative_X509ChainBuildOcspRequest(X509_STORE_CTX* storeCtx, int chainDepth);
+PALEXPORT OCSP_REQUEST* CryptoNative_X509ChainBuildOcspRequest(X509_STORE_CTX* storeCtx, int chainDepth);
/*
Determine if the OCSP response is acceptable, and if acceptable report the status and
cache the result (if appropriate)
*/
-DLLEXPORT X509VerifyStatusCode CryptoNative_X509ChainVerifyOcsp(X509_STORE_CTX* storeCtx,
+PALEXPORT X509VerifyStatusCode CryptoNative_X509ChainVerifyOcsp(X509_STORE_CTX* storeCtx,
OCSP_REQUEST* req,
OCSP_RESPONSE* resp,
char* cachePath,
Direct shim to sk_X509_NAME_num
*/
-DLLEXPORT int32_t CryptoNative_GetX509NameStackFieldCount(X509NameStack* sk);
+PALEXPORT int32_t CryptoNative_GetX509NameStackFieldCount(X509NameStack* sk);
/*
Direct shim to sk_X509_NAME_value
*/
-DLLEXPORT X509_NAME* CryptoNative_GetX509NameStackField(X509NameStack* sk, int32_t loc);
+PALEXPORT X509_NAME* CryptoNative_GetX509NameStackField(X509NameStack* sk, int32_t loc);
Look up the directory in which all certificate files therein are considered
trusted (root or trusted intermediate).
*/
-DLLEXPORT const char* CryptoNative_GetX509RootStorePath(void);
+PALEXPORT const char* CryptoNative_GetX509RootStorePath(void);
/*
Look up the file in which all certificates are considered trusted
(root or trusted intermediate), in addition to those files in
the root store path.
*/
-DLLEXPORT const char* CryptoNative_GetX509RootStoreFile(void);
+PALEXPORT const char* CryptoNative_GetX509RootStoreFile(void);
Returns new X509_EXTENSION on success, nullptr on failure.
*/
-DLLEXPORT X509_EXTENSION*
+PALEXPORT X509_EXTENSION*
CryptoNative_X509ExtensionCreateByObj(ASN1_OBJECT* obj, int32_t isCritical, ASN1_OCTET_STRING* data);
/*
The given X509_EXTENSION pointer is invalid after this call.
Always succeeds.
*/
-DLLEXPORT void CryptoNative_X509ExtensionDestroy(X509_EXTENSION* a);
+PALEXPORT void CryptoNative_X509ExtensionDestroy(X509_EXTENSION* a);
/*
Shims the X509V3_EXT_print method.
Returns 1 on success, otherwise 0 if there was an error.
*/
-DLLEXPORT int32_t CryptoNative_X509V3ExtPrint(BIO* out, X509_EXTENSION* ext);
+PALEXPORT int32_t CryptoNative_X509V3ExtPrint(BIO* out, X509_EXTENSION* ext);
/*
Decodes the X509 BASIC_CONSTRAINTS information and fills the out variables:
Returns 1 if the BASIC_CONSTRAINTS information was successfully decoded,
otherwise 0.
*/
-DLLEXPORT int32_t CryptoNative_DecodeX509BasicConstraints2Extension(const uint8_t* encoded,
+PALEXPORT int32_t CryptoNative_DecodeX509BasicConstraints2Extension(const uint8_t* encoded,
int32_t encodedLength,
int32_t* certificateAuthority,
int32_t* hasPathLengthConstraint,
/*
Shims the d2i_EXTENDED_KEY_USAGE method and makes it easier to invoke from managed code.
*/
-DLLEXPORT EXTENDED_KEY_USAGE* CryptoNative_DecodeExtendedKeyUsage(const uint8_t* buf, int32_t len);
+PALEXPORT EXTENDED_KEY_USAGE* CryptoNative_DecodeExtendedKeyUsage(const uint8_t* buf, int32_t len);
/*
Cleans up and deletes an EXTENDED_KEY_USAGE instance.
The given EXTENDED_KEY_USAGE pointer is invalid after this call.
Always succeeds.
*/
-DLLEXPORT void CryptoNative_ExtendedKeyUsageDestory(EXTENDED_KEY_USAGE* a);
+PALEXPORT void CryptoNative_ExtendedKeyUsageDestory(EXTENDED_KEY_USAGE* a);
<?xml version="1.0" encoding="utf-8" ?>
<linker>
<assembly fullname="System.Private.CoreLib">
-
<!-- domain.c: mono_defaults.appdomain_class -->
<type fullname="Mono.MonoDomain">
<field name="_mono_app_domain"/>
<type fullname="System.Threading.ThreadStartException">
<method name=".ctor" />
</type>
+ <!-- Internal API used by System.Globalization tests -->
+ <type fullname="Interop/Globalization">
+ <method name="GetICUVersion" />
+ </type>
</assembly>
</linker>