mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-10-25 21:40:11 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aec795a15f | ||
|
|
cc661bf7f5 | ||
|
|
b4ddbc3838 | ||
|
|
852b7d91a2 | ||
|
|
9ac73b277d | ||
|
|
9ab512da53 | ||
|
|
702303aced | ||
|
|
4d532bbc14 | ||
|
|
c630ba9f93 | ||
|
|
001bda3c02 | ||
|
|
bac33afa9c | ||
|
|
90c9034fbe | ||
|
|
8cab75926a | ||
|
|
5c0c2390b2 | ||
|
|
b55b4b6d68 | ||
|
|
4dc95b563c | ||
|
|
31b700304a | ||
|
|
ddb674a9b9 | ||
|
|
abde6021e8 | ||
|
|
ad8614907c | ||
|
|
8974dcda6e | ||
|
|
6d4c64a575 | ||
|
|
68adf9ecc9 | ||
|
|
3df0103a8c | ||
|
|
8d720748c1 | ||
|
|
578f38f6a5 | ||
|
|
280454fdb0 | ||
|
|
0711e236c0 | ||
|
|
b9c5edddef | ||
|
|
3c6a0d12f5 | ||
|
|
583f662a87 | ||
|
|
3f114ac76c | ||
|
|
4b2221d374 | ||
|
|
c2e224ebf8 | ||
|
|
0dc4c4fe67 | ||
|
|
9221a0ca3a | ||
|
|
b3a7e32a08 | ||
|
|
1fa0e2a0f9 | ||
|
|
9d8b073ca5 | ||
|
|
03bdf30d0a | ||
|
|
6e15cc5fa3 | ||
|
|
9d26550264 | ||
|
|
7ffde1e8fc | ||
|
|
30d234d71e | ||
|
|
a75104f13d | ||
|
|
73d3180d20 | ||
|
|
f51be309a0 | ||
|
|
a7a424cf27 | ||
|
|
19dc67eb47 | ||
|
|
9869f3125f | ||
|
|
8a8efc0dcf | ||
|
|
54e1f2a124 | ||
|
|
f827e96e1a | ||
|
|
5835fb832c | ||
|
|
9484275ab6 | ||
|
|
2a0ccb88bb | ||
|
|
d3eb327f63 | ||
|
|
c122bcd45b | ||
|
|
16b6cf6edb | ||
|
|
325bc3349e | ||
|
|
7416477763 | ||
|
|
bcd8c8f77d | ||
|
|
d44432ed81 | ||
|
|
d46f5d4353 | ||
|
|
27ded2add8 | ||
|
|
9b0bfaf079 | ||
|
|
522d61d7e2 | ||
|
|
8550e99463 | ||
|
|
2f6deb72b3 | ||
|
|
10941746e4 | ||
|
|
4827b0e6de | ||
|
|
f10085f552 | ||
|
|
eb7f0887bf | ||
|
|
34a9132d60 | ||
|
|
24d3fb000a | ||
|
|
b7b6adaff7 | ||
|
|
85ed72802f | ||
|
|
e1fcb19b23 | ||
|
|
2df69bcdea | ||
|
|
454b443b81 | ||
|
|
f97704764a | ||
|
|
9ef23038ab | ||
|
|
e48c38f47a | ||
|
|
cf64d102de | ||
|
|
2716c68c7a | ||
|
|
f54f8c83e7 | ||
|
|
124bfdf418 | ||
|
|
01507d9995 | ||
|
|
070c82bc44 | ||
|
|
17df15293f | ||
|
|
6551076613 | ||
|
|
1b1b100e63 | ||
|
|
d73b9e16da | ||
|
|
cc788e4410 | ||
|
|
e70014bb28 | ||
|
|
082cc84a71 | ||
|
|
2ba7f0d989 | ||
|
|
9a7381b35f | ||
|
|
613ecfff44 | ||
|
|
f638548a02 | ||
|
|
224bab68bf | ||
|
|
6aca18bd76 | ||
|
|
3c58e2fbba | ||
|
|
aaaebde05e | ||
|
|
8ff9f70bd7 | ||
|
|
523ca862b9 | ||
|
|
78b8d1e9f3 | ||
|
|
83c698b36d | ||
|
|
27fe37f221 | ||
|
|
3722106daf | ||
|
|
3ea9ef1ef2 | ||
|
|
fcd27b48b2 | ||
|
|
6ff37a17ec | ||
|
|
f2c6e9e32e | ||
|
|
dbf1b88a3d | ||
|
|
3aab9eb13b | ||
|
|
3f9f8f7b3b | ||
|
|
f7520ba40c | ||
|
|
7b13f12817 | ||
|
|
57e19d75e2 | ||
|
|
4330a223c6 | ||
|
|
69387c32ad | ||
|
|
a102ec4ee8 | ||
|
|
2a094437dd | ||
|
|
4142907376 | ||
|
|
e63dc9a93b | ||
|
|
1fe19e912e | ||
|
|
56ad48446e | ||
|
|
a18aa26985 | ||
|
|
5443cc014a | ||
|
|
7d77e1c1f2 | ||
|
|
ca82cd9752 | ||
|
|
dbd86bb861 | ||
|
|
0af56b4981 |
No files matched your search
+22
-19
@@ -1,18 +1,18 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
ndkVersion "23.2.8568313"
|
||||
ndkVersion "29.0.14206865"
|
||||
|
||||
compileSdk 34
|
||||
compileSdk 37
|
||||
|
||||
namespace 'com.limelight'
|
||||
|
||||
defaultConfig {
|
||||
minSdk 16
|
||||
targetSdk 34
|
||||
minSdk 21
|
||||
targetSdk 36
|
||||
|
||||
versionName "12.0.2"
|
||||
versionCode = 313
|
||||
versionName "12.1"
|
||||
versionCode = 314
|
||||
|
||||
// Generate native debug symbols to allow Google Play to symbolicate our native crashes
|
||||
ndk.debugSymbolLevel = 'FULL'
|
||||
@@ -22,6 +22,7 @@ android {
|
||||
|
||||
buildFeatures {
|
||||
buildConfig = true
|
||||
resValues = true
|
||||
}
|
||||
|
||||
productFlavors {
|
||||
@@ -56,8 +57,8 @@ android {
|
||||
|
||||
compileOptions {
|
||||
encoding "UTF-8"
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
sourceCompatibility JavaVersion.VERSION_17
|
||||
targetCompatibility JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
lint {
|
||||
@@ -84,9 +85,6 @@ android {
|
||||
applicationIdSuffix ".debug"
|
||||
resValue "string", "app_label", "Moonlight (Debug)"
|
||||
resValue "string", "app_label_root", "Moonlight (Root Debug)"
|
||||
|
||||
minifyEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
release {
|
||||
// To whomever is releasing/using an APK in release mode with
|
||||
@@ -124,7 +122,7 @@ android {
|
||||
resValue "string", "app_label_root", "Moonlight (Root)"
|
||||
|
||||
minifyEnabled true
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,15 +131,20 @@ android {
|
||||
path "src/main/jni/Android.mk"
|
||||
}
|
||||
}
|
||||
|
||||
packaging {
|
||||
resources {
|
||||
// BouncyCastle includes duplicate LICENSE.md files
|
||||
excludes += '/META-INF/*.md'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.bouncycastle:bcprov-jdk15on:1.70'
|
||||
implementation 'org.bouncycastle:bcpkix-jdk15on:1.70'
|
||||
implementation 'org.jcodec:jcodec:0.2.3'
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.12.13'
|
||||
implementation 'com.squareup.okio:okio:1.17.5'
|
||||
// 3.5.8 requires minSdk 19, uses StandardCharsets.UTF_8 internally
|
||||
implementation 'org.jmdns:jmdns:3.5.7'
|
||||
implementation 'org.bouncycastle:bcprov-jdk18on:1.85.2'
|
||||
implementation 'org.bouncycastle:bcpkix-jdk18on:1.85'
|
||||
implementation 'org.jcodec:jcodec:0.2.5'
|
||||
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
|
||||
implementation 'org.jmdns:jmdns:3.6.3'
|
||||
implementation 'com.github.cgutman:ShieldControllerExtensions:1.0.1'
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
|
||||
<uses-permission android:name="android.permission.CAPTURE_KEYBOARD" />
|
||||
<uses-permission android:name="com.android.providers.tv.permission.READ_EPG_DATA"/>
|
||||
<uses-permission android:name="com.android.providers.tv.permission.WRITE_EPG_DATA"/>
|
||||
|
||||
@@ -50,7 +51,6 @@
|
||||
android:banner="@drawable/atv_banner"
|
||||
android:appCategory="game"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher"
|
||||
android:installLocation="auto"
|
||||
android:gwpAsanMode="always"
|
||||
android:localeConfig="@xml/locales_config"
|
||||
@@ -78,6 +78,11 @@
|
||||
android:name="com.android.graphics.intervention.wm.allowDownscale"
|
||||
android:value="false"/>
|
||||
|
||||
<!-- Game Mode configuration -->
|
||||
<meta-data
|
||||
android:name="android.game_mode_config"
|
||||
android:resource="@xml/game_mode_config" />
|
||||
|
||||
<!-- Samsung DeX support requires explicit placement of android:resizeableActivity="true"
|
||||
in each activity even though it is implied by targeting API 24+ -->
|
||||
|
||||
|
||||
@@ -195,14 +195,12 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
|
||||
// If we're going to use immersive mode, we want to have
|
||||
// the entire screen
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
|
||||
getWindow().getDecorView().setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
|
||||
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
|
||||
}
|
||||
|
||||
// Listen for UI visibility events
|
||||
getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(this);
|
||||
@@ -474,13 +472,10 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
.enableLocalAudioPlayback(prefConfig.playHostAudio)
|
||||
.setMaxPacketSize(1392)
|
||||
.setRemoteConfiguration(StreamConfiguration.STREAM_CFG_AUTO) // NvConnection will perform LAN and VPN detection
|
||||
.setHevcBitratePercentageMultiplier(75)
|
||||
.setAv1BitratePercentageMultiplier(75)
|
||||
.setSupportedVideoFormats(supportedVideoFormats)
|
||||
.setAttachedGamepadMask(gamepadMask)
|
||||
.setClientRefreshRateX100((int)(displayRefreshRate * 100))
|
||||
.setAudioConfiguration(prefConfig.audioConfiguration)
|
||||
.setAudioEncryption(true)
|
||||
.setColorSpace(decoderRenderer.getPreferredColorSpace())
|
||||
.setColorRange(decoderRenderer.getPreferredColorRange())
|
||||
.setPersistGamepadsAfterDisconnect(!prefConfig.multiController)
|
||||
@@ -509,12 +504,6 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
}
|
||||
}
|
||||
|
||||
// Use sustained performance mode on N+ to ensure consistent
|
||||
// CPU availability
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
getWindow().setSustainedPerformanceMode(true);
|
||||
}
|
||||
|
||||
if (prefConfig.onscreenController) {
|
||||
// create virtual onscreen controller
|
||||
virtualController = new VirtualController(controllerHandler,
|
||||
@@ -569,40 +558,20 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
}
|
||||
|
||||
if (desiredOrientation == Configuration.ORIENTATION_LANDSCAPE) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE);
|
||||
}
|
||||
else {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
|
||||
}
|
||||
}
|
||||
else if (desiredOrientation == Configuration.ORIENTATION_PORTRAIT) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT);
|
||||
}
|
||||
else {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If we don't have a reason to lock to portrait or landscape, allow any orientation
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_USER);
|
||||
}
|
||||
else {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// For regular displays, we always request landscape
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE);
|
||||
}
|
||||
else {
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -704,6 +673,13 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
}
|
||||
|
||||
public void setMetaKeyCaptureState(boolean enabled) {
|
||||
// Android has native keyboard capture support starting in API 36.1
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.BAKLAVA && Build.VERSION.SDK_INT_FULL >= Build.VERSION_CODES_FULL.BAKLAVA_1) {
|
||||
WindowManager.LayoutParams windowLayoutParams = getWindow().getAttributes();
|
||||
windowLayoutParams.setKeyboardCaptureEnabled(enabled);
|
||||
getWindow().setAttributes(windowLayoutParams);
|
||||
}
|
||||
else {
|
||||
// This uses custom APIs present on some Samsung devices to allow capture of
|
||||
// meta key events while streaming.
|
||||
try {
|
||||
@@ -721,8 +697,7 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
else {
|
||||
LimeLog.warning("SemWindowManager.getInstance() returned null");
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (ClassNotFoundException ignored) {
|
||||
} catch (NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
} catch (InvocationTargetException e) {
|
||||
@@ -731,6 +706,7 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserLeaveHint() {
|
||||
@@ -929,7 +905,7 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
displayRefreshRate = bestMode.getRefreshRate();
|
||||
}
|
||||
// On L, we can at least tell the OS that we want a refresh rate
|
||||
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
else {
|
||||
float bestRefreshRate = display.getRefreshRate();
|
||||
for (float candidate : display.getSupportedRefreshRates()) {
|
||||
LimeLog.info("Examining refresh rate: "+candidate);
|
||||
@@ -953,19 +929,12 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
// Apply the refresh rate change
|
||||
getWindow().setAttributes(windowLayoutParams);
|
||||
}
|
||||
else {
|
||||
// Otherwise, the active display refresh rate is just
|
||||
// whatever is currently in use.
|
||||
displayRefreshRate = display.getRefreshRate();
|
||||
}
|
||||
|
||||
// From 4.4 to 5.1 we can't ask for a 4K display mode, so we'll
|
||||
// Until Marshmallow, we can't ask for a 4K display mode, so we'll
|
||||
// need to hint the OS to provide one.
|
||||
boolean aspectRatioMatch = false;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT &&
|
||||
Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1) {
|
||||
// On KitKat and later (where we can use the whole screen via immersive mode), we'll
|
||||
// calculate whether we need to scale by aspect ratio or not. If not, we'll use
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
||||
// We'll calculate whether we need to scale by aspect ratio. If not, we'll use
|
||||
// setFixedSize so we can handle 4K properly. The only known devices that have
|
||||
// >= 4K screens have exactly 4K screens, so we'll be able to hit this good path
|
||||
// on these devices. On Marshmallow, we can start changing to 4K manually but no
|
||||
@@ -1020,8 +989,8 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
Game.this.getWindow().getDecorView().setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||
}
|
||||
// Use immersive mode on 4.4+ or standard low profile on previous builds
|
||||
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
else {
|
||||
// Use immersive mode
|
||||
Game.this.getWindow().getDecorView().setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_STABLE |
|
||||
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
|
||||
@@ -1030,11 +999,6 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
View.SYSTEM_UI_FLAG_FULLSCREEN |
|
||||
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
|
||||
}
|
||||
else {
|
||||
Game.this.getWindow().getDecorView().setSystemUiVisibility(
|
||||
View.SYSTEM_UI_FLAG_FULLSCREEN |
|
||||
View.SYSTEM_UI_FLAG_LOW_PROFILE);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1057,16 +1021,10 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
// that case here too.
|
||||
if (isInMultiWindowMode) {
|
||||
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
|
||||
// Disable performance optimizations for foreground
|
||||
getWindow().setSustainedPerformanceMode(false);
|
||||
decoderRenderer.notifyVideoBackground();
|
||||
}
|
||||
else {
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
|
||||
// Enable performance optimizations for foreground
|
||||
getWindow().setSustainedPerformanceMode(true);
|
||||
decoderRenderer.notifyVideoForeground();
|
||||
}
|
||||
|
||||
@@ -1302,10 +1260,20 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
else if ((modifierFlags & (KeyboardPacket.MODIFIER_CTRL | KeyboardPacket.MODIFIER_ALT | KeyboardPacket.MODIFIER_SHIFT)) ==
|
||||
(KeyboardPacket.MODIFIER_CTRL | KeyboardPacket.MODIFIER_ALT | KeyboardPacket.MODIFIER_SHIFT) &&
|
||||
(down && nonModifierKeyCode != KeyEvent.KEYCODE_UNKNOWN)) {
|
||||
// Remember that a special key combo was activated, so we can consume all key events until the modifiers come up
|
||||
switch (androidKeyCode) {
|
||||
case KeyEvent.KEYCODE_Z:
|
||||
case KeyEvent.KEYCODE_Q:
|
||||
case KeyEvent.KEYCODE_C:
|
||||
// Remember that a special key combo was activated, so we can consume all key
|
||||
// events until the modifiers come up
|
||||
specialKeyCode = androidKeyCode;
|
||||
waitingForAllModifiersUp = true;
|
||||
return true;
|
||||
|
||||
default:
|
||||
// This isn't a special combo that we consume on the client side
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Not a special combo
|
||||
@@ -1332,6 +1300,18 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
if (event.isMetaPressed()) {
|
||||
modifier |= KeyboardPacket.MODIFIER_META;
|
||||
}
|
||||
return applyKeySpecificModifiers(event.getKeyCode(), modifier);
|
||||
}
|
||||
|
||||
private byte getModifierState(int keyCode) {
|
||||
return applyKeySpecificModifiers(keyCode, getModifierState());
|
||||
}
|
||||
|
||||
private byte applyKeySpecificModifiers(int keyCode, byte modifier) {
|
||||
if (keyCode == KeyEvent.KEYCODE_PLUS) {
|
||||
// The host protocol has a single US =/+ virtual key, so Android's semantic plus key needs Shift.
|
||||
modifier |= KeyboardPacket.MODIFIER_SHIFT;
|
||||
}
|
||||
return modifier;
|
||||
}
|
||||
|
||||
@@ -2219,14 +2199,12 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@Override
|
||||
public boolean onTouch(View view, MotionEvent event) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
// Tell the OS not to buffer input events for us
|
||||
//
|
||||
// NB: This is still needed even when we call the newer requestUnbufferedDispatch()!
|
||||
view.requestUnbufferedDispatch(event);
|
||||
}
|
||||
}
|
||||
|
||||
return handleMotionEvent(view, event);
|
||||
}
|
||||
@@ -2363,7 +2341,16 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
break;
|
||||
|
||||
default:
|
||||
message = getResources().getString(R.string.conn_terminated_msg);
|
||||
String errorCodeString;
|
||||
// We'll assume large errors are hex values
|
||||
if (Math.abs(errorCode) > 1000) {
|
||||
errorCodeString = Integer.toHexString(errorCode);
|
||||
}
|
||||
else {
|
||||
errorCodeString = Integer.toString(errorCode);
|
||||
}
|
||||
message = getResources().getString(R.string.conn_terminated_msg) + "\n\n" +
|
||||
getResources().getString(R.string.error_code_prefix) + " " + errorCodeString;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2567,6 +2554,11 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
holder.getSurface().setFrameRate(desiredFrameRate,
|
||||
Surface.FRAME_RATE_COMPATIBILITY_FIXED_SOURCE);
|
||||
}
|
||||
|
||||
// Disable producer throttling on the underlying surface for reduced latency
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.CINNAMON_BUN) {
|
||||
holder.getSurface().setProducerThrottlingEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -2644,10 +2636,10 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
}
|
||||
|
||||
if (buttonDown) {
|
||||
conn.sendKeyboardInput(keyMap, KeyboardPacket.KEY_DOWN, getModifierState(), (byte)0);
|
||||
conn.sendKeyboardInput(keyMap, KeyboardPacket.KEY_DOWN, getModifierState(keyCode), (byte)0);
|
||||
}
|
||||
else {
|
||||
conn.sendKeyboardInput(keyMap, KeyboardPacket.KEY_UP, getModifierState(), (byte)0);
|
||||
conn.sendKeyboardInput(keyMap, KeyboardPacket.KEY_UP, getModifierState(keyCode), (byte)0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2663,14 +2655,7 @@ public class Game extends Activity implements SurfaceHolder.Callback,
|
||||
if ((visibility & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
|
||||
hideSystemUi(2000);
|
||||
}
|
||||
// This flag is only set on 4.4+
|
||||
else if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT &&
|
||||
(visibility & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0) {
|
||||
hideSystemUi(2000);
|
||||
}
|
||||
// This flag is only set before 4.4+
|
||||
else if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.KITKAT &&
|
||||
(visibility & View.SYSTEM_UI_FLAG_LOW_PROFILE) == 0) {
|
||||
else if ((visibility & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0) {
|
||||
hideSystemUi(2000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,19 +8,26 @@ import android.content.ServiceConnection;
|
||||
import android.os.Bundle;
|
||||
import android.os.IBinder;
|
||||
|
||||
import com.limelight.computers.ComputerDatabaseManager;
|
||||
import com.limelight.computers.ComputerManagerListener;
|
||||
import com.limelight.computers.ComputerManagerService;
|
||||
import com.limelight.nvstream.http.ComputerDetails;
|
||||
import com.limelight.nvstream.http.NvApp;
|
||||
import com.limelight.nvstream.http.NvHTTP;
|
||||
import com.limelight.nvstream.http.PairingManager;
|
||||
import com.limelight.nvstream.wol.WakeOnLanSender;
|
||||
import com.limelight.utils.CacheHelper;
|
||||
import com.limelight.utils.Dialog;
|
||||
import com.limelight.utils.ServerHelper;
|
||||
import com.limelight.utils.SpinnerDialog;
|
||||
import com.limelight.utils.UiHelper;
|
||||
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
public class ShortcutTrampoline extends Activity {
|
||||
@@ -33,6 +40,7 @@ public class ShortcutTrampoline extends Activity {
|
||||
private SpinnerDialog blockingLoadSpinner;
|
||||
|
||||
private ComputerManagerService.ComputerManagerBinder managerBinder;
|
||||
|
||||
private final ServiceConnection serviceConnection = new ServiceConnection() {
|
||||
public void onServiceConnected(ComponentName className, IBinder binder) {
|
||||
final ComputerManagerService.ComputerManagerBinder localBinder =
|
||||
@@ -214,9 +222,9 @@ public class ShortcutTrampoline extends Activity {
|
||||
}
|
||||
};
|
||||
|
||||
protected boolean validateInput(String uuidString, String appIdString) {
|
||||
// Validate UUID
|
||||
if (uuidString == null) {
|
||||
protected boolean validateInput(String uuidString, String appIdString, String nameString) {
|
||||
// Validate PC UUID/Name
|
||||
if (uuidString == null && nameString == null) {
|
||||
Dialog.displayDialog(ShortcutTrampoline.this,
|
||||
getResources().getString(R.string.conn_error_title),
|
||||
getResources().getString(R.string.scut_invalid_uuid),
|
||||
@@ -224,6 +232,7 @@ public class ShortcutTrampoline extends Activity {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (uuidString != null && !uuidString.isEmpty()) {
|
||||
try {
|
||||
UUID.fromString(uuidString);
|
||||
} catch (IllegalArgumentException ex) {
|
||||
@@ -233,6 +242,16 @@ public class ShortcutTrampoline extends Activity {
|
||||
true);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// UUID is null, so fallback to Name
|
||||
if (nameString == null || nameString.isEmpty()) {
|
||||
Dialog.displayDialog(ShortcutTrampoline.this,
|
||||
getResources().getString(R.string.conn_error_title),
|
||||
getResources().getString(R.string.scut_invalid_uuid),
|
||||
true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Validate App ID (if provided)
|
||||
if (appIdString != null && !appIdString.isEmpty()) {
|
||||
@@ -255,16 +274,86 @@ public class ShortcutTrampoline extends Activity {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
UiHelper.notifyNewRootView(this);
|
||||
ComputerDatabaseManager dbManager = new ComputerDatabaseManager(this);
|
||||
ComputerDetails _computer = null;
|
||||
|
||||
String appIdString = getIntent().getStringExtra(Game.EXTRA_APP_ID);
|
||||
// PC arguments, both are optional, but at least one must be provided
|
||||
uuidString = getIntent().getStringExtra(AppView.UUID_EXTRA);
|
||||
String nameString = getIntent().getStringExtra(AppView.NAME_EXTRA);
|
||||
|
||||
// App arguments, both are optional, but one must be provided in order to start an app
|
||||
String appIdString = getIntent().getStringExtra(Game.EXTRA_APP_ID);
|
||||
String appNameString = getIntent().getStringExtra(Game.EXTRA_APP_NAME);
|
||||
|
||||
if (!validateInput(uuidString, appIdString, nameString)) {
|
||||
// Invalid input, so just return
|
||||
return;
|
||||
}
|
||||
|
||||
if (uuidString == null || uuidString.isEmpty()) {
|
||||
// Use nameString to find the corresponding UUID
|
||||
_computer = dbManager.getComputerByName(nameString);
|
||||
|
||||
if (_computer == null) {
|
||||
Dialog.displayDialog(ShortcutTrampoline.this,
|
||||
getResources().getString(R.string.conn_error_title),
|
||||
getResources().getString(R.string.scut_pc_not_found),
|
||||
true);
|
||||
return;
|
||||
}
|
||||
|
||||
uuidString = _computer.uuid;
|
||||
|
||||
// Set the AppView UUID intent, since it wasn't provided
|
||||
setIntent(new Intent(getIntent()).putExtra(AppView.UUID_EXTRA, uuidString));
|
||||
}
|
||||
|
||||
if (validateInput(uuidString, appIdString)) {
|
||||
if (appIdString != null && !appIdString.isEmpty()) {
|
||||
app = new NvApp(getIntent().getStringExtra(Game.EXTRA_APP_NAME),
|
||||
Integer.parseInt(appIdString),
|
||||
getIntent().getBooleanExtra(Game.EXTRA_APP_HDR, false));
|
||||
}
|
||||
else if (appNameString != null && !appNameString.isEmpty()) {
|
||||
// Use appNameString to find the corresponding AppId
|
||||
try {
|
||||
int appId = -1;
|
||||
String rawAppList = CacheHelper.readInputStreamToString(CacheHelper.openCacheFileForInput(getCacheDir(), "applist", uuidString));
|
||||
|
||||
if (rawAppList.isEmpty()) {
|
||||
Dialog.displayDialog(ShortcutTrampoline.this,
|
||||
getResources().getString(R.string.conn_error_title),
|
||||
getResources().getString(R.string.scut_invalid_app_id),
|
||||
true);
|
||||
return;
|
||||
}
|
||||
List<NvApp> applist = NvHTTP.getAppListByReader(new StringReader(rawAppList));
|
||||
|
||||
for (NvApp _app : applist) {
|
||||
if (_app.getAppName().equals(appNameString)) {
|
||||
appId = _app.getAppId();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (appId < 0) {
|
||||
Dialog.displayDialog(ShortcutTrampoline.this,
|
||||
getResources().getString(R.string.conn_error_title),
|
||||
getResources().getString(R.string.scut_invalid_app_id),
|
||||
true);
|
||||
return;
|
||||
}
|
||||
setIntent(new Intent(getIntent()).putExtra(Game.EXTRA_APP_ID, appId));
|
||||
app = new NvApp(
|
||||
appNameString,
|
||||
appId,
|
||||
getIntent().getBooleanExtra(Game.EXTRA_APP_HDR, false));
|
||||
} catch (IOException | XmlPullParserException e) {
|
||||
Dialog.displayDialog(ShortcutTrampoline.this,
|
||||
getResources().getString(R.string.conn_error_title),
|
||||
getResources().getString(R.string.scut_invalid_app_id),
|
||||
true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Bind to the computer manager service
|
||||
bindService(new Intent(this, ComputerManagerService.class), serviceConnection,
|
||||
@@ -273,7 +362,6 @@ public class ShortcutTrampoline extends Activity {
|
||||
blockingLoadSpinner = SpinnerDialog.displayDialog(this, getResources().getString(R.string.conn_establishing_title),
|
||||
getResources().getString(R.string.applist_connect_msg), true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
|
||||
@@ -26,15 +26,6 @@ public class AndroidAudioRenderer implements AudioRenderer {
|
||||
}
|
||||
|
||||
private AudioTrack createAudioTrack(int channelConfig, int sampleRate, int bufferSize, boolean lowLatency) {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
return new AudioTrack(AudioManager.STREAM_MUSIC,
|
||||
sampleRate,
|
||||
channelConfig,
|
||||
AudioFormat.ENCODING_PCM_16BIT,
|
||||
bufferSize,
|
||||
AudioTrack.MODE_STREAM);
|
||||
}
|
||||
else {
|
||||
AudioAttributes.Builder attributesBuilder = new AudioAttributes.Builder()
|
||||
.setUsage(AudioAttributes.USAGE_GAME);
|
||||
AudioFormat format = new AudioFormat.Builder()
|
||||
@@ -72,7 +63,6 @@ public class AndroidAudioRenderer implements AudioRenderer {
|
||||
AudioManager.AUDIO_SESSION_ID_GENERATE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int setup(MoonBridge.AudioConfiguration audioConfiguration, int sampleRate, int samplesPerFrame) {
|
||||
@@ -91,20 +81,10 @@ public class AndroidAudioRenderer implements AudioRenderer {
|
||||
channelConfig = AudioFormat.CHANNEL_OUT_5POINT1;
|
||||
break;
|
||||
case 8:
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
// AudioFormat.CHANNEL_OUT_7POINT1_SURROUND isn't available until Android 6.0,
|
||||
// yet the CHANNEL_OUT_SIDE_LEFT and CHANNEL_OUT_SIDE_RIGHT constants were added
|
||||
// in 5.0, so just hardcode the constant so we can work on Lollipop.
|
||||
channelConfig = 0x000018fc; // AudioFormat.CHANNEL_OUT_7POINT1_SURROUND
|
||||
}
|
||||
else {
|
||||
// On KitKat and lower, creation of the AudioTrack will fail if we specify
|
||||
// CHANNEL_OUT_SIDE_LEFT or CHANNEL_OUT_SIDE_RIGHT. That leaves us with
|
||||
// the old CHANNEL_OUT_7POINT1 which uses left-of-center and right-of-center
|
||||
// speakers instead of side-left and side-right. This non-standard layout
|
||||
// is probably not what the user wants, but we don't really have a choice.
|
||||
channelConfig = AudioFormat.CHANNEL_OUT_7POINT1;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
LimeLog.severe("Decoder returned unhandled channel count");
|
||||
|
||||
@@ -12,12 +12,12 @@ import java.security.KeyFactory;
|
||||
import java.security.KeyPair;
|
||||
import java.security.KeyPairGenerator;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.Provider;
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.CertificateFactory;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.security.interfaces.RSAPrivateKey;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.util.Calendar;
|
||||
@@ -48,7 +48,7 @@ public class AndroidCryptoProvider implements LimelightCryptoProvider {
|
||||
private final File keyFile;
|
||||
|
||||
private X509Certificate cert;
|
||||
private RSAPrivateKey key;
|
||||
private PrivateKey key;
|
||||
private byte[] pemCertBytes;
|
||||
|
||||
private static final Object globalCryptoLock = new Object();
|
||||
@@ -94,7 +94,7 @@ public class AndroidCryptoProvider implements LimelightCryptoProvider {
|
||||
cert = (X509Certificate) certFactory.generateCertificate(new ByteArrayInputStream(certBytes));
|
||||
pemCertBytes = certBytes;
|
||||
KeyFactory keyFactory = KeyFactory.getInstance("RSA", bcProvider);
|
||||
key = (RSAPrivateKey) keyFactory.generatePrivate(new PKCS8EncodedKeySpec(keyBytes));
|
||||
key = keyFactory.generatePrivate(new PKCS8EncodedKeySpec(keyBytes));
|
||||
} catch (CertificateException e) {
|
||||
// May happen if the cert is corrupt
|
||||
LimeLog.warning("Corrupted certificate");
|
||||
@@ -144,7 +144,7 @@ public class AndroidCryptoProvider implements LimelightCryptoProvider {
|
||||
try {
|
||||
ContentSigner sigGen = new JcaContentSignerBuilder("SHA256withRSA").setProvider(bcProvider).build(keyPair.getPrivate());
|
||||
cert = new JcaX509CertificateConverter().setProvider(bcProvider).getCertificate(certBuilder.build(sigGen));
|
||||
key = (RSAPrivateKey) keyPair.getPrivate();
|
||||
key = keyPair.getPrivate();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -215,7 +215,7 @@ public class AndroidCryptoProvider implements LimelightCryptoProvider {
|
||||
}
|
||||
}
|
||||
|
||||
public RSAPrivateKey getClientPrivateKey() {
|
||||
public PrivateKey getClientPrivateKey() {
|
||||
// Use a lock here to ensure only one guy will be generating or loading
|
||||
// the certificate and key at a time
|
||||
synchronized (globalCryptoLock) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.limelight.binding.input;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
@@ -69,6 +70,7 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
|
||||
private static final int BATTERY_RECHECK_INTERVAL_MS = 120 * 1000;
|
||||
|
||||
@SuppressLint("InlinedApi")
|
||||
private static final Map<Integer, Integer> ANDROID_TO_LI_BUTTON_MAP = Map.ofEntries(
|
||||
Map.entry(KeyEvent.KEYCODE_BUTTON_A, ControllerPacket.A_FLAG),
|
||||
Map.entry(KeyEvent.KEYCODE_BUTTON_B, ControllerPacket.B_FLAG),
|
||||
@@ -133,7 +135,16 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
this.conn = conn;
|
||||
this.gestures = gestures;
|
||||
this.prefConfig = prefConfig;
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
this.deviceVibratorManager = (VibratorManager) activityContext.getSystemService(Context.VIBRATOR_MANAGER_SERVICE);
|
||||
this.deviceVibrator = (Vibrator) this.deviceVibratorManager.getDefaultVibrator();
|
||||
}
|
||||
else {
|
||||
this.deviceVibratorManager = null;
|
||||
this.deviceVibrator = (Vibrator) activityContext.getSystemService(Context.VIBRATOR_SERVICE);
|
||||
}
|
||||
|
||||
this.deviceSensorManager = (SensorManager) activityContext.getSystemService(Context.SENSOR_SERVICE);
|
||||
this.inputManager = (InputManager) activityContext.getSystemService(Context.INPUT_SERVICE);
|
||||
this.mainThreadHandler = new Handler(Looper.getMainLooper());
|
||||
@@ -144,13 +155,6 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
this.backgroundHandlerThread.start();
|
||||
this.backgroundThreadHandler = new Handler(backgroundHandlerThread.getLooper());
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
this.deviceVibratorManager = (VibratorManager) activityContext.getSystemService(Context.VIBRATOR_MANAGER_SERVICE);
|
||||
}
|
||||
else {
|
||||
this.deviceVibratorManager = null;
|
||||
}
|
||||
|
||||
this.sceManager = new SceManager(activityContext);
|
||||
this.sceManager.start();
|
||||
|
||||
@@ -666,7 +670,7 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
// back button to function for navigation.
|
||||
//
|
||||
// First, check if this is an internal device we're being called on.
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && !isExternal(dev)) {
|
||||
if (!isExternal(dev)) {
|
||||
InputManager im = (InputManager) activityContext.getSystemService(Context.INPUT_SERVICE);
|
||||
|
||||
boolean foundInternalGamepad = false;
|
||||
@@ -712,10 +716,8 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
String devName = dev.getName();
|
||||
|
||||
LimeLog.info("Creating controller context for device: "+devName);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
LimeLog.info("Vendor ID: " + dev.getVendorId());
|
||||
LimeLog.info("Product ID: "+dev.getProductId());
|
||||
}
|
||||
LimeLog.info(dev.toString());
|
||||
|
||||
context.inputDevice = dev;
|
||||
@@ -723,7 +725,6 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
context.id = dev.getId();
|
||||
context.external = isExternal(dev);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
context.vendorId = dev.getVendorId();
|
||||
context.productId = dev.getProductId();
|
||||
|
||||
@@ -731,7 +732,6 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
// in our normal InputDevice.hasKeys() probing.
|
||||
context.hasPaddles = MoonBridge.guessControllerHasPaddles(context.vendorId, context.productId);
|
||||
context.hasShare = MoonBridge.guessControllerHasShareButton(context.vendorId, context.productId);
|
||||
}
|
||||
|
||||
// Try to use the InputDevice's associated vibrators first
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && hasQuadAmplitudeControlledRumbleVibrators(dev.getVibratorManager())) {
|
||||
@@ -769,14 +769,14 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
// created upon the first call to InputDevice.getSensorManager(), so we avoid calling this
|
||||
// on Android 12 unless we have a gamepad that could plausibly have motion sensors.
|
||||
// https://cs.android.com/android/_/android/platform/frameworks/base/+/8970010a5e9f3dc5c069f56b4147552accfcbbeb
|
||||
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU ||
|
||||
(Build.VERSION.SDK_INT == Build.VERSION_CODES.S &&
|
||||
(context.vendorId == 0x054c || context.vendorId == 0x057e))) && // Sony or Nintendo
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU || context.vendorId == 0x054c || context.vendorId == 0x057e) && // Sony or Nintendo
|
||||
prefConfig.gamepadMotionSensors) {
|
||||
if (dev.getSensorManager().getDefaultSensor(Sensor.TYPE_ACCELEROMETER) != null || dev.getSensorManager().getDefaultSensor(Sensor.TYPE_GYROSCOPE) != null) {
|
||||
context.sensorManager = dev.getSensorManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if this device has a usable RGB LED and cache that result
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
@@ -786,15 +786,20 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Light.hasRgbControl() was totally broken prior to Android 14.
|
||||
// It always returned true because LIGHT_CAPABILITY_RGB was defined as 0,
|
||||
// so we will just guess RGB is supported if it's a PlayStation controller.
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE && context.vendorId != 0x054c) {
|
||||
context.hasRgbLed = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Detect if the gamepad has Mode and Select buttons according to the Android key layouts.
|
||||
// We do this first because other codepaths below may override these defaults.
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
boolean[] buttons = dev.hasKeys(KeyEvent.KEYCODE_BUTTON_MODE, KeyEvent.KEYCODE_BUTTON_SELECT, KeyEvent.KEYCODE_BACK, 0);
|
||||
context.hasMode = buttons[0];
|
||||
context.hasSelect = buttons[1] || buttons[2];
|
||||
}
|
||||
|
||||
context.touchpadXRange = dev.getMotionRange(MotionEvent.AXIS_X, InputDevice.SOURCE_TOUCHPAD);
|
||||
context.touchpadYRange = dev.getMotionRange(MotionEvent.AXIS_Y, InputDevice.SOURCE_TOUCHPAD);
|
||||
@@ -844,22 +849,15 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
InputDevice.MotionRange rxRange = getMotionRangeForJoystickAxis(dev, MotionEvent.AXIS_RX);
|
||||
InputDevice.MotionRange ryRange = getMotionRangeForJoystickAxis(dev, MotionEvent.AXIS_RY);
|
||||
if (rxRange != null && ryRange != null && devName != null) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (dev.getVendorId() == 0x054c) { // Sony
|
||||
if (dev.hasKeys(KeyEvent.KEYCODE_BUTTON_C)[0]) {
|
||||
LimeLog.info("Detected non-standard DualShock 4 mapping");
|
||||
context.isNonStandardDualShock4 = true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
LimeLog.info("Detected DualShock 4 (Linux standard mapping)");
|
||||
context.usesLinuxGamepadStandardFaceButtons = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (!devName.contains("Xbox") && !devName.contains("XBox") && !devName.contains("X-Box")) {
|
||||
LimeLog.info("Assuming non-standard DualShock 4 mapping on < 4.4");
|
||||
context.isNonStandardDualShock4 = true;
|
||||
}
|
||||
|
||||
if (context.isNonStandardDualShock4) {
|
||||
// The old DS4 driver uses RX and RY for triggers
|
||||
@@ -943,9 +941,6 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
}
|
||||
|
||||
// The ADT-1 controller needs a similar fixup to the ASUS Gamepad
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
// The device name provided is just "Gamepad" which is pretty useless, so we
|
||||
// use VID/PID instead
|
||||
if (dev.getVendorId() == 0x18d1 && dev.getProductId() == 0x2c40) {
|
||||
context.backIsStart = true;
|
||||
context.modeIsSelect = true;
|
||||
@@ -953,7 +948,6 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
context.hasSelect = true;
|
||||
context.hasMode = false;
|
||||
}
|
||||
}
|
||||
|
||||
context.ignoreBack = shouldIgnoreBack(dev);
|
||||
|
||||
@@ -962,9 +956,6 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
// use the back button as start since it doesn't have a start/menu button
|
||||
// on the controller
|
||||
if (devName.contains("ASUS Gamepad")) {
|
||||
// We can only do this check on KitKat or higher, but it doesn't matter since ATV
|
||||
// is Android 5.0 anyway
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
boolean[] hasStartKey = dev.hasKeys(KeyEvent.KEYCODE_BUTTON_START, KeyEvent.KEYCODE_MENU, 0);
|
||||
if (!hasStartKey[0] && !hasStartKey[1]) {
|
||||
context.backIsStart = true;
|
||||
@@ -972,7 +963,6 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
context.hasSelect = true;
|
||||
context.hasMode = false;
|
||||
}
|
||||
}
|
||||
|
||||
// The ASUS Gamepad has triggers that sit far forward and are prone to false presses
|
||||
// so we increase the deadzone on them to minimize this
|
||||
@@ -1014,6 +1004,12 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
}
|
||||
}
|
||||
|
||||
// Thrustmaster Score A gamepad home button reports directly to android as
|
||||
// KEY_HOMEPAGE event on another event channel
|
||||
if (dev.getVendorId() == 0x044f && dev.getProductId() == 0xb328) {
|
||||
context.hasMode = false;
|
||||
}
|
||||
|
||||
LimeLog.info("Analog stick deadzone: "+context.leftStickDeadzoneRadius+" "+context.rightStickDeadzoneRadius);
|
||||
LimeLog.info("Trigger deadzone: "+context.triggerDeadzone);
|
||||
|
||||
@@ -1101,6 +1097,7 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
}
|
||||
|
||||
// This must not be called on the main thread due to risk of ANRs!
|
||||
@SuppressLint("InlinedApi")
|
||||
private void sendControllerBatteryPacket(InputDeviceContext context) {
|
||||
int currentBatteryStatus;
|
||||
float currentBatteryCapacity;
|
||||
@@ -1849,22 +1846,31 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
return true;
|
||||
}
|
||||
|
||||
private short scaleRawStickAxis(float stickValue) {
|
||||
return (short)Math.pow(stickValue, 3);
|
||||
}
|
||||
|
||||
private void sendEmulatedMouseEvent(short x, short y) {
|
||||
private Vector2d convertRawStickAxisToPixelMovement(short stickX, short stickY) {
|
||||
Vector2d vector = new Vector2d();
|
||||
vector.initialize(x, y);
|
||||
vector.initialize(stickX, stickY);
|
||||
vector.scalarMultiply(1 / 32766.0f);
|
||||
vector.scalarMultiply(4);
|
||||
if (vector.getMagnitude() > 0) {
|
||||
// Move faster as the stick is pressed further from center
|
||||
vector.scalarMultiply(Math.pow(vector.getMagnitude(), 2));
|
||||
}
|
||||
return vector;
|
||||
}
|
||||
|
||||
private void sendEmulatedMouseMove(short x, short y) {
|
||||
Vector2d vector = convertRawStickAxisToPixelMovement(x, y);
|
||||
if (vector.getMagnitude() >= 1) {
|
||||
conn.sendMouseMove((short)vector.getX(), (short)-vector.getY());
|
||||
}
|
||||
}
|
||||
|
||||
private void sendEmulatedMouseScroll(short x, short y) {
|
||||
Vector2d vector = convertRawStickAxisToPixelMovement(x, y);
|
||||
if (vector.getMagnitude() >= 1) {
|
||||
conn.sendMouseHighResScroll((short)vector.getY());
|
||||
conn.sendMouseHighResHScroll((short)vector.getX());
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(31)
|
||||
@@ -2031,15 +2037,12 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
.build();
|
||||
vibrator.vibrate(VibrationEffect.createWaveform(new long[]{0, onTime, offTime}, 0), vibrationAttributes);
|
||||
}
|
||||
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
else {
|
||||
AudioAttributes audioAttributes = new AudioAttributes.Builder()
|
||||
.setUsage(AudioAttributes.USAGE_GAME)
|
||||
.build();
|
||||
vibrator.vibrate(new long[]{0, onTime, offTime}, 0, audioAttributes);
|
||||
}
|
||||
else {
|
||||
vibrator.vibrate(new long[]{0, onTime, offTime}, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void handleRumble(short controllerNumber, short lowFreqMotor, short highFreqMotor) {
|
||||
@@ -2104,7 +2107,16 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
else if (foundMatchingDevice && !vibrated && prefConfig.vibrateFallbackToDevice) {
|
||||
// We found a device to vibrate but it didn't have rumble support. The user
|
||||
// has requested us to vibrate the device in this case.
|
||||
rumbleSingleVibrator(deviceVibrator, lowFreqMotor, highFreqMotor);
|
||||
|
||||
// We cast the unsigned short value to a signed int before multiplying by
|
||||
// the preferred strength. The resulting value is capped at 65534 before
|
||||
// we cast it back to a short so it doesn't go above 100%.
|
||||
short lowFreqMotorAdjusted = (short)(Math.min((((lowFreqMotor & 0xffff)
|
||||
* prefConfig.vibrateFallbackToDeviceStrength) / 100), Short.MAX_VALUE*2));
|
||||
short highFreqMotorAdjusted = (short)(Math.min((((highFreqMotor & 0xffff)
|
||||
* prefConfig.vibrateFallbackToDeviceStrength) / 100), Short.MAX_VALUE*2));
|
||||
|
||||
rumbleSingleVibrator(deviceVibrator, lowFreqMotorAdjusted, highFreqMotorAdjusted);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2300,25 +2312,11 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
|
||||
// Ignore input devices without an RGB LED
|
||||
if (deviceContext.controllerNumber == controllerNumber && deviceContext.hasRgbLed) {
|
||||
// Create a new light session if one doesn't already exist
|
||||
if (deviceContext.lightsSession == null) {
|
||||
deviceContext.lightsSession = deviceContext.inputDevice.getLightsManager().openSession();
|
||||
}
|
||||
|
||||
// Convert the RGB components into the integer value that LightState uses
|
||||
int argbValue = 0xFF000000 | ((r << 16) & 0xFF0000) | ((g << 8) & 0xFF00) | (b & 0xFF);
|
||||
LightState lightState = new LightState.Builder().setColor(argbValue).build();
|
||||
deviceContext.ledArgbValue = 0xFF000000 | ((r << 16) & 0xFF0000) | ((g << 8) & 0xFF00) | (b & 0xFF);
|
||||
|
||||
// Set the RGB value for each RGB-controllable LED on the device
|
||||
LightsRequest.Builder lightsRequestBuilder = new LightsRequest.Builder();
|
||||
for (Light light : deviceContext.inputDevice.getLightsManager().getLights()) {
|
||||
if (light.hasRgbControl()) {
|
||||
lightsRequestBuilder.addLight(light, lightState);
|
||||
}
|
||||
}
|
||||
|
||||
// Apply the LED changes
|
||||
deviceContext.lightsSession.requestLights(lightsRequestBuilder.build());
|
||||
backgroundThreadHandler.removeCallbacks(deviceContext.setLedStateRunnable);
|
||||
backgroundThreadHandler.post(deviceContext.setLedStateRunnable);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2898,9 +2896,19 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
return;
|
||||
}
|
||||
|
||||
// Send mouse movement events from analog sticks
|
||||
sendEmulatedMouseEvent(leftStickX, leftStickY);
|
||||
sendEmulatedMouseEvent(rightStickX, rightStickY);
|
||||
// Send mouse events from analog sticks
|
||||
if (prefConfig.analogStickForScrolling == PreferenceConfiguration.AnalogStickForScrolling.RIGHT) {
|
||||
sendEmulatedMouseMove(leftStickX, leftStickY);
|
||||
sendEmulatedMouseScroll(rightStickX, rightStickY);
|
||||
}
|
||||
else if (prefConfig.analogStickForScrolling == PreferenceConfiguration.AnalogStickForScrolling.LEFT) {
|
||||
sendEmulatedMouseMove(rightStickX, rightStickY);
|
||||
sendEmulatedMouseScroll(leftStickX, leftStickY);
|
||||
}
|
||||
else {
|
||||
sendEmulatedMouseMove(leftStickX, leftStickY);
|
||||
sendEmulatedMouseMove(rightStickX, rightStickY);
|
||||
}
|
||||
|
||||
// Requeue the callback
|
||||
mainThreadHandler.postDelayed(this, mouseEmulationReportPeriod);
|
||||
@@ -2943,6 +2951,7 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
|
||||
public boolean hasRgbLed;
|
||||
public LightsManager.LightsSession lightsSession;
|
||||
public int ledArgbValue;
|
||||
|
||||
// These are BatteryState values, not Moonlight values
|
||||
public int lastReportedBatteryStatus;
|
||||
@@ -3019,6 +3028,34 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
}
|
||||
};
|
||||
|
||||
public final Runnable setLedStateRunnable = new Runnable() {
|
||||
@TargetApi(Build.VERSION_CODES.S)
|
||||
@Override
|
||||
public void run() {
|
||||
LightState lightState = new LightState.Builder().setColor(ledArgbValue).build();
|
||||
|
||||
// Set the RGB value for each RGB-controllable LED on the device
|
||||
boolean hasRgbLight = false;
|
||||
LightsRequest.Builder lightsRequestBuilder = new LightsRequest.Builder();
|
||||
for (Light light : inputDevice.getLightsManager().getLights()) {
|
||||
if (light.hasRgbControl()) {
|
||||
lightsRequestBuilder.addLight(light, lightState);
|
||||
hasRgbLight = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasRgbLight) {
|
||||
// Create a new light session if one doesn't already exist
|
||||
if (lightsSession == null) {
|
||||
lightsSession = inputDevice.getLightsManager().openSession();
|
||||
}
|
||||
|
||||
// Apply the LED changes
|
||||
lightsSession.requestLights(lightsRequestBuilder.build());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
super.destroy();
|
||||
@@ -3031,6 +3068,7 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
}
|
||||
|
||||
backgroundThreadHandler.removeCallbacks(enableSensorRunnable);
|
||||
backgroundThreadHandler.removeCallbacks(setLedStateRunnable);
|
||||
|
||||
if (gyroListener != null) {
|
||||
sensorManager.unregisterListener(gyroListener);
|
||||
@@ -3041,7 +3079,11 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||
if (lightsSession != null) {
|
||||
try {
|
||||
lightsSession.close();
|
||||
} catch (RuntimeException e) {
|
||||
LimeLog.warning("Error closing LightsSession: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3050,11 +3092,6 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
|
||||
@Override
|
||||
public void sendControllerArrival() {
|
||||
// Below KitKat we can't get enough information to report controller details accurately
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
|
||||
return;
|
||||
}
|
||||
|
||||
byte type;
|
||||
switch (inputDevice.getVendorId()) {
|
||||
case 0x045e: // Microsoft
|
||||
@@ -3118,10 +3155,7 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
capabilities |= MoonBridge.LI_CCAP_BATTERY_STATE;
|
||||
}
|
||||
|
||||
// Light.hasRgbControl() was totally broken prior to Android 14.
|
||||
// It always returned true because LIGHT_CAPABILITY_RGB was defined as 0,
|
||||
// so we will just guess RGB is supported if it's a PlayStation controller.
|
||||
if (hasRgbLed && (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE || type == MoonBridge.LI_CTYPE_PS)) {
|
||||
if (hasRgbLed) {
|
||||
capabilities |= MoonBridge.LI_CCAP_RGB_LED;
|
||||
}
|
||||
}
|
||||
@@ -3185,6 +3219,7 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
this.lightsSession = oldContext.lightsSession;
|
||||
oldContext.lightsSession = null;
|
||||
}
|
||||
this.ledArgbValue = oldContext.ledArgbValue;
|
||||
this.gyroReportRateHz = oldContext.gyroReportRateHz;
|
||||
this.accelReportRateHz = oldContext.accelReportRateHz;
|
||||
|
||||
@@ -3209,6 +3244,12 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
|
||||
// Re-enable sensors on the new context
|
||||
enableSensors();
|
||||
|
||||
// Refresh the LED state if it's set. We don't know if there was a pending LED state
|
||||
// callback when the context was migrated, so we'll reset it just to be safe.
|
||||
if (this.lightsSession != null) {
|
||||
backgroundThreadHandler.post(setLedStateRunnable);
|
||||
}
|
||||
|
||||
// Refresh battery state and start the battery state polling again
|
||||
backgroundThreadHandler.post(batteryStateUpdateRunnable);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.limelight.binding.input;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.annotation.TargetApi;
|
||||
import android.hardware.input.InputManager;
|
||||
import android.os.Build;
|
||||
@@ -34,6 +35,7 @@ public class KeyboardTranslator implements InputManager.InputDeviceListener {
|
||||
public static final int VK_EQUALS = 61;
|
||||
public static final int VK_ESCAPE = 27;
|
||||
public static final int VK_F1 = 112;
|
||||
public static final int VK_F13 = 0x7C;
|
||||
public static final int VK_END = 35;
|
||||
public static final int VK_HOME = 36;
|
||||
public static final int VK_NUM_LOCK = 144;
|
||||
@@ -126,6 +128,7 @@ public class KeyboardTranslator implements InputManager.InputDeviceListener {
|
||||
* @param deviceId InputDevice.getId() or -1 if unknown
|
||||
* @return a GFE keycode for the given keycode
|
||||
*/
|
||||
@SuppressLint("InlinedApi")
|
||||
public short translate(int keycode, int deviceId) {
|
||||
int translated;
|
||||
|
||||
@@ -161,6 +164,10 @@ public class KeyboardTranslator implements InputManager.InputDeviceListener {
|
||||
keycode <= KeyEvent.KEYCODE_F12) {
|
||||
translated = (keycode - KeyEvent.KEYCODE_F1) + VK_F1;
|
||||
}
|
||||
else if (keycode >= KeyEvent.KEYCODE_F13 &&
|
||||
keycode <= KeyEvent.KEYCODE_F24) {
|
||||
translated = (keycode - KeyEvent.KEYCODE_F13) + VK_F13;
|
||||
}
|
||||
else {
|
||||
switch (keycode) {
|
||||
case KeyEvent.KEYCODE_ALT_LEFT:
|
||||
@@ -349,6 +356,14 @@ public class KeyboardTranslator implements InputManager.InputDeviceListener {
|
||||
translated = 0x6E;
|
||||
break;
|
||||
|
||||
case KeyEvent.KEYCODE_PRINT:
|
||||
translated = 0x2A;
|
||||
break;
|
||||
|
||||
case KeyEvent.KEYCODE_SCREENSHOT:
|
||||
translated = 0x2C;
|
||||
break;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.limelight.binding.input.driver;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.Service;
|
||||
import android.content.BroadcastReceiver;
|
||||
@@ -210,10 +211,8 @@ public class UsbDriverService extends Service implements UsbDriverListener {
|
||||
}
|
||||
|
||||
public static boolean isRecognizedInputDevice(UsbDevice device) {
|
||||
// On KitKat and later, we can determine if this VID and PID combo
|
||||
// matches an existing input device and defer to the built-in controller
|
||||
// support in that case. Prior to KitKat, we'll always return true to be safe.
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
// Determine if this VID and PID combo matches an existing input device
|
||||
// and defer to the built-in controller support in that case.
|
||||
for (int id : InputDevice.getDeviceIds()) {
|
||||
InputDevice inputDev = InputDevice.getDevice(id);
|
||||
if (inputDev == null) {
|
||||
@@ -229,10 +228,6 @@ public class UsbDriverService extends Service implements UsbDriverListener {
|
||||
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean kernelSupportsXboxOne() {
|
||||
String kernelVersion = System.getProperty("os.version");
|
||||
@@ -286,6 +281,7 @@ public class UsbDriverService extends Service implements UsbDriverListener {
|
||||
((!kernelSupportsXbox360W() || claimAllAvailable) && Xbox360WirelessDongle.canClaimDevice(device));
|
||||
}
|
||||
|
||||
@SuppressLint("UnspecifiedRegisterReceiverFlag")
|
||||
private void start() {
|
||||
if (started || usbManager == null) {
|
||||
return;
|
||||
|
||||
@@ -39,6 +39,7 @@ public class Xbox360Controller extends AbstractXboxController {
|
||||
0x20d6, // PowerA
|
||||
0x24c6, // PowerA
|
||||
0x2f24, // GameSir
|
||||
0x2dc8, // 8BitDo
|
||||
};
|
||||
|
||||
public static boolean canClaimDevice(UsbDevice device) {
|
||||
|
||||
@@ -89,12 +89,11 @@ public class Xbox360WirelessDongle extends AbstractController {
|
||||
public boolean start() {
|
||||
int controllerIndex = 0;
|
||||
|
||||
// On KitKat, there is a controller number associated with input devices.
|
||||
// On Android, there is a controller number associated with input devices.
|
||||
// We can use this to approximate the likely controller number. This won't
|
||||
// be completely accurate because there's no guarantee the order of interfaces
|
||||
// matches the order that devices were enumerated by xpad, but it's probably
|
||||
// better than nothing.
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
for (int id : InputDevice.getDeviceIds()) {
|
||||
InputDevice inputDev = InputDevice.getDevice(id);
|
||||
if (inputDev == null) {
|
||||
@@ -112,7 +111,6 @@ public class Xbox360WirelessDongle extends AbstractController {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Send LED commands on the out endpoint of each interface. There is one interface
|
||||
// corresponding to each possible attached controller.
|
||||
|
||||
@@ -25,10 +25,12 @@ public class XboxOneController extends AbstractXboxController {
|
||||
0x20d6, // PowerA
|
||||
0x24c6, // PowerA
|
||||
0x2e24, // Hyperkin
|
||||
0x2dc8, // 8BitDo
|
||||
};
|
||||
|
||||
private static final byte[] FW2015_INIT = {0x05, 0x20, 0x00, 0x01, 0x00};
|
||||
private static final byte[] ONE_S_INIT = {0x05, 0x20, 0x00, 0x0f, 0x06};
|
||||
private static final byte[] SERIES_S_INIT = {0x05, 0x20, 0x00, 0x0f, 0x06};
|
||||
private static final byte[] HORI_INIT = {0x01, 0x20, 0x00, 0x09, 0x00, 0x04, 0x20, 0x3a,
|
||||
0x00, 0x00, 0x00, (byte)0x80, 0x00};
|
||||
private static final byte[] PDP_INIT1 = {0x0a, 0x20, 0x00, 0x03, 0x00, 0x01, 0x14};
|
||||
@@ -43,7 +45,11 @@ public class XboxOneController extends AbstractXboxController {
|
||||
new InitPacket(0x0f0d, 0x0067, HORI_INIT),
|
||||
new InitPacket(0x0000, 0x0000, FW2015_INIT),
|
||||
new InitPacket(0x045e, 0x02ea, ONE_S_INIT),
|
||||
new InitPacket(0x045e, 0x02fe, ONE_S_INIT),
|
||||
new InitPacket(0x045e, 0x0b00, ONE_S_INIT),
|
||||
new InitPacket(0x045e, 0x0b05, SERIES_S_INIT),
|
||||
new InitPacket(0x045e, 0x0b12, SERIES_S_INIT),
|
||||
new InitPacket(0x045e, 0x0b13, SERIES_S_INIT),
|
||||
new InitPacket(0x0e6f, 0x0000, PDP_INIT1),
|
||||
new InitPacket(0x0e6f, 0x0000, PDP_INIT2),
|
||||
new InitPacket(0x24c6, 0x541a, RUMBLE_INIT1),
|
||||
|
||||
+14
@@ -185,6 +185,10 @@ public class VirtualControllerConfigurationLoader {
|
||||
private static final int START_BACK_WIDTH = 12;
|
||||
private static final int START_BACK_HEIGHT = 7;
|
||||
|
||||
// Make the Guide Menu be in the center of START and BACK menu
|
||||
private static final int GUIDE_X = START_X-BACK_X;
|
||||
private static final int GUIDE_Y = START_BACK_Y;
|
||||
|
||||
public static void createDefaultLayout(final VirtualController controller, final Context context) {
|
||||
|
||||
DisplayMetrics screen = context.getResources().getDisplayMetrics();
|
||||
@@ -333,6 +337,16 @@ public class VirtualControllerConfigurationLoader {
|
||||
);
|
||||
}
|
||||
|
||||
if(config.showGuideButton){
|
||||
controller.addElement(createDigitalButton(VirtualControllerElement.EID_GDB,
|
||||
ControllerPacket.SPECIAL_BUTTON_FLAG, 0, 1, "GUIDE", -1, controller, context),
|
||||
screenScale(GUIDE_X, height)+ rightDisplacement,
|
||||
screenScale(GUIDE_Y, height),
|
||||
screenScale(START_BACK_WIDTH, height),
|
||||
screenScale(START_BACK_HEIGHT, height)
|
||||
);
|
||||
}
|
||||
|
||||
controller.setOpacity(config.oscOpacity);
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -35,6 +35,7 @@ public abstract class VirtualControllerElement extends View {
|
||||
public static final int EID_RS = 13;
|
||||
public static final int EID_LSB = 14;
|
||||
public static final int EID_RSB = 15;
|
||||
public static final int EID_GDB = 16;
|
||||
|
||||
protected VirtualController virtualController;
|
||||
protected final int elementId;
|
||||
|
||||
@@ -42,9 +42,6 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
private static final boolean USE_FRAME_RENDER_TIME = false;
|
||||
private static final boolean FRAME_RENDER_TIME_ONLY = USE_FRAME_RENDER_TIME && false;
|
||||
|
||||
// Used on versions < 5.0
|
||||
private ByteBuffer[] legacyInputBuffers;
|
||||
|
||||
private MediaCodecInfo avcDecoder;
|
||||
private MediaCodecInfo hevcDecoder;
|
||||
private MediaCodecInfo av1Decoder;
|
||||
@@ -113,6 +110,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
|
||||
private long lastTimestampUs;
|
||||
private int lastFrameNumber;
|
||||
private long baseTimestampUs;
|
||||
private int refreshRate;
|
||||
private PreferenceConfiguration prefs;
|
||||
|
||||
@@ -136,7 +134,6 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
return decoder;
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
private boolean decoderCanMeetPerformancePoint(MediaCodecInfo.VideoCapabilities caps, PreferenceConfiguration prefs) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
MediaCodecInfo.VideoCapabilities.PerformancePoint targetPerfPoint = new MediaCodecInfo.VideoCapabilities.PerformancePoint(prefs.width, prefs.height, prefs.fps);
|
||||
@@ -179,43 +176,25 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
}
|
||||
|
||||
private boolean decoderCanMeetPerformancePointWithHevcAndNotAvc(MediaCodecInfo hevcDecoderInfo, MediaCodecInfo avcDecoderInfo, PreferenceConfiguration prefs) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
MediaCodecInfo.VideoCapabilities avcCaps = avcDecoderInfo.getCapabilitiesForType("video/avc").getVideoCapabilities();
|
||||
MediaCodecInfo.VideoCapabilities hevcCaps = hevcDecoderInfo.getCapabilitiesForType("video/hevc").getVideoCapabilities();
|
||||
|
||||
return !decoderCanMeetPerformancePoint(avcCaps, prefs) && decoderCanMeetPerformancePoint(hevcCaps, prefs);
|
||||
}
|
||||
else {
|
||||
// No performance data
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean decoderCanMeetPerformancePointWithAv1AndNotHevc(MediaCodecInfo av1DecoderInfo, MediaCodecInfo hevcDecoderInfo, PreferenceConfiguration prefs) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
MediaCodecInfo.VideoCapabilities av1Caps = av1DecoderInfo.getCapabilitiesForType("video/av01").getVideoCapabilities();
|
||||
MediaCodecInfo.VideoCapabilities hevcCaps = hevcDecoderInfo.getCapabilitiesForType("video/hevc").getVideoCapabilities();
|
||||
|
||||
return !decoderCanMeetPerformancePoint(hevcCaps, prefs) && decoderCanMeetPerformancePoint(av1Caps, prefs);
|
||||
}
|
||||
else {
|
||||
// No performance data
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean decoderCanMeetPerformancePointWithAv1AndNotAvc(MediaCodecInfo av1DecoderInfo, MediaCodecInfo avcDecoderInfo, PreferenceConfiguration prefs) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
MediaCodecInfo.VideoCapabilities avcCaps = avcDecoderInfo.getCapabilitiesForType("video/avc").getVideoCapabilities();
|
||||
MediaCodecInfo.VideoCapabilities av1Caps = av1DecoderInfo.getCapabilitiesForType("video/av01").getVideoCapabilities();
|
||||
|
||||
return !decoderCanMeetPerformancePoint(avcCaps, prefs) && decoderCanMeetPerformancePoint(av1Caps, prefs);
|
||||
}
|
||||
else {
|
||||
// No performance data
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private MediaCodecInfo findHevcDecoder(PreferenceConfiguration prefs, boolean meteredNetwork, boolean requestedHdr) {
|
||||
// Don't return anything if H.264 is forced
|
||||
@@ -471,9 +450,8 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
videoFormat.setInteger(MediaFormat.KEY_FRAME_RATE, refreshRate);
|
||||
}
|
||||
|
||||
// Adaptive playback can also be enabled by the whitelist on pre-KitKat devices
|
||||
// so we don't fill these pre-KitKat
|
||||
if (adaptivePlayback && Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
// Populate keys for adaptive playback
|
||||
if (adaptivePlayback) {
|
||||
videoFormat.setInteger(MediaFormat.KEY_MAX_WIDTH, initialWidth);
|
||||
videoFormat.setInteger(MediaFormat.KEY_MAX_HEIGHT, initialHeight);
|
||||
}
|
||||
@@ -486,7 +464,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
|
||||
// If the stream is HDR-capable, the decoder will detect transitions in color standards
|
||||
// rather than us hardcoding them into the MediaFormat.
|
||||
if (getActiveVideoFormat() != MoonBridge.VIDEO_FORMAT_H265_MAIN10) {
|
||||
if ((getActiveVideoFormat() & MoonBridge.VIDEO_FORMAT_MASK_10BIT) == 0) {
|
||||
// Set color format keys when not in HDR mode, since we know they won't change
|
||||
videoFormat.setInteger(MediaFormat.KEY_COLOR_TRANSFER, MediaFormat.COLOR_TRANSFER_SDR_VIDEO);
|
||||
switch (getPreferredColorSpace()) {
|
||||
@@ -548,20 +526,15 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
spsBuffers.clear();
|
||||
ppsBuffers.clear();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
// This will contain the actual accepted input format attributes
|
||||
inputFormat = videoDecoder.getInputFormat();
|
||||
LimeLog.info("Input format: "+inputFormat);
|
||||
}
|
||||
|
||||
videoDecoder.setVideoScalingMode(MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT);
|
||||
|
||||
// Start the decoder
|
||||
videoDecoder.start();
|
||||
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
legacyInputBuffers = videoDecoder.getInputBuffers();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean tryConfigureDecoder(MediaCodecInfo selectedDecoderInfo, MediaFormat format, boolean throwOnCodecError) {
|
||||
@@ -781,7 +754,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
|
||||
// For "non-recoverable" exceptions on L+, we can call reset() to recover
|
||||
// without having to recreate the entire decoder again.
|
||||
if (codecRecoveryType.get() == CR_RECOVERY_TYPE_RESET && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
if (codecRecoveryType.get() == CR_RECOVERY_TYPE_RESET) {
|
||||
LimeLog.warning("Trying to reset decoder after CodecException");
|
||||
try {
|
||||
videoDecoder.reset();
|
||||
@@ -864,7 +837,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && e instanceof CodecException) {
|
||||
if (e instanceof CodecException) {
|
||||
CodecException codecExc = (CodecException) e;
|
||||
|
||||
if (codecExc.isTransient()) {
|
||||
@@ -978,9 +951,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
return;
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
frameTimeNanos -= activity.getWindowManager().getDefaultDisplay().getAppVsyncOffsetNanos();
|
||||
}
|
||||
|
||||
// Don't render unless a new frame is due. This prevents microstutter when streaming
|
||||
// at a frame rate that doesn't match the display (such as 60 FPS on 120 Hz).
|
||||
@@ -995,12 +966,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
Integer nextOutputBuffer = outputBufferQueue.poll();
|
||||
if (nextOutputBuffer != null) {
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
videoDecoder.releaseOutputBuffer(nextOutputBuffer, frameTimeNanos);
|
||||
}
|
||||
else {
|
||||
videoDecoder.releaseOutputBuffer(nextOutputBuffer, true);
|
||||
}
|
||||
|
||||
lastRenderedFrameTimeNanos = frameTimeNanos;
|
||||
activeWindowVideoStats.totalFramesRendered++;
|
||||
@@ -1076,24 +1042,14 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
if (prefs.framePacing == PreferenceConfiguration.FRAME_PACING_MAX_SMOOTHNESS ||
|
||||
prefs.framePacing == PreferenceConfiguration.FRAME_PACING_CAP_FPS) {
|
||||
// In max smoothness or cap FPS mode, we want to never drop frames
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
// Use a PTS that will cause this frame to never be dropped
|
||||
videoDecoder.releaseOutputBuffer(lastIndex, 0);
|
||||
}
|
||||
else {
|
||||
videoDecoder.releaseOutputBuffer(lastIndex, true);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
// Use a PTS that will cause this frame to be dropped if another comes in within
|
||||
// the same V-sync period
|
||||
videoDecoder.releaseOutputBuffer(lastIndex, System.nanoTime());
|
||||
}
|
||||
else {
|
||||
videoDecoder.releaseOutputBuffer(lastIndex, true);
|
||||
}
|
||||
}
|
||||
|
||||
activeWindowVideoStats.totalFramesRendered++;
|
||||
}
|
||||
@@ -1175,7 +1131,6 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
if (nextInputBufferIndex >= 0) {
|
||||
// Using the new getInputBuffer() API on Lollipop allows
|
||||
// the framework to do some performance optimizations for us
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
nextInputBuffer = videoDecoder.getInputBuffer(nextInputBufferIndex);
|
||||
if (nextInputBuffer == null) {
|
||||
// According to the Android docs, getInputBuffer() can return null "if the
|
||||
@@ -1184,13 +1139,6 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
nextInputBufferIndex = -1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
nextInputBuffer = legacyInputBuffers[nextInputBufferIndex];
|
||||
|
||||
// Clear old input data pre-Lollipop
|
||||
nextInputBuffer.clear();
|
||||
}
|
||||
}
|
||||
} catch (IllegalStateException e) {
|
||||
handleDecoderException(e);
|
||||
return false;
|
||||
@@ -1386,7 +1334,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
sps.constraintSet4Flag = true;
|
||||
sps.constraintSet5Flag = true;
|
||||
}
|
||||
else {
|
||||
else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||
// Force the constraints unset otherwise (some may be set by default)
|
||||
sps.constraintSet4Flag = false;
|
||||
sps.constraintSet5Flag = false;
|
||||
@@ -1397,7 +1345,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
@Override
|
||||
public int submitDecodeUnit(byte[] decodeUnitData, int decodeUnitLength, int decodeUnitType,
|
||||
int frameNumber, int frameType, char frameHostProcessingLatency,
|
||||
long receiveTimeMs, long enqueueTimeMs) {
|
||||
long receiveTimeUs, long enqueueTimeUs) {
|
||||
if (stopping) {
|
||||
// Don't bother if we're stopping
|
||||
return MoonBridge.DR_OK;
|
||||
@@ -1490,7 +1438,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
// Since we only need one frame buffered, we'll set the level as low as we can
|
||||
// for known resolution combinations. Reference frame invalidation may need
|
||||
// these, so leave them be for those decoders.
|
||||
if (!refFrameInvalidationActive) {
|
||||
if (!refFrameInvalidationActive && Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
||||
if (initialWidth <= 720 && initialHeight <= 480 && refreshRate <= 60) {
|
||||
// Max 5 buffered frames at 720x480x60
|
||||
LimeLog.info("Patching level_idc to 31");
|
||||
@@ -1696,7 +1644,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
// Count time from first packet received to enqueue time as receive time
|
||||
// We will count DU queue time as part of decoding, because it is directly
|
||||
// caused by a slow decoder.
|
||||
activeWindowVideoStats.totalTimeMs += enqueueTimeMs - receiveTimeMs;
|
||||
activeWindowVideoStats.totalTimeMs += (enqueueTimeUs - receiveTimeUs) / 1000;
|
||||
}
|
||||
|
||||
if (!fetchNextInputBuffer()) {
|
||||
@@ -1722,7 +1670,12 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
}
|
||||
}
|
||||
|
||||
long timestampUs = enqueueTimeMs * 1000;
|
||||
// The frame timestamps use an undefined epoch, so normalize them to uptime microseconds.
|
||||
if (baseTimestampUs == 0) {
|
||||
baseTimestampUs = (SystemClock.uptimeMillis() * 1000) - enqueueTimeUs;
|
||||
}
|
||||
|
||||
long timestampUs = baseTimestampUs + enqueueTimeUs;
|
||||
if (timestampUs <= lastTimestampUs) {
|
||||
// We can't submit multiple buffers with the same timestamp
|
||||
// so bump it up by one before queuing
|
||||
@@ -1878,7 +1831,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
str += "AVC Decoder: "+((renderer.avcDecoder != null) ? renderer.avcDecoder.getName():"(none)")+DELIMITER;
|
||||
str += "HEVC Decoder: "+((renderer.hevcDecoder != null) ? renderer.hevcDecoder.getName():"(none)")+DELIMITER;
|
||||
str += "AV1 Decoder: "+((renderer.av1Decoder != null) ? renderer.av1Decoder.getName():"(none)")+DELIMITER;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && renderer.avcDecoder != null) {
|
||||
if (renderer.avcDecoder != null) {
|
||||
Range<Integer> avcWidthRange = renderer.avcDecoder.getCapabilitiesForType("video/avc").getVideoCapabilities().getSupportedWidths();
|
||||
str += "AVC supported width range: "+avcWidthRange+DELIMITER;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
@@ -1890,7 +1843,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && renderer.hevcDecoder != null) {
|
||||
if (renderer.hevcDecoder != null) {
|
||||
Range<Integer> hevcWidthRange = renderer.hevcDecoder.getCapabilitiesForType("video/hevc").getVideoCapabilities().getSupportedWidths();
|
||||
str += "HEVC supported width range: "+hevcWidthRange+DELIMITER;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
@@ -1902,7 +1855,7 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP && renderer.av1Decoder != null) {
|
||||
if (renderer.av1Decoder != null) {
|
||||
Range<Integer> av1WidthRange = renderer.av1Decoder.getCapabilitiesForType("video/av01").getVideoCapabilities().getSupportedWidths();
|
||||
str += "AV1 supported width range: "+av1WidthRange+DELIMITER;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
@@ -1951,7 +1904,6 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
str += "Average hardware decoder latency: "+renderer.getAverageDecoderLatency()+"ms"+DELIMITER;
|
||||
str += "Frame pacing mode: "+renderer.prefs.framePacing+DELIMITER;
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
if (originalException instanceof CodecException) {
|
||||
CodecException ce = (CodecException) originalException;
|
||||
|
||||
@@ -1963,7 +1915,6 @@ public class MediaCodecDecoderRenderer extends VideoDecoderRenderer implements C
|
||||
str += "Codec Error Code: " + ce.getErrorCode() + DELIMITER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
str += originalException.toString();
|
||||
|
||||
|
||||
@@ -596,11 +596,9 @@ public class MediaCodecHelper {
|
||||
|
||||
public static boolean decoderSupportsFusedIdrFrame(MediaCodecInfo decoderInfo, String mimeType) {
|
||||
// If adaptive playback is supported, we can submit new CSD together with a keyframe
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
try {
|
||||
if (decoderInfo.getCapabilitiesForType(mimeType).
|
||||
isFeatureSupported(CodecCapabilities.FEATURE_AdaptivePlayback))
|
||||
{
|
||||
isFeatureSupported(CodecCapabilities.FEATURE_AdaptivePlayback)) {
|
||||
LimeLog.info("Decoder supports fused IDR frames (FEATURE_AdaptivePlayback)");
|
||||
return true;
|
||||
}
|
||||
@@ -608,14 +606,11 @@ public class MediaCodecHelper {
|
||||
// Tolerate buggy codecs
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean decoderSupportsAdaptivePlayback(MediaCodecInfo decoderInfo, String mimeType) {
|
||||
// Possibly enable adaptive playback on KitKat and above
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (isDecoderInList(blacklistedAdaptivePlaybackPrefixes, decoderInfo.getName())) {
|
||||
LimeLog.info("Decoder blacklisted for adaptive playback");
|
||||
return false;
|
||||
@@ -633,7 +628,6 @@ public class MediaCodecHelper {
|
||||
// Tolerate buggy codecs
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -709,13 +703,6 @@ public class MediaCodecHelper {
|
||||
}
|
||||
|
||||
public static boolean decoderIsWhitelistedForHevc(MediaCodecInfo decoderInfo) {
|
||||
// Google didn't have official support for HEVC (or more importantly, a CTS test) until
|
||||
// Lollipop. I've seen some MediaTek devices on 4.4 crash when attempting to use HEVC,
|
||||
// so I'm restricting HEVC usage to Lollipop and higher.
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// Software decoders are terrible and we never want to use them.
|
||||
// We want to catch decoders like:
|
||||
@@ -785,15 +772,8 @@ public class MediaCodecHelper {
|
||||
private static LinkedList<MediaCodecInfo> getMediaCodecList() {
|
||||
LinkedList<MediaCodecInfo> infoList = new LinkedList<>();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
MediaCodecList mcl = new MediaCodecList(MediaCodecList.REGULAR_CODECS);
|
||||
Collections.addAll(infoList, mcl.getCodecInfos());
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < MediaCodecList.getCodecCount(); i++) {
|
||||
infoList.add(MediaCodecList.getCodecInfoAt(i));
|
||||
}
|
||||
}
|
||||
|
||||
return infoList;
|
||||
}
|
||||
|
||||
@@ -190,6 +190,35 @@ public class ComputerDatabaseManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a computer by name
|
||||
* NOTE: It is perfectly valid for multiple computers to have the same name,
|
||||
* this function will only return the first one it finds.
|
||||
* Consider using getComputerByUUID instead.
|
||||
* @param name The name of the computer
|
||||
* @see ComputerDatabaseManager#getComputerByUUID(String) for alternative.
|
||||
* @return The computer details, or null if no computer with that name exists
|
||||
*/
|
||||
public ComputerDetails getComputerByName(String name) {
|
||||
try (final Cursor c = computerDb.query(
|
||||
COMPUTER_TABLE_NAME, null, COMPUTER_NAME_COLUMN_NAME+"=?",
|
||||
new String[]{ name }, null, null, null)
|
||||
) {
|
||||
if (!c.moveToFirst()) {
|
||||
// No matching computer
|
||||
return null;
|
||||
}
|
||||
|
||||
return getComputerFromCursor(c);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a computer by UUID
|
||||
* @param uuid The UUID of the computer
|
||||
* @see ComputerDatabaseManager#getComputerByName(String) for alternative.
|
||||
* @return The computer details, or null if no computer with that UUID exists
|
||||
*/
|
||||
public ComputerDetails getComputerByUUID(String uuid) {
|
||||
try (final Cursor c = computerDb.query(
|
||||
COMPUTER_TABLE_NAME, null, COMPUTER_UUID_COLUMN_NAME+"=?",
|
||||
|
||||
@@ -341,7 +341,6 @@ public class ComputerManagerService extends Service {
|
||||
// Acquire the default network lock since we could be changing global process state
|
||||
defaultNetworkLock.lock();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
// On Lollipop or later, we can bind our process to the underlying interface
|
||||
// to ensure our STUN request goes out on that interface or not at all (which is
|
||||
// preferable to getting a VPN endpoint address back).
|
||||
@@ -358,16 +357,13 @@ public class ComputerManagerService extends Service {
|
||||
boundToNetwork = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (ConnectivityManager.setProcessDefaultNetwork(net)) {
|
||||
} else if (ConnectivityManager.setProcessDefaultNetwork(net)) {
|
||||
boundToNetwork = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Perform the STUN request if we're not on a VPN or if we bound to a network
|
||||
if (!activeNetworkIsVpn || boundToNetwork) {
|
||||
@@ -383,8 +379,7 @@ public class ComputerManagerService extends Service {
|
||||
if (boundToNetwork) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
connMgr.bindProcessToNetwork(null);
|
||||
}
|
||||
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
} else {
|
||||
ConnectivityManager.setProcessDefaultNetwork(null);
|
||||
}
|
||||
}
|
||||
@@ -394,6 +389,7 @@ public class ComputerManagerService extends Service {
|
||||
defaultNetworkLock.unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private MdnsDiscoveryListener createDiscoveryListener() {
|
||||
return new MdnsDiscoveryListener() {
|
||||
|
||||
@@ -28,15 +28,9 @@ public class DiskAssetLoader {
|
||||
|
||||
public DiskAssetLoader(Context context) {
|
||||
this.cacheDir = context.getCacheDir();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
this.isLowRamDevice =
|
||||
((ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE)).isLowRamDevice();
|
||||
}
|
||||
else {
|
||||
// Use conservative low RAM behavior on very old devices
|
||||
this.isLowRamDevice = true;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean checkCacheExists(CachedAppAssetLoader.LoaderTuple tuple) {
|
||||
return CacheHelper.cacheFileExists(cacheDir, "boxart", tuple.computer.uuid, tuple.app.getAppId() + ".png");
|
||||
|
||||
@@ -198,7 +198,7 @@ public class NvConnection {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
else {
|
||||
NetworkInfo activeNetworkInfo = connMgr.getActiveNetworkInfo();
|
||||
if (activeNetworkInfo != null) {
|
||||
switch (activeNetworkInfo.getType()) {
|
||||
@@ -433,10 +433,7 @@ public class NvConnection {
|
||||
context.negotiatedPacketSize, context.negotiatedRemoteStreaming,
|
||||
context.streamConfig.getAudioConfiguration().toInt(),
|
||||
context.streamConfig.getSupportedVideoFormats(),
|
||||
context.streamConfig.getHevcBitratePercentageMultiplier(),
|
||||
context.streamConfig.getAv1BitratePercentageMultiplier(),
|
||||
context.streamConfig.getClientRefreshRateX100(),
|
||||
context.streamConfig.getEncryptionFlags(),
|
||||
context.riKey.getEncoded(), ib.array(),
|
||||
context.videoCapabilities,
|
||||
context.streamConfig.getColorSpace(),
|
||||
|
||||
@@ -23,8 +23,6 @@ public class StreamConfiguration {
|
||||
private int remote;
|
||||
private MoonBridge.AudioConfiguration audioConfiguration;
|
||||
private int supportedVideoFormats;
|
||||
private int hevcBitratePercentageMultiplier;
|
||||
private int av1BitratePercentageMultiplier;
|
||||
private int attachedGamepadMask;
|
||||
private int encryptionFlags;
|
||||
private int colorRange;
|
||||
@@ -85,16 +83,6 @@ public class StreamConfiguration {
|
||||
return this;
|
||||
}
|
||||
|
||||
public StreamConfiguration.Builder setHevcBitratePercentageMultiplier(int multiplier) {
|
||||
config.hevcBitratePercentageMultiplier = multiplier;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StreamConfiguration.Builder setAv1BitratePercentageMultiplier(int multiplier) {
|
||||
config.av1BitratePercentageMultiplier = multiplier;
|
||||
return this;
|
||||
}
|
||||
|
||||
public StreamConfiguration.Builder setAttachedGamepadMask(int attachedGamepadMask) {
|
||||
config.attachedGamepadMask = attachedGamepadMask;
|
||||
return this;
|
||||
@@ -120,16 +108,6 @@ public class StreamConfiguration {
|
||||
return this;
|
||||
}
|
||||
|
||||
public StreamConfiguration.Builder setAudioEncryption(boolean enable) {
|
||||
if (enable) {
|
||||
config.encryptionFlags |= MoonBridge.ENCFLG_AUDIO;
|
||||
}
|
||||
else {
|
||||
config.encryptionFlags &= ~MoonBridge.ENCFLG_AUDIO;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public StreamConfiguration.Builder setAudioConfiguration(MoonBridge.AudioConfiguration audioConfig) {
|
||||
config.audioConfiguration = audioConfig;
|
||||
return this;
|
||||
@@ -224,14 +202,6 @@ public class StreamConfiguration {
|
||||
return supportedVideoFormats;
|
||||
}
|
||||
|
||||
public int getHevcBitratePercentageMultiplier() {
|
||||
return hevcBitratePercentageMultiplier;
|
||||
}
|
||||
|
||||
public int getAv1BitratePercentageMultiplier() {
|
||||
return av1BitratePercentageMultiplier;
|
||||
}
|
||||
|
||||
public int getAttachedGamepadMask() {
|
||||
return attachedGamepadMask;
|
||||
}
|
||||
@@ -244,10 +214,6 @@ public class StreamConfiguration {
|
||||
return clientRefreshRateX100;
|
||||
}
|
||||
|
||||
public int getEncryptionFlags() {
|
||||
return encryptionFlags;
|
||||
}
|
||||
|
||||
public int getColorRange() {
|
||||
return colorRange;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ public abstract class VideoDecoderRenderer {
|
||||
// for an IDR frame which contains several parameter sets and the I-frame data.
|
||||
public abstract int submitDecodeUnit(byte[] decodeUnitData, int decodeUnitLength, int decodeUnitType,
|
||||
int frameNumber, int frameType, char frameHostProcessingLatency,
|
||||
long receiveTimeMs, long enqueueTimeMs);
|
||||
long receiveTimeUs, long enqueueTimeUs);
|
||||
|
||||
public abstract void cleanup();
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.limelight.nvstream.http;
|
||||
|
||||
import java.security.PrivateKey;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.security.interfaces.RSAPrivateKey;
|
||||
|
||||
public interface LimelightCryptoProvider {
|
||||
X509Certificate getClientCertificate();
|
||||
RSAPrivateKey getClientPrivateKey();
|
||||
PrivateKey getClientPrivateKey();
|
||||
byte[] getPemEncodedClientCertificate();
|
||||
String encodeBase64String(byte[] data);
|
||||
}
|
||||
@@ -50,6 +50,7 @@ import com.limelight.BuildConfig;
|
||||
import com.limelight.LimeLog;
|
||||
import com.limelight.nvstream.ConnectionContext;
|
||||
import com.limelight.nvstream.http.PairingManager.PairState;
|
||||
import com.limelight.nvstream.jni.MoonBridge;
|
||||
|
||||
import okhttp3.ConnectionPool;
|
||||
import okhttp3.HttpUrl;
|
||||
@@ -402,16 +403,7 @@ public class NvHTTP {
|
||||
try {
|
||||
SSLContext sc = SSLContext.getInstance("TLS");
|
||||
sc.init(new KeyManager[] { keyManager }, new TrustManager[] { trustManager }, new SecureRandom());
|
||||
|
||||
// TLS 1.2 is not enabled by default prior to Android 5.0, so we'll need a custom
|
||||
// SSLSocketFactory in order to connect to GFE 3.20.4 which requires TLSv1.2 or later.
|
||||
// We don't just always use TLSv12SocketFactory because explicitly specifying TLS versions
|
||||
// prevents later TLS versions from being negotiated even if client and server otherwise
|
||||
// support them.
|
||||
return client.newBuilder().sslSocketFactory(
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ?
|
||||
sc.getSocketFactory() : new TLSv12SocketFactory(sc),
|
||||
trustManager).build();
|
||||
return client.newBuilder().sslSocketFactory(sc.getSocketFactory(), trustManager).build();
|
||||
} catch (NoSuchAlgorithmException | KeyManagementException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -594,6 +586,12 @@ public class NvHTTP {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an app by ID
|
||||
* @param appId The ID of the app
|
||||
* @see #getAppByName(String) for alternative.
|
||||
* @return app details, or null if no app with that ID exists
|
||||
*/
|
||||
public NvApp getAppById(int appId) throws IOException, XmlPullParserException {
|
||||
LinkedList<NvApp> appList = getAppList();
|
||||
for (NvApp appFromList : appList) {
|
||||
@@ -604,10 +602,15 @@ public class NvHTTP {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* NOTE: Only use this function if you know what you're doing.
|
||||
* It's totally valid to have two apps named the same thing,
|
||||
* or even nothing at all! Look apps up by ID if at all possible
|
||||
* using the above function */
|
||||
/**
|
||||
* Get an app by name
|
||||
* NOTE: It is perfectly valid for multiple apps to have the same name,
|
||||
* this function will only return the first one it finds.
|
||||
* Consider using getAppById instead.
|
||||
* @param appName The name of the app
|
||||
* @see #getAppById(int) for alternative.
|
||||
* @return app details, or null if no app with that name exists
|
||||
*/
|
||||
public NvApp getAppByName(String appName) throws IOException, XmlPullParserException {
|
||||
LinkedList<NvApp> appList = getAppList();
|
||||
for (NvApp appFromList : appList) {
|
||||
@@ -784,7 +787,8 @@ public class NvHTTP {
|
||||
"&surroundAudioInfo=" + context.streamConfig.getAudioConfiguration().getSurroundAudioInfo() +
|
||||
"&remoteControllersBitmap=" + context.streamConfig.getAttachedGamepadMask() +
|
||||
"&gcmap=" + context.streamConfig.getAttachedGamepadMask() +
|
||||
"&gcpersist="+(context.streamConfig.getPersistGamepadsAfterDisconnect() ? 1 : 0));
|
||||
"&gcpersist="+(context.streamConfig.getPersistGamepadsAfterDisconnect() ? 1 : 0) +
|
||||
MoonBridge.getLaunchUrlQueryParameters());
|
||||
if ((verb.equals("launch") && !getXmlString(xmlStr, "gamesession", true).equals("0") ||
|
||||
(verb.equals("resume") && !getXmlString(xmlStr, "resume", true).equals("0")))) {
|
||||
// sessionUrl0 will be missing for older GFE versions
|
||||
@@ -812,62 +816,4 @@ public class NvHTTP {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Based on example code from https://blog.dev-area.net/2015/08/13/android-4-1-enable-tls-1-1-and-tls-1-2/
|
||||
private static class TLSv12SocketFactory extends SSLSocketFactory {
|
||||
private SSLSocketFactory internalSSLSocketFactory;
|
||||
|
||||
public TLSv12SocketFactory(SSLContext context) {
|
||||
internalSSLSocketFactory = context.getSocketFactory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getDefaultCipherSuites() {
|
||||
return internalSSLSocketFactory.getDefaultCipherSuites();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getSupportedCipherSuites() {
|
||||
return internalSSLSocketFactory.getSupportedCipherSuites();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket() throws IOException {
|
||||
return enableTLSv12OnSocket(internalSSLSocketFactory.createSocket());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException {
|
||||
return enableTLSv12OnSocket(internalSSLSocketFactory.createSocket(s, host, port, autoClose));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket(String host, int port) throws IOException {
|
||||
return enableTLSv12OnSocket(internalSSLSocketFactory.createSocket(host, port));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException {
|
||||
return enableTLSv12OnSocket(internalSSLSocketFactory.createSocket(host, port, localHost, localPort));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket(InetAddress host, int port) throws IOException {
|
||||
return enableTLSv12OnSocket(internalSSLSocketFactory.createSocket(host, port));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException {
|
||||
return enableTLSv12OnSocket(internalSSLSocketFactory.createSocket(address, port, localAddress, localPort));
|
||||
}
|
||||
|
||||
private Socket enableTLSv12OnSocket(Socket socket) {
|
||||
if (socket instanceof SSLSocket) {
|
||||
// TLS 1.2 is not enabled by default prior to Android 5.0. We must enable it
|
||||
// explicitly to ensure we can communicate with GFE 3.20.4 which blocks TLS 1.0.
|
||||
((SSLSocket)socket).setEnabledProtocols(new String[] {"TLSv1.2"});
|
||||
}
|
||||
return socket;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,9 +99,20 @@ public class PairingManager {
|
||||
return saltedPin;
|
||||
}
|
||||
|
||||
private static Signature getSha256SignatureInstanceForKey(Key key) throws NoSuchAlgorithmException {
|
||||
switch (key.getAlgorithm()) {
|
||||
case "RSA":
|
||||
return Signature.getInstance("SHA256withRSA");
|
||||
case "EC":
|
||||
return Signature.getInstance("SHA256withECDSA");
|
||||
default:
|
||||
throw new NoSuchAlgorithmException("Unhandled key algorithm: " + key.getAlgorithm());
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean verifySignature(byte[] data, byte[] signature, Certificate cert) {
|
||||
try {
|
||||
Signature sig = Signature.getInstance("SHA256withRSA");
|
||||
Signature sig = PairingManager.getSha256SignatureInstanceForKey(cert.getPublicKey());
|
||||
sig.initVerify(cert.getPublicKey());
|
||||
sig.update(data);
|
||||
return sig.verify(signature);
|
||||
@@ -113,12 +124,10 @@ public class PairingManager {
|
||||
|
||||
private static byte[] signData(byte[] data, PrivateKey key) {
|
||||
try {
|
||||
Signature sig = Signature.getInstance("SHA256withRSA");
|
||||
Signature sig = PairingManager.getSha256SignatureInstanceForKey(key);
|
||||
sig.initSign(key);
|
||||
sig.update(data);
|
||||
byte[] signature = new byte[256];
|
||||
sig.sign(signature, 0, signature.length);
|
||||
return signature;
|
||||
return sig.sign();
|
||||
} catch (NoSuchAlgorithmException | SignatureException | InvalidKeyException e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
@@ -245,7 +254,7 @@ public class PairingManager {
|
||||
// Get the server's signed secret
|
||||
byte[] serverSecretResp = hexToBytes(NvHTTP.getXmlString(secretResp, "pairingsecret", true));
|
||||
byte[] serverSecret = Arrays.copyOfRange(serverSecretResp, 0, 16);
|
||||
byte[] serverSignature = Arrays.copyOfRange(serverSecretResp, 16, 272);
|
||||
byte[] serverSignature = Arrays.copyOfRange(serverSecretResp, 16, serverSecretResp.length);
|
||||
|
||||
// Ensure the authenticity of the data
|
||||
if (!verifySignature(serverSecret, serverSignature, serverCert)) {
|
||||
|
||||
@@ -22,10 +22,6 @@ public class MoonBridge {
|
||||
public static final int VIDEO_FORMAT_MASK_AV1 = 0xF000;
|
||||
public static final int VIDEO_FORMAT_MASK_10BIT = 0x2200;
|
||||
|
||||
public static final int ENCFLG_NONE = 0;
|
||||
public static final int ENCFLG_AUDIO = 1;
|
||||
public static final int ENCFLG_ALL = 0xFFFFFFFF;
|
||||
|
||||
public static final int BUFFER_TYPE_PICDATA = 0;
|
||||
public static final int BUFFER_TYPE_SPS = 1;
|
||||
public static final int BUFFER_TYPE_PPS = 2;
|
||||
@@ -106,6 +102,7 @@ public class MoonBridge {
|
||||
public static final byte LI_CTYPE_XBOX = 0x01;
|
||||
public static final byte LI_CTYPE_PS = 0x02;
|
||||
public static final byte LI_CTYPE_NINTENDO = 0x03;
|
||||
public static final byte LI_CTYPE_STEAM = 0x04;
|
||||
|
||||
public static final short LI_CCAP_ANALOG_TRIGGERS = 0x01;
|
||||
public static final short LI_CCAP_RUMBLE = 0x02;
|
||||
@@ -115,6 +112,7 @@ public class MoonBridge {
|
||||
public static final short LI_CCAP_GYRO = 0x20;
|
||||
public static final short LI_CCAP_BATTERY_STATE = 0x40;
|
||||
public static final short LI_CCAP_RGB_LED = 0x80;
|
||||
public static final short LI_CCAP_DUAL_TOUCHPAD = 0x100;
|
||||
|
||||
public static final byte LI_MOTION_TYPE_ACCEL = 0x01;
|
||||
public static final byte LI_MOTION_TYPE_GYRO = 0x02;
|
||||
@@ -221,10 +219,10 @@ public class MoonBridge {
|
||||
|
||||
public static int bridgeDrSubmitDecodeUnit(byte[] decodeUnitData, int decodeUnitLength, int decodeUnitType,
|
||||
int frameNumber, int frameType, char frameHostProcessingLatency,
|
||||
long receiveTimeMs, long enqueueTimeMs) {
|
||||
long receiveTimeUs, long enqueueTimeUs) {
|
||||
if (videoRenderer != null) {
|
||||
return videoRenderer.submitDecodeUnit(decodeUnitData, decodeUnitLength,
|
||||
decodeUnitType, frameNumber, frameType, frameHostProcessingLatency, receiveTimeMs, enqueueTimeMs);
|
||||
decodeUnitType, frameNumber, frameType, frameHostProcessingLatency, receiveTimeUs, enqueueTimeUs);
|
||||
}
|
||||
else {
|
||||
return DR_OK;
|
||||
@@ -347,10 +345,7 @@ public class MoonBridge {
|
||||
int width, int height, int fps,
|
||||
int bitrate, int packetSize, int streamingRemotely,
|
||||
int audioConfiguration, int supportedVideoFormats,
|
||||
int hevcBitratePercentageMultiplier,
|
||||
int av1BitratePercentageMultiplier,
|
||||
int clientRefreshRateX100,
|
||||
int encryptionFlags,
|
||||
byte[] riAesKey, byte[] riAesIv,
|
||||
int videoCapabilities,
|
||||
int colorSpace, int colorRange);
|
||||
@@ -415,6 +410,8 @@ public class MoonBridge {
|
||||
// The RTT is in the top 32 bits, and the RTT variance is in the bottom 32 bits
|
||||
public static native long getEstimatedRttInfo();
|
||||
|
||||
public static native String getLaunchUrlQueryParameters();
|
||||
|
||||
public static native byte guessControllerType(int vendorId, int productId);
|
||||
|
||||
public static native boolean guessControllerHasPaddles(int vendorId, int productId);
|
||||
|
||||
@@ -13,7 +13,6 @@ import com.limelight.R;
|
||||
import static com.limelight.binding.input.virtual_controller.VirtualControllerConfigurationLoader.OSC_PREFERENCE;
|
||||
|
||||
public class ConfirmDeleteOscPreference extends DialogPreference {
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public ConfirmDeleteOscPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
@@ -26,7 +25,6 @@ public class ConfirmDeleteOscPreference extends DialogPreference {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public ConfirmDeleteOscPreference(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@@ -11,12 +11,10 @@ import android.provider.Settings;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
public class LanguagePreference extends ListPreference {
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public LanguagePreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public LanguagePreference(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,12 @@ public class PreferenceConfiguration {
|
||||
FORCE_H264,
|
||||
};
|
||||
|
||||
public enum AnalogStickForScrolling {
|
||||
NONE,
|
||||
RIGHT,
|
||||
LEFT
|
||||
}
|
||||
|
||||
private static final String LEGACY_RES_FPS_PREF_STRING = "list_resolution_fps";
|
||||
private static final String LEGACY_ENABLE_51_SURROUND_PREF_STRING = "checkbox_51_surround";
|
||||
|
||||
@@ -38,16 +44,19 @@ public class PreferenceConfiguration {
|
||||
private static final String VIDEO_FORMAT_PREF_STRING = "video_format";
|
||||
private static final String ONSCREEN_CONTROLLER_PREF_STRING = "checkbox_show_onscreen_controls";
|
||||
private static final String ONLY_L3_R3_PREF_STRING = "checkbox_only_show_L3R3";
|
||||
private static final String SHOW_GUIDE_BUTTON_PREF_STRING = "checkbox_show_guide_button";
|
||||
private static final String LEGACY_DISABLE_FRAME_DROP_PREF_STRING = "checkbox_disable_frame_drop";
|
||||
private static final String ENABLE_HDR_PREF_STRING = "checkbox_enable_hdr";
|
||||
private static final String ENABLE_PIP_PREF_STRING = "checkbox_enable_pip";
|
||||
private static final String ENABLE_PERF_OVERLAY_STRING = "checkbox_enable_perf_overlay";
|
||||
private static final String BIND_ALL_USB_STRING = "checkbox_usb_bind_all";
|
||||
private static final String MOUSE_EMULATION_STRING = "checkbox_mouse_emulation";
|
||||
private static final String ANALOG_SCROLLING_PREF_STRING = "analog_scrolling";
|
||||
private static final String MOUSE_NAV_BUTTONS_STRING = "checkbox_mouse_nav_buttons";
|
||||
static final String UNLOCK_FPS_STRING = "checkbox_unlock_fps";
|
||||
private static final String VIBRATE_OSC_PREF_STRING = "checkbox_vibrate_osc";
|
||||
private static final String VIBRATE_FALLBACK_PREF_STRING = "checkbox_vibrate_fallback";
|
||||
private static final String VIBRATE_FALLBACK_STRENGTH_PREF_STRING = "seekbar_vibrate_fallback_strength";
|
||||
private static final String FLIP_FACE_BUTTONS_PREF_STRING = "checkbox_flip_face_buttons";
|
||||
private static final String TOUCHSCREEN_TRACKPAD_PREF_STRING = "checkbox_touchscreen_trackpad";
|
||||
private static final String LATENCY_TOAST_PREF_STRING = "checkbox_enable_post_stream_toast";
|
||||
@@ -75,15 +84,18 @@ public class PreferenceConfiguration {
|
||||
|
||||
private static final boolean ONSCREEN_CONTROLLER_DEFAULT = false;
|
||||
private static final boolean ONLY_L3_R3_DEFAULT = false;
|
||||
private static final boolean SHOW_GUIDE_BUTTON_DEFAULT = true;
|
||||
private static final boolean DEFAULT_ENABLE_HDR = false;
|
||||
private static final boolean DEFAULT_ENABLE_PIP = false;
|
||||
private static final boolean DEFAULT_ENABLE_PERF_OVERLAY = false;
|
||||
private static final boolean DEFAULT_BIND_ALL_USB = false;
|
||||
private static final boolean DEFAULT_MOUSE_EMULATION = true;
|
||||
private static final String DEFAULT_ANALOG_STICK_FOR_SCROLLING = "right";
|
||||
private static final boolean DEFAULT_MOUSE_NAV_BUTTONS = false;
|
||||
private static final boolean DEFAULT_UNLOCK_FPS = false;
|
||||
private static final boolean DEFAULT_VIBRATE_OSC = true;
|
||||
private static final boolean DEFAULT_VIBRATE_FALLBACK = false;
|
||||
private static final int DEFAULT_VIBRATE_FALLBACK_STRENGTH = 100;
|
||||
private static final boolean DEFAULT_FLIP_FACE_BUTTONS = false;
|
||||
private static final boolean DEFAULT_TOUCHSCREEN_TRACKPAD = true;
|
||||
private static final String DEFAULT_AUDIO_CONFIG = "2"; // Stereo
|
||||
@@ -120,16 +132,19 @@ public class PreferenceConfiguration {
|
||||
public boolean smallIconMode, multiController, usbDriver, flipFaceButtons;
|
||||
public boolean onscreenController;
|
||||
public boolean onlyL3R3;
|
||||
public boolean showGuideButton;
|
||||
public boolean enableHdr;
|
||||
public boolean enablePip;
|
||||
public boolean enablePerfOverlay;
|
||||
public boolean enableLatencyToast;
|
||||
public boolean bindAllUsb;
|
||||
public boolean mouseEmulation;
|
||||
public AnalogStickForScrolling analogStickForScrolling;
|
||||
public boolean mouseNavButtons;
|
||||
public boolean unlockFps;
|
||||
public boolean vibrateOsc;
|
||||
public boolean vibrateFallbackToDevice;
|
||||
public int vibrateFallbackToDeviceStrength;
|
||||
public boolean touchscreenTrackpad;
|
||||
public MoonBridge.AudioConfiguration audioConfiguration;
|
||||
public int framePacing;
|
||||
@@ -384,6 +399,21 @@ public class PreferenceConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
private static AnalogStickForScrolling getAnalogStickForScrollingValue(Context context) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
|
||||
String str = prefs.getString(ANALOG_SCROLLING_PREF_STRING, DEFAULT_ANALOG_STICK_FOR_SCROLLING);
|
||||
if (str.equals("right")) {
|
||||
return AnalogStickForScrolling.RIGHT;
|
||||
}
|
||||
else if (str.equals("left")) {
|
||||
return AnalogStickForScrolling.LEFT;
|
||||
}
|
||||
else {
|
||||
return AnalogStickForScrolling.NONE;
|
||||
}
|
||||
}
|
||||
|
||||
public static void resetStreamingSettings(Context context) {
|
||||
// We consider resolution, FPS, bitrate, HDR, and video format as "streaming settings" here
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
@@ -532,6 +562,8 @@ public class PreferenceConfiguration {
|
||||
config.videoFormat = getVideoFormatValue(context);
|
||||
config.framePacing = getFramePacingValue(context);
|
||||
|
||||
config.analogStickForScrolling = getAnalogStickForScrollingValue(context);
|
||||
|
||||
config.deadzonePercentage = prefs.getInt(DEADZONE_PREF_STRING, DEFAULT_DEADZONE);
|
||||
|
||||
config.oscOpacity = prefs.getInt(OSC_OPACITY_PREF_STRING, DEFAULT_OPACITY);
|
||||
@@ -548,6 +580,7 @@ public class PreferenceConfiguration {
|
||||
config.usbDriver = prefs.getBoolean(USB_DRIVER_PREF_SRING, DEFAULT_USB_DRIVER);
|
||||
config.onscreenController = prefs.getBoolean(ONSCREEN_CONTROLLER_PREF_STRING, ONSCREEN_CONTROLLER_DEFAULT);
|
||||
config.onlyL3R3 = prefs.getBoolean(ONLY_L3_R3_PREF_STRING, ONLY_L3_R3_DEFAULT);
|
||||
config.showGuideButton = prefs.getBoolean(SHOW_GUIDE_BUTTON_PREF_STRING, SHOW_GUIDE_BUTTON_DEFAULT);
|
||||
config.enableHdr = prefs.getBoolean(ENABLE_HDR_PREF_STRING, DEFAULT_ENABLE_HDR) && !isShieldAtvFirmwareWithBrokenHdr();
|
||||
config.enablePip = prefs.getBoolean(ENABLE_PIP_PREF_STRING, DEFAULT_ENABLE_PIP);
|
||||
config.enablePerfOverlay = prefs.getBoolean(ENABLE_PERF_OVERLAY_STRING, DEFAULT_ENABLE_PERF_OVERLAY);
|
||||
@@ -557,6 +590,7 @@ public class PreferenceConfiguration {
|
||||
config.unlockFps = prefs.getBoolean(UNLOCK_FPS_STRING, DEFAULT_UNLOCK_FPS);
|
||||
config.vibrateOsc = prefs.getBoolean(VIBRATE_OSC_PREF_STRING, DEFAULT_VIBRATE_OSC);
|
||||
config.vibrateFallbackToDevice = prefs.getBoolean(VIBRATE_FALLBACK_PREF_STRING, DEFAULT_VIBRATE_FALLBACK);
|
||||
config.vibrateFallbackToDeviceStrength = prefs.getInt(VIBRATE_FALLBACK_STRENGTH_PREF_STRING, DEFAULT_VIBRATE_FALLBACK_STRENGTH);
|
||||
config.flipFaceButtons = prefs.getBoolean(FLIP_FACE_BUTTONS_PREF_STRING, DEFAULT_FLIP_FACE_BUTTONS);
|
||||
config.touchscreenTrackpad = prefs.getBoolean(TOUCHSCREEN_TRACKPAD_PREF_STRING, DEFAULT_TOUCHSCREEN_TRACKPAD);
|
||||
config.enableLatencyToast = prefs.getBoolean(LATENCY_TOAST_PREF_STRING, DEFAULT_LATENCY_TOAST);
|
||||
|
||||
@@ -333,19 +333,23 @@ public class StreamSettings extends Activity {
|
||||
(PreferenceCategory) findPreference("category_help");
|
||||
screen.removePreference(category);
|
||||
}*/
|
||||
|
||||
PreferenceCategory category_gamepad_settings =
|
||||
(PreferenceCategory) findPreference("category_gamepad_settings");
|
||||
// Remove the vibration options if the device can't vibrate
|
||||
if (!((Vibrator)getActivity().getSystemService(Context.VIBRATOR_SERVICE)).hasVibrator()) {
|
||||
PreferenceCategory category =
|
||||
(PreferenceCategory) findPreference("category_gamepad_settings");
|
||||
category.removePreference(findPreference("checkbox_vibrate_fallback"));
|
||||
|
||||
category_gamepad_settings.removePreference(findPreference("checkbox_vibrate_fallback"));
|
||||
category_gamepad_settings.removePreference(findPreference("seekbar_vibrate_fallback_strength"));
|
||||
// The entire OSC category may have already been removed by the touchscreen check above
|
||||
category = (PreferenceCategory) findPreference("category_onscreen_controls");
|
||||
PreferenceCategory category = (PreferenceCategory) findPreference("category_onscreen_controls");
|
||||
if (category != null) {
|
||||
category.removePreference(findPreference("checkbox_vibrate_osc"));
|
||||
}
|
||||
}
|
||||
else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O ||
|
||||
!((Vibrator)getActivity().getSystemService(Context.VIBRATOR_SERVICE)).hasAmplitudeControl() ) {
|
||||
// Remove the vibration strength selector of the device doesn't have amplitude control
|
||||
category_gamepad_settings.removePreference(findPreference("seekbar_vibrate_fallback_strength"));
|
||||
}
|
||||
|
||||
Display display = getActivity().getWindowManager().getDefaultDisplay();
|
||||
float maxSupportedFps = display.getRefreshRate();
|
||||
@@ -507,29 +511,15 @@ public class StreamSettings extends Activity {
|
||||
// Never remove 720p
|
||||
}
|
||||
}
|
||||
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||
// On Android 4.2 and later, we can get the true metrics via the
|
||||
// getRealMetrics() function (unlike the lies that getWidth() and getHeight()
|
||||
// tell to us).
|
||||
else {
|
||||
// We can get the true metrics via the getRealMetrics() function (unlike the lies
|
||||
// that getWidth() and getHeight() tell to us).
|
||||
DisplayMetrics metrics = new DisplayMetrics();
|
||||
display.getRealMetrics(metrics);
|
||||
int width = Math.max(metrics.widthPixels, metrics.heightPixels);
|
||||
int height = Math.min(metrics.widthPixels, metrics.heightPixels);
|
||||
addNativeResolutionEntries(width, height, false);
|
||||
}
|
||||
else {
|
||||
// On Android 4.1, we have to resort to reflection to invoke hidden APIs
|
||||
// to get the real screen dimensions.
|
||||
try {
|
||||
Method getRawHeightFunc = Display.class.getMethod("getRawHeight");
|
||||
Method getRawWidthFunc = Display.class.getMethod("getRawWidth");
|
||||
int width = (Integer) getRawWidthFunc.invoke(display);
|
||||
int height = (Integer) getRawHeightFunc.invoke(display);
|
||||
addNativeResolutionEntries(Math.max(width, height), Math.min(width, height), false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
if (!PreferenceConfiguration.readPreferences(this.getActivity()).unlockFps) {
|
||||
// We give some extra room in case the FPS is rounded down
|
||||
@@ -558,27 +548,8 @@ public class StreamSettings extends Activity {
|
||||
}
|
||||
addNativeFrameRateEntry(maxSupportedFps);
|
||||
|
||||
// Android L introduces proper 7.1 surround sound support. Remove the 7.1 option
|
||||
// for earlier versions of Android to prevent AudioTrack initialization issues.
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
LimeLog.info("Excluding 7.1 surround sound option based on OS");
|
||||
removeValue(PreferenceConfiguration.AUDIO_CONFIG_PREF_STRING, "71", new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
setValue(PreferenceConfiguration.AUDIO_CONFIG_PREF_STRING, "51");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Android L introduces the drop duplicate behavior of releaseOutputBuffer()
|
||||
// that the unlock FPS option relies on to not massively increase latency.
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
|
||||
LimeLog.info("Excluding unlock FPS toggle based on OS");
|
||||
PreferenceCategory category =
|
||||
(PreferenceCategory) findPreference("category_advanced_settings");
|
||||
category.removePreference(findPreference("checkbox_unlock_fps"));
|
||||
}
|
||||
else {
|
||||
findPreference(PreferenceConfiguration.UNLOCK_FPS_STRING).setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
|
||||
@Override
|
||||
public boolean onPreferenceChange(Preference preference, Object newValue) {
|
||||
@@ -600,7 +571,6 @@ public class StreamSettings extends Activity {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Remove HDR preference for devices below Nougat
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
|
||||
@@ -619,6 +589,7 @@ public class StreamSettings extends Activity {
|
||||
for (int hdrType : hdrCaps.getSupportedHdrTypes()) {
|
||||
if (hdrType == Display.HdrCapabilities.HDR_TYPE_HDR10) {
|
||||
foundHdr10 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ public class WebLauncherPreference extends Preference {
|
||||
initialize(attrs);
|
||||
}
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
public WebLauncherPreference(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
initialize(attrs);
|
||||
|
||||
@@ -30,6 +30,6 @@ public class AdapterFragment extends Fragment {
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
callbacks.receiveAbsListView((AbsListView) getView().findViewById(R.id.fragmentView));
|
||||
callbacks.receiveAbsListView(getView().findViewById(R.id.fragmentView));
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,6 @@ public class StreamView extends SurfaceView {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
@TargetApi(21)
|
||||
public StreamView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
|
||||
super(context, attrs, defStyleAttr, defStyleRes);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ public class NetHelper {
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
else {
|
||||
NetworkInfo activeNetworkInfo = connMgr.getActiveNetworkInfo();
|
||||
if (activeNetworkInfo != null) {
|
||||
return activeNetworkInfo.getType() == ConnectivityManager.TYPE_VPN;
|
||||
|
||||
@@ -2,15 +2,12 @@ package com.limelight.utils;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ShortcutInfo;
|
||||
import android.content.pm.ShortcutManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.Icon;
|
||||
import android.os.Build;
|
||||
|
||||
import com.limelight.AppView;
|
||||
import com.limelight.ShortcutTrampoline;
|
||||
import com.limelight.R;
|
||||
import com.limelight.nvstream.http.ComputerDetails;
|
||||
import com.limelight.nvstream.http.NvApp;
|
||||
|
||||
@@ -53,7 +53,11 @@ public class TvChannelHelper {
|
||||
intent.putExtra(TvContract.EXTRA_CHANNEL_ID, getChannelId(computer.uuid));
|
||||
try {
|
||||
context.startActivityForResult(intent, 0);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
} catch (Exception ignored) {
|
||||
// ActivityNotFoundException is the only officially documented
|
||||
// exception that can result from this call. However some buggy
|
||||
// devices throw others.
|
||||
// See https://github.com/moonlight-stream/moonlight-android/issues/1302
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,14 +31,20 @@ public class UiHelper {
|
||||
|
||||
private static void setGameModeStatus(Context context, boolean streaming, boolean interruptible) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
|
||||
try {
|
||||
GameManager gameManager = context.getSystemService(GameManager.class);
|
||||
if (gameManager == null) {
|
||||
return; // Not supported on this device (e.g., Meta Quest)
|
||||
}
|
||||
|
||||
if (streaming) {
|
||||
gameManager.setGameState(new GameState(false, interruptible ? GameState.MODE_GAMEPLAY_INTERRUPTIBLE : GameState.MODE_GAMEPLAY_UNINTERRUPTIBLE));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
gameManager.setGameState(new GameState(false, GameState.MODE_NONE));
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
// Swallow any failure. Some OEM builds ship partial/incompatible GameManager impls.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
# Application.mk for Moonlight
|
||||
|
||||
# Our minimum version is Android 4.1
|
||||
APP_PLATFORM := android-16
|
||||
# Our minimum version is Android 5.0
|
||||
APP_PLATFORM := android-21
|
||||
|
||||
# We support 16KB pages
|
||||
APP_SUPPORT_FLEXIBLE_PAGE_SIZES := true
|
||||
@@ -28,7 +28,9 @@ LOCAL_SRC_FILES := moonlight-common-c/src/AudioStream.c \
|
||||
moonlight-common-c/src/SimpleStun.c \
|
||||
moonlight-common-c/src/VideoDepacketizer.c \
|
||||
moonlight-common-c/src/VideoStream.c \
|
||||
moonlight-common-c/reedsolomon/rs.c \
|
||||
moonlight-common-c/nanors/deps/obl/oblas_common.c \
|
||||
moonlight-common-c/nanors/deps/obl/oblas_lite.c \
|
||||
moonlight-common-c/nanors/rs.c \
|
||||
moonlight-common-c/enet/callbacks.c \
|
||||
moonlight-common-c/enet/compress.c \
|
||||
moonlight-common-c/enet/host.c \
|
||||
@@ -44,7 +46,8 @@ LOCAL_SRC_FILES := moonlight-common-c/src/AudioStream.c \
|
||||
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/moonlight-common-c/enet/include \
|
||||
$(LOCAL_PATH)/moonlight-common-c/reedsolomon \
|
||||
$(LOCAL_PATH)/moonlight-common-c/nanors/deps/obl \
|
||||
$(LOCAL_PATH)/moonlight-common-c/nanors \
|
||||
$(LOCAL_PATH)/moonlight-common-c/src \
|
||||
|
||||
LOCAL_CFLAGS := -DHAS_SOCKLEN_T=1 -DLC_ANDROID -DHAVE_CLOCK_GETTIME=1
|
||||
@@ -55,7 +58,11 @@ endif
|
||||
|
||||
LOCAL_LDLIBS := -llog
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libopus libssl libcrypto
|
||||
LOCAL_STATIC_LIBRARIES := libopus libcrypto cpufeatures
|
||||
LOCAL_LDFLAGS += -Wl,--exclude-libs,ALL
|
||||
|
||||
LOCAL_BRANCH_PROTECTION := standard
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
$(call import-module,android/cpufeatures)
|
||||
@@ -0,0 +1 @@
|
||||
Static libraries were built from https://github.com/cgutman/moonlight-mobile-deps using AppVeyor CI
|
||||
@@ -8,6 +8,8 @@
|
||||
#include <opus_multistream.h>
|
||||
#include <android/log.h>
|
||||
|
||||
#include <cpu-features.h>
|
||||
|
||||
static OpusMSDecoder* Decoder;
|
||||
static OPUS_MULTISTREAM_CONFIGURATION OpusConfig;
|
||||
|
||||
@@ -166,7 +168,7 @@ int BridgeDrSubmitDecodeUnit(PDECODE_UNIT decodeUnit) {
|
||||
ret = (*env)->CallStaticIntMethod(env, GlobalBridgeClass, BridgeDrSubmitDecodeUnitMethod,
|
||||
DecodedFrameBuffer, currentEntry->length, currentEntry->bufferType,
|
||||
decodeUnit->frameNumber, decodeUnit->frameType, (jchar)decodeUnit->frameHostProcessingLatency,
|
||||
(jlong)decodeUnit->receiveTimeMs, (jlong)decodeUnit->enqueueTimeMs);
|
||||
(jlong)decodeUnit->receiveTimeUs, (jlong)decodeUnit->enqueueTimeUs);
|
||||
if ((*env)->ExceptionCheck(env)) {
|
||||
// We will crash here
|
||||
(*JVM)->DetachCurrentThread(JVM);
|
||||
@@ -187,7 +189,7 @@ int BridgeDrSubmitDecodeUnit(PDECODE_UNIT decodeUnit) {
|
||||
ret = (*env)->CallStaticIntMethod(env, GlobalBridgeClass, BridgeDrSubmitDecodeUnitMethod,
|
||||
DecodedFrameBuffer, offset, BUFFER_TYPE_PICDATA,
|
||||
decodeUnit->frameNumber, decodeUnit->frameType, (jchar)decodeUnit->frameHostProcessingLatency,
|
||||
(jlong)decodeUnit->receiveTimeMs, (jlong)decodeUnit->enqueueTimeMs);
|
||||
(jlong)decodeUnit->receiveTimeUs, (jlong)decodeUnit->enqueueTimeUs);
|
||||
if ((*env)->ExceptionCheck(env)) {
|
||||
// We will crash here
|
||||
(*JVM)->DetachCurrentThread(JVM);
|
||||
@@ -426,6 +428,29 @@ static CONNECTION_LISTENER_CALLBACKS BridgeConnListenerCallbacks = {
|
||||
.setControllerLED = BridgeClSetControllerLED,
|
||||
};
|
||||
|
||||
static bool
|
||||
hasFastAes() {
|
||||
if (android_getCpuCount() <= 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (android_getCpuFamily()) {
|
||||
case ANDROID_CPU_FAMILY_ARM:
|
||||
return !!(android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_AES);
|
||||
case ANDROID_CPU_FAMILY_ARM64:
|
||||
return !!(android_getCpuFeatures() & ANDROID_CPU_ARM64_FEATURE_AES);
|
||||
case ANDROID_CPU_FAMILY_X86:
|
||||
case ANDROID_CPU_FAMILY_X86_64:
|
||||
return !!(android_getCpuFeatures() & ANDROID_CPU_X86_FEATURE_AES_NI);
|
||||
case ANDROID_CPU_FAMILY_MIPS:
|
||||
case ANDROID_CPU_FAMILY_MIPS64:
|
||||
return false;
|
||||
default:
|
||||
// Assume new architectures will all have crypto acceleration (RISC-V will)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_limelight_nvstream_jni_MoonBridge_startConnection(JNIEnv *env, jclass clazz,
|
||||
jstring address, jstring appVersion, jstring gfeVersion,
|
||||
@@ -433,10 +458,7 @@ Java_com_limelight_nvstream_jni_MoonBridge_startConnection(JNIEnv *env, jclass c
|
||||
jint width, jint height, jint fps,
|
||||
jint bitrate, jint packetSize, jint streamingRemotely,
|
||||
jint audioConfiguration, jint supportedVideoFormats,
|
||||
jint hevcBitratePercentageMultiplier,
|
||||
jint av1BitratePercentageMultiplier,
|
||||
jint clientRefreshRateX100,
|
||||
jint encryptionFlags,
|
||||
jbyteArray riAesKey, jbyteArray riAesIv,
|
||||
jint videoCapabilities,
|
||||
jint colorSpace, jint colorRange) {
|
||||
@@ -456,10 +478,8 @@ Java_com_limelight_nvstream_jni_MoonBridge_startConnection(JNIEnv *env, jclass c
|
||||
.streamingRemotely = streamingRemotely,
|
||||
.audioConfiguration = audioConfiguration,
|
||||
.supportedVideoFormats = supportedVideoFormats,
|
||||
.hevcBitratePercentageMultiplier = hevcBitratePercentageMultiplier,
|
||||
.av1BitratePercentageMultiplier = av1BitratePercentageMultiplier,
|
||||
.clientRefreshRateX100 = clientRefreshRateX100,
|
||||
.encryptionFlags = encryptionFlags,
|
||||
.encryptionFlags = ENCFLG_AUDIO,
|
||||
.colorSpace = colorSpace,
|
||||
.colorRange = colorRange
|
||||
};
|
||||
@@ -474,6 +494,11 @@ Java_com_limelight_nvstream_jni_MoonBridge_startConnection(JNIEnv *env, jclass c
|
||||
|
||||
BridgeVideoRendererCallbacks.capabilities = videoCapabilities;
|
||||
|
||||
// Enable all encryption features if the platform has fast AES support
|
||||
if (hasFastAes()) {
|
||||
streamConfig.encryptionFlags = ENCFLG_ALL;
|
||||
}
|
||||
|
||||
int ret = LiStartConnection(&serverInfo,
|
||||
&streamConfig,
|
||||
&BridgeConnListenerCallbacks,
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
|
||||
static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x0079, 0x181a ), k_eControllerType_PS3Controller, NULL }, // Venom Arcade Stick
|
||||
{ MAKE_CONTROLLER_ID( 0x0079, 0x1844 ), k_eControllerType_PS3Controller, NULL }, // From SDL
|
||||
{ MAKE_CONTROLLER_ID( 0x044f, 0xb315 ), k_eControllerType_PS3Controller, NULL }, // Firestorm Dual Analog 3
|
||||
{ MAKE_CONTROLLER_ID( 0x044f, 0xd007 ), k_eControllerType_PS3Controller, NULL }, // Thrustmaster wireless 3-1
|
||||
{ MAKE_CONTROLLER_ID( 0x046d, 0xcad1 ), k_eControllerType_PS3Controller, NULL }, // Logitech Chillstream
|
||||
//{ MAKE_CONTROLLER_ID( 0x046d, 0xc24f ), k_eControllerType_PS3Controller, NULL }, // Logitech G29 (PS3)
|
||||
{ MAKE_CONTROLLER_ID( 0x054c, 0x0268 ), k_eControllerType_PS3Controller, NULL }, // Sony PS3 Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x056e, 0x200f ), k_eControllerType_PS3Controller, NULL }, // From SDL
|
||||
@@ -60,15 +60,39 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x0f0d, 0x0088 ), k_eControllerType_PS3Controller, NULL }, // HORI Fighting Stick mini 4
|
||||
{ MAKE_CONTROLLER_ID( 0x0f30, 0x1100 ), k_eControllerType_PS3Controller, NULL }, // Qanba Q1 fight stick
|
||||
{ MAKE_CONTROLLER_ID( 0x11ff, 0x3331 ), k_eControllerType_PS3Controller, NULL }, // SRXJ-PH2400
|
||||
{ MAKE_CONTROLLER_ID( 0x12ba, 0x0100 ), k_eControllerType_PS3Controller, NULL }, // PS3 Guitar Hero Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x12ba, 0x0120 ), k_eControllerType_PS3Controller, NULL }, // PS3 Guitar Hero Drums
|
||||
{ MAKE_CONTROLLER_ID( 0x12ba, 0x0140 ), k_eControllerType_PS3Controller, NULL }, // PS3 DJ Hero Turntable
|
||||
{ MAKE_CONTROLLER_ID( 0x12ba, 0x0200 ), k_eControllerType_PS3Controller, NULL }, // PS3 Rock Band Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x12ba, 0x0210 ), k_eControllerType_PS3Controller, NULL }, // PS3 Rock Band Drums
|
||||
{ MAKE_CONTROLLER_ID( 0x12ba, 0x0218 ), k_eControllerType_PS3Controller, NULL }, // PS3 Midi Pro Adapter - Drums Mode
|
||||
{ MAKE_CONTROLLER_ID( 0x12ba, 0x074b ), k_eControllerType_PS3Controller, NULL }, // PS3 / Wii U Guitar Hero Live Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x12ba, 0x2330 ), k_eControllerType_PS3Controller, NULL }, // PS3 Rock Band Keyboard
|
||||
{ MAKE_CONTROLLER_ID( 0x12ba, 0x2338 ), k_eControllerType_PS3Controller, NULL }, // PS3 Midi Pro Adapter - Keyboard Mode
|
||||
{ MAKE_CONTROLLER_ID( 0x12ba, 0x2430 ), k_eControllerType_PS3Controller, NULL }, // PS3 Mustang Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x12ba, 0x2438 ), k_eControllerType_PS3Controller, NULL }, // PS3 Midi Pro Adapter - Mustang Guitar Mode
|
||||
{ MAKE_CONTROLLER_ID( 0x12ba, 0x2530 ), k_eControllerType_PS3Controller, NULL }, // PS3 Squire Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x12ba, 0x2538 ), k_eControllerType_PS3Controller, NULL }, // PS3 Midi Pro Adapter - Squire Guitar Mode
|
||||
{ MAKE_CONTROLLER_ID( 0x1345, 0x1000 ), k_eControllerType_PS3Controller, NULL }, // PS2 ACME GA-D5
|
||||
{ MAKE_CONTROLLER_ID( 0x1345, 0x6005 ), k_eControllerType_PS3Controller, NULL }, // ps2 maybe break out later
|
||||
{ MAKE_CONTROLLER_ID( 0x146b, 0x5500 ), k_eControllerType_PS3Controller, NULL }, // From SDL
|
||||
{ MAKE_CONTROLLER_ID( 0x1a34, 0x0836 ), k_eControllerType_PS3Controller, NULL }, // Afterglow PS3
|
||||
{ MAKE_CONTROLLER_ID( 0x1BAD, 0x0004 ), k_eControllerType_PS3Controller, NULL }, // Wii RB1 Guitar (Uses PS3 protocol)
|
||||
{ MAKE_CONTROLLER_ID( 0x1BAD, 0x0005 ), k_eControllerType_PS3Controller, NULL }, // Wii RB1 Drums (Uses PS3 protocol)
|
||||
{ MAKE_CONTROLLER_ID( 0x1BAD, 0x3010 ), k_eControllerType_PS3Controller, NULL }, // Wii RB2 Guitar (Uses PS3 protocol)
|
||||
{ MAKE_CONTROLLER_ID( 0x1BAD, 0x3110 ), k_eControllerType_PS3Controller, NULL }, // Wii RB2 Drums (Uses PS3 protocol)
|
||||
{ MAKE_CONTROLLER_ID( 0x1BAD, 0x3138 ), k_eControllerType_PS3Controller, NULL }, // Wii RB3 Midi Pro Adapter - Drums Mode (Uses PS3 protocol)
|
||||
{ MAKE_CONTROLLER_ID( 0x1BAD, 0x3330 ), k_eControllerType_PS3Controller, NULL }, // Wii RB3 Keyboard (Uses PS3 protocol)
|
||||
{ MAKE_CONTROLLER_ID( 0x1BAD, 0x3338 ), k_eControllerType_PS3Controller, NULL }, // Wii RB3 Midi Pro Adapter - Keyboard Mode (Uses PS3 protocol)
|
||||
{ MAKE_CONTROLLER_ID( 0x1BAD, 0x3430 ), k_eControllerType_PS3Controller, NULL }, // Wii RB3 Mustang Guitar (Uses PS3 protocol)
|
||||
{ MAKE_CONTROLLER_ID( 0x1BAD, 0x3438 ), k_eControllerType_PS3Controller, NULL }, // Wii RB3 Midi Pro Adapter - Mustang Guitar Mode (Uses PS3 protocol)
|
||||
{ MAKE_CONTROLLER_ID( 0x1BAD, 0x3530 ), k_eControllerType_PS3Controller, NULL }, // Wii RB3 Squire Guitar (Uses PS3 protocol)
|
||||
{ MAKE_CONTROLLER_ID( 0x1BAD, 0x3538 ), k_eControllerType_PS3Controller, NULL }, // Wii RB3 Midi Pro Adapter - Squire Guitar Mode (Uses PS3 protocol)
|
||||
{ MAKE_CONTROLLER_ID( 0x20bc, 0x5500 ), k_eControllerType_PS3Controller, NULL }, // ShanWan PS3
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0x576d ), k_eControllerType_PS3Controller, NULL }, // Power A PS3
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0xca6d ), k_eControllerType_PS3Controller, NULL }, // From SDL
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0xca6d ), k_eControllerType_PS3Controller, NULL }, // BDA Pro Ex
|
||||
{ MAKE_CONTROLLER_ID( 0x2563, 0x0523 ), k_eControllerType_PS3Controller, NULL }, // Digiflip GP006
|
||||
{ MAKE_CONTROLLER_ID( 0x2563, 0x0575 ), k_eControllerType_PS3Controller, NULL }, // From SDL
|
||||
{ MAKE_CONTROLLER_ID( 0x2563, 0x0575 ), k_eControllerType_PS3Controller, "Retro Controller" }, // SWITCH CO., LTD. Retro-bit, Retro Fighters Controllers
|
||||
{ MAKE_CONTROLLER_ID( 0x25f0, 0x83c3 ), k_eControllerType_PS3Controller, NULL }, // gioteck vx2
|
||||
{ MAKE_CONTROLLER_ID( 0x25f0, 0xc121 ), k_eControllerType_PS3Controller, NULL }, //
|
||||
{ MAKE_CONTROLLER_ID( 0x2c22, 0x2003 ), k_eControllerType_PS3Controller, NULL }, // Qanba Drone
|
||||
@@ -95,8 +119,10 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x0c12, 0x0ef6 ), k_eControllerType_PS4Controller, NULL }, // Hitbox Arcade Stick
|
||||
{ MAKE_CONTROLLER_ID( 0x0c12, 0x1cf6 ), k_eControllerType_PS4Controller, NULL }, // EMIO PS4 Elite Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0c12, 0x1e10 ), k_eControllerType_PS4Controller, NULL }, // P4 Wired Gamepad generic knock off - lightbar but not trackpad or gyro
|
||||
{ MAKE_CONTROLLER_ID( 0x0c12, 0x2e18 ), k_eControllerType_PS4Controller, NULL }, // ZEROPLUS P4 Wired Gamepad
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0203 ), k_eControllerType_PS4Controller, NULL }, // Victrix Pro FS (PS4 peripheral but no trackpad/lightbar)
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0207 ), k_eControllerType_PS4Controller, NULL }, // Victrix Pro FS V2 w/ Touchpad for PS4
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x020a ), k_eControllerType_PS4Controller, NULL }, // Victrix Pro FS PS4/PS5 (PS4 mode)
|
||||
{ MAKE_CONTROLLER_ID( 0x0f0d, 0x0055 ), k_eControllerType_PS4Controller, NULL }, // HORIPAD 4 FPS
|
||||
{ MAKE_CONTROLLER_ID( 0x0f0d, 0x005e ), k_eControllerType_PS4Controller, NULL }, // HORI Fighting Commander 4 PS4
|
||||
{ MAKE_CONTROLLER_ID( 0x0f0d, 0x0066 ), k_eControllerType_PS4Controller, NULL }, // HORIPAD 4 FPS Plus
|
||||
@@ -119,13 +145,13 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x146b, 0x0609 ), k_eControllerType_XInputPS4Controller, NULL }, // NACON Wireless Controller for PS4
|
||||
{ MAKE_CONTROLLER_ID( 0x146b, 0x0d01 ), k_eControllerType_PS4Controller, NULL }, // Nacon Revolution Pro Controller - has gyro
|
||||
{ MAKE_CONTROLLER_ID( 0x146b, 0x0d02 ), k_eControllerType_PS4Controller, NULL }, // Nacon Revolution Pro Controller v2 - has gyro
|
||||
{ MAKE_CONTROLLER_ID( 0x146b, 0x0d06 ), k_eControllerType_PS4Controller, NULL }, // NACON Asymetrical Controller Wireless Dongle -- show up as ps4 until you connect controller to it then it reboots into Xbox controller with different vvid/pid
|
||||
{ MAKE_CONTROLLER_ID( 0x146b, 0x0d06 ), k_eControllerType_PS4Controller, NULL }, // NACON Asymmetric Controller Wireless Dongle -- show up as ps4 until you connect controller to it then it reboots into Xbox controller with different vvid/pid
|
||||
{ MAKE_CONTROLLER_ID( 0x146b, 0x0d08 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution Unlimited Wireless Dongle
|
||||
{ MAKE_CONTROLLER_ID( 0x146b, 0x0d09 ), k_eControllerType_PS4Controller, NULL }, // NACON Daija Fight Stick - touchpad but no gyro/rumble
|
||||
{ MAKE_CONTROLLER_ID( 0x146b, 0x0d10 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution Infinite - has gyro
|
||||
{ MAKE_CONTROLLER_ID( 0x146b, 0x0d10 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution Unlimited
|
||||
{ MAKE_CONTROLLER_ID( 0x146b, 0x0d13 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution Pro Controller 3
|
||||
{ MAKE_CONTROLLER_ID( 0x146b, 0x1103 ), k_eControllerType_PS4Controller, NULL }, // NACON Asymetrical Controller -- on windows this doesn't enumerate
|
||||
{ MAKE_CONTROLLER_ID( 0x146b, 0x1103 ), k_eControllerType_PS4Controller, NULL }, // NACON Asymmetric Controller -- on windows this doesn't enumerate
|
||||
{ MAKE_CONTROLLER_ID( 0x1532, 0X0401 ), k_eControllerType_PS4Controller, NULL }, // Razer Panthera PS4 Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x1532, 0x1000 ), k_eControllerType_PS4Controller, NULL }, // Razer Raiju PS4 Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x1532, 0x1004 ), k_eControllerType_PS4Controller, NULL }, // Razer Raiju 2 Ultimate USB
|
||||
@@ -140,6 +166,8 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x2c22, 0x2303 ), k_eControllerType_XInputPS4Controller, NULL }, // Qanba Obsidian Arcade Joystick
|
||||
{ MAKE_CONTROLLER_ID( 0x2c22, 0x2500 ), k_eControllerType_PS4Controller, NULL }, // Qanba Dragon
|
||||
{ MAKE_CONTROLLER_ID( 0x2c22, 0x2503 ), k_eControllerType_XInputPS4Controller, NULL }, // Qanba Dragon Arcade Joystick
|
||||
{ MAKE_CONTROLLER_ID( 0x3285, 0x0d16 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution 5 Pro (PS4 mode with dongle)
|
||||
{ MAKE_CONTROLLER_ID( 0x3285, 0x0d17 ), k_eControllerType_PS4Controller, NULL }, // NACON Revolution 5 Pro (PS4 mode wired)
|
||||
{ MAKE_CONTROLLER_ID( 0x7545, 0x0104 ), k_eControllerType_PS4Controller, NULL }, // Armor 3 or Level Up Cobra - At least one variant has gyro
|
||||
{ MAKE_CONTROLLER_ID (0x9886, 0x0024 ), k_eControllerType_XInputPS4Controller, NULL }, // Astro C40 in Xbox 360 mode
|
||||
{ MAKE_CONTROLLER_ID( 0x9886, 0x0025 ), k_eControllerType_PS4Controller, NULL }, // Astro C40
|
||||
@@ -147,25 +175,35 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
// { MAKE_CONTROLLER_ID( 0x7545, 0x1122 ), k_eControllerType_PS4Controller, NULL }, // Giotek VX4 - trackpad/gyro don't work. Had to not filter on interface info. Light bar is flaky, but works.
|
||||
|
||||
{ MAKE_CONTROLLER_ID( 0x054c, 0x0ce6 ), k_eControllerType_PS5Controller, NULL }, // Sony DualSense Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x054c, 0x0df2 ), k_eControllerType_PS5Controller, NULL }, // Sony DualSense Edge Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x054c, 0x0e5f ), k_eControllerType_PS5Controller, NULL }, // Access Controller for PS5
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0209 ), k_eControllerType_PS5Controller, NULL }, // Victrix Pro FS PS4/PS5 (PS5 mode)
|
||||
{ MAKE_CONTROLLER_ID( 0x0f0d, 0x0163 ), k_eControllerType_PS5Controller, NULL }, // HORI Fighting Commander OCTA
|
||||
{ MAKE_CONTROLLER_ID( 0x0f0d, 0x0184 ), k_eControllerType_PS5Controller, NULL }, // Hori Fighting Stick α
|
||||
{ MAKE_CONTROLLER_ID( 0x1532, 0x100b ), k_eControllerType_PS5Controller, NULL }, // Razer Wolverine V2 Pro (Wired)
|
||||
{ MAKE_CONTROLLER_ID( 0x1532, 0x100c ), k_eControllerType_PS5Controller, NULL }, // Razer Wolverine V2 Pro (Wireless)
|
||||
{ MAKE_CONTROLLER_ID( 0x1532, 0x1012 ), k_eControllerType_PS5Controller, NULL }, // Razer Kitsune
|
||||
{ MAKE_CONTROLLER_ID( 0x1532, 0x1024 ), k_eControllerType_PS5Controller, NULL }, // Razer Raiju V3 Pro (PS5 mode wired)
|
||||
{ MAKE_CONTROLLER_ID( 0x1532, 0x1026 ), k_eControllerType_PS5Controller, NULL }, // Razer Raiju V3 Pro (PS5 mode with dongle)
|
||||
{ MAKE_CONTROLLER_ID( 0x3285, 0x0d18 ), k_eControllerType_PS5Controller, NULL }, // NACON Revolution 5 Pro (PS5 mode with dongle)
|
||||
{ MAKE_CONTROLLER_ID( 0x3285, 0x0d19 ), k_eControllerType_PS5Controller, NULL }, // NACON Revolution 5 Pro (PS5 mode wired)
|
||||
{ MAKE_CONTROLLER_ID( 0x358a, 0x0104 ), k_eControllerType_PS5Controller, NULL }, // Backbone One PlayStation Edition for iOS
|
||||
{ MAKE_CONTROLLER_ID( 0x358a, 0x0304 ), k_eControllerType_PS5Controller, NULL }, // Backbone One PlayStation Edition Gen 2
|
||||
|
||||
{ MAKE_CONTROLLER_ID( 0x0079, 0x0006 ), k_eControllerType_UnknownNonSteamController, NULL }, // DragonRise Generic USB PCB, sometimes configured as a PC Twin Shock Controller - looks like a DS3 but the face buttons are 1-4 instead of symbols
|
||||
|
||||
{ MAKE_CONTROLLER_ID( 0x0079, 0x18d4 ), k_eControllerType_XBox360Controller, NULL }, // GPD Win 2 X-Box Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0351, 0x1000 ), k_eControllerType_XBox360Controller, NULL }, // CRKD Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x0351, 0x2000 ), k_eControllerType_XBox360Controller, NULL }, // CRKD Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x03eb, 0xff02 ), k_eControllerType_XBox360Controller, NULL }, // Wooting Two
|
||||
{ MAKE_CONTROLLER_ID( 0x044f, 0xb326 ), k_eControllerType_XBox360Controller, NULL }, // Thrustmaster Gamepad GP XID
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x028e ), k_eControllerType_XBox360Controller, "Xbox 360 Controller" }, // Microsoft X-Box 360 pad
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x028f ), k_eControllerType_XBox360Controller, "Xbox 360 Controller" }, // Microsoft X-Box 360 pad v2
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0291 ), k_eControllerType_XBox360Controller, "Xbox 360 Wireless Controller" }, // Xbox 360 Wireless Receiver (XBOX)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02a0 ), k_eControllerType_XBox360Controller, NULL }, // Microsoft X-Box 360 Big Button IR
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02a1 ), k_eControllerType_XBox360Controller, NULL }, // Microsoft X-Box 360 Wireless Controller with XUSB driver on Windows
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02a9 ), k_eControllerType_XBox360Controller, "Xbox 360 Wireless Controller" }, // Xbox 360 Wireless Receiver (third party knockoff)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0719 ), k_eControllerType_XBox360Controller, "Xbox 360 Wireless Controller" }, // Xbox 360 Wireless Receiver
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x028e ), k_eControllerType_XBox360Controller, "Xbox 360 Controller" }, // Microsoft Xbox 360 Wired Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x028f ), k_eControllerType_XBox360Controller, "Xbox 360 Controller" }, // Microsoft Xbox 360 Play and Charge Cable
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0291 ), k_eControllerType_XBox360Controller, "Xbox 360 Wireless Controller" }, // X-box 360 Wireless Receiver (third party knockoff)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02a0 ), k_eControllerType_XBox360Controller, NULL }, // Microsoft Xbox 360 Big Button IR
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02a1 ), k_eControllerType_XBox360Controller, "Xbox 360 Wireless Controller" }, // Microsoft Xbox 360 Wireless Controller with XUSB driver on Windows
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02a2 ), k_eControllerType_XBox360Controller, "Xbox 360 Wireless Racing Wheel" }, // Xbox 360 Wireless Racing Wheel with XUSB driver on Windows
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02a9 ), k_eControllerType_XBox360Controller, "Xbox 360 Wireless Controller" }, // X-box 360 Wireless Receiver (third party knockoff)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0719 ), k_eControllerType_XBox360Controller, "Xbox 360 Wireless Controller" }, // Microsoft Xbox 360 Wireless Receiver
|
||||
{ MAKE_CONTROLLER_ID( 0x046d, 0xc21d ), k_eControllerType_XBox360Controller, NULL }, // Logitech Gamepad F310
|
||||
{ MAKE_CONTROLLER_ID( 0x046d, 0xc21e ), k_eControllerType_XBox360Controller, NULL }, // Logitech Gamepad F510
|
||||
{ MAKE_CONTROLLER_ID( 0x046d, 0xc21f ), k_eControllerType_XBox360Controller, NULL }, // Logitech Gamepad F710
|
||||
@@ -173,6 +211,8 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x056e, 0x2004 ), k_eControllerType_XBox360Controller, NULL }, // Elecom JC-U3613M
|
||||
// This isn't actually an Xbox 360 controller, it just looks like one
|
||||
// { MAKE_CONTROLLER_ID( 0x06a3, 0xf51a ), k_eControllerType_XBox360Controller, NULL }, // Saitek P3600
|
||||
{ MAKE_CONTROLLER_ID( 0x0738, 0x02A6 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Wireless Rock Band Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x0738, 0x02AB ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Wireless Precision Bass Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x0738, 0x4716 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Wired Xbox 360 Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0738, 0x4718 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Street Fighter IV FightStick SE
|
||||
{ MAKE_CONTROLLER_ID( 0x0738, 0x4726 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Xbox 360 Controller
|
||||
@@ -180,6 +220,7 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x0738, 0x4736 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz MicroCon Gamepad
|
||||
{ MAKE_CONTROLLER_ID( 0x0738, 0x4738 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Wired Xbox 360 Controller (SFIV)
|
||||
{ MAKE_CONTROLLER_ID( 0x0738, 0x4740 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Beat Pad
|
||||
{ MAKE_CONTROLLER_ID( 0x0738, 0x9806 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Precision Bass Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x0738, 0xb726 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Xbox controller - MW2
|
||||
{ MAKE_CONTROLLER_ID( 0x0738, 0xbeef ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz JOYTECH NEO SE Advanced GamePad
|
||||
{ MAKE_CONTROLLER_ID( 0x0738, 0xcb02 ), k_eControllerType_XBox360Controller, NULL }, // Saitek Cyborg Rumble Pad - PC/Xbox 360
|
||||
@@ -187,6 +228,7 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x0738, 0xf738 ), k_eControllerType_XBox360Controller, NULL }, // Super SFIV FightStick TE S
|
||||
{ MAKE_CONTROLLER_ID( 0x0955, 0x7210 ), k_eControllerType_XBox360Controller, NULL }, // Nvidia Shield local controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0955, 0xb400 ), k_eControllerType_XBox360Controller, NULL }, // NVIDIA Shield streaming controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0b05, 0x1b4c ), k_eControllerType_XBox360Controller, NULL }, // ASUS ROG Ally X built-in controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0105 ), k_eControllerType_XBox360Controller, NULL }, // HSM3 Xbox360 dancepad
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0113 ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Afterglow" }, // PDP Afterglow Gamepad for Xbox 360
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x011f ), k_eControllerType_XBox360Controller, "PDP Xbox 360 Rock Candy" }, // PDP Rock Candy Gamepad for Xbox 360
|
||||
@@ -222,6 +264,14 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x12ab, 0x0301 ), k_eControllerType_XBox360Controller, NULL }, // PDP AFTERGLOW AX.1
|
||||
{ MAKE_CONTROLLER_ID( 0x12ab, 0x0303 ), k_eControllerType_XBox360Controller, NULL }, // Mortal Kombat Klassic FightStick
|
||||
{ MAKE_CONTROLLER_ID( 0x1430, 0x02a0 ), k_eControllerType_XBox360Controller, NULL }, // RedOctane Controller Adapter
|
||||
{ MAKE_CONTROLLER_ID( 0x1430, 0x02a7 ), k_eControllerType_XBox360Controller, NULL }, // Guitar Hero Wireless Guitar (Linux)
|
||||
{ MAKE_CONTROLLER_ID( 0x1430, 0x02a8 ), k_eControllerType_XBox360Controller, NULL }, // Guitar Hero Wireless Drum Kit (Linux)
|
||||
{ MAKE_CONTROLLER_ID( 0x1430, 0x0705 ), k_eControllerType_XBox360Controller, NULL }, // Guitar Hero 5 Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x1430, 0x070B ), k_eControllerType_XBox360Controller, NULL }, // Guitar Hero Live Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x1430, 0x0805 ), k_eControllerType_XBox360Controller, NULL }, // Band Hero Wireless Drum Kit
|
||||
{ MAKE_CONTROLLER_ID( 0x1430, 0x1715 ), k_eControllerType_XBox360Controller, NULL }, // DJ Hero Turntable (Wired)
|
||||
{ MAKE_CONTROLLER_ID( 0x1430, 0x1705 ), k_eControllerType_XBox360Controller, NULL }, // DJ Hero Turntable (Wireless)
|
||||
{ MAKE_CONTROLLER_ID( 0x1430, 0x4734 ), k_eControllerType_XBox360Controller, NULL }, // Guitar Hero World Tour Kiosk
|
||||
{ MAKE_CONTROLLER_ID( 0x1430, 0x4748 ), k_eControllerType_XBox360Controller, NULL }, // RedOctane Guitar Hero X-plorer
|
||||
{ MAKE_CONTROLLER_ID( 0x1430, 0xf801 ), k_eControllerType_XBox360Controller, NULL }, // RedOctane Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x146b, 0x0601 ), k_eControllerType_XBox360Controller, NULL }, // BigBen Interactive XBOX 360 Controller
|
||||
@@ -234,8 +284,17 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x1689, 0xfd01 ), k_eControllerType_XBox360Controller, NULL }, // Razer Onza Classic Edition
|
||||
{ MAKE_CONTROLLER_ID( 0x1689, 0xfe00 ), k_eControllerType_XBox360Controller, NULL }, // Razer Sabertooth
|
||||
{ MAKE_CONTROLLER_ID( 0x1949, 0x041a ), k_eControllerType_XBox360Controller, "Amazon Luna Controller" }, // Amazon Luna Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0x0002 ), k_eControllerType_XBox360Controller, NULL }, // Harmonix Rock Band Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0x0002 ), k_eControllerType_XBox360Controller, NULL }, // Harmonix Rock Band 1 Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0x0003 ), k_eControllerType_XBox360Controller, NULL }, // Harmonix Rock Band Drumkit
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0x0130 ), k_eControllerType_XBox360Controller, NULL }, // ION Drum Rocker
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0x02a6 ), k_eControllerType_XBox360Controller, NULL }, // Rock Band 2 Wireless Guitar (Linux)
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0x02ab ), k_eControllerType_XBox360Controller, NULL }, // Rock Band Wireless Bass Guitar (Linux)
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0x1330 ), k_eControllerType_XBox360Controller, NULL }, // Rock Band Keyboard (Mustang)
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0x1338 ), k_eControllerType_XBox360Controller, NULL }, // Rock Band MIDI Pro Adapter (Keyboard)
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0x1430 ), k_eControllerType_XBox360Controller, NULL }, // Rock Band Pro Guitar (Mustang)
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0x1530 ), k_eControllerType_XBox360Controller, NULL }, // Rock Band Pro Guitar (Squire)
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0x1438 ), k_eControllerType_XBox360Controller, NULL }, // Rock Band MIDI Pro Adapter (Mustang Guitar)
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0x1538 ), k_eControllerType_XBox360Controller, NULL }, // Rock Band MIDI Pro Adapter (Squire Guitar)
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0xf016 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Xbox 360 Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0xf018 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Street Fighter IV SE Fighting Stick
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0xf019 ), k_eControllerType_XBox360Controller, NULL }, // Mad Catz Brawlstick for Xbox 360
|
||||
@@ -269,6 +328,8 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0xfa01 ), k_eControllerType_XBox360Controller, NULL }, // MadCatz GamePad
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0xfd00 ), k_eControllerType_XBox360Controller, NULL }, // Razer Onza TE
|
||||
{ MAKE_CONTROLLER_ID( 0x1bad, 0xfd01 ), k_eControllerType_XBox360Controller, NULL }, // Razer Onza
|
||||
{ MAKE_CONTROLLER_ID( 0x2068, 0x0001 ), k_eControllerType_XBox360Controller, NULL }, // Power Gig Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x2068, 0x0002 ), k_eControllerType_XBox360Controller, NULL }, // Power Gig Drums
|
||||
{ MAKE_CONTROLLER_ID( 0x24c6, 0x5000 ), k_eControllerType_XBox360Controller, NULL }, // Razer Atrox Arcade Stick
|
||||
{ MAKE_CONTROLLER_ID( 0x24c6, 0x5300 ), k_eControllerType_XBox360Controller, NULL }, // PowerA MINI PROEX Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x24c6, 0x5303 ), k_eControllerType_XBox360Controller, NULL }, // Xbox Airflo wired controller
|
||||
@@ -292,26 +353,25 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x24c6, 0xfafb ), k_eControllerType_XBox360Controller, NULL }, // Aplay Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x24c6, 0xfafc ), k_eControllerType_XBox360Controller, NULL }, // Afterglow Gamepad 1
|
||||
{ MAKE_CONTROLLER_ID( 0x24c6, 0xfafd ), k_eControllerType_XBox360Controller, NULL }, // Afterglow Gamepad 3
|
||||
{ MAKE_CONTROLLER_ID( 0x3537, 0x103e ), k_eControllerType_XBox360Controller, "Gamesir Xbox Controller" }, // Gamesir dongle for Supernova (and maybe others) in Xinput mode
|
||||
{ MAKE_CONTROLLER_ID( 0x24c6, 0xfafe ), k_eControllerType_XBox360Controller, NULL }, // Rock Candy Gamepad for Xbox 360
|
||||
{ MAKE_CONTROLLER_ID( 0x3651, 0x1000 ), k_eControllerType_XBox360Controller, NULL }, // CRKD Guitar
|
||||
{ MAKE_CONTROLLER_ID( 0x3651, 0x6000 ), k_eControllerType_XBox360Controller, NULL }, // CRKD Guitar
|
||||
|
||||
{ MAKE_CONTROLLER_ID( 0x03f0, 0x0495 ), k_eControllerType_XBoxOneController, NULL }, // HP HyperX Clutch Gladiate
|
||||
{ MAKE_CONTROLLER_ID( 0x044f, 0xd012 ), k_eControllerType_XBoxOneController, NULL }, // ThrustMaster eSwap PRO Controller Xbox
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02d1 ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft X-Box One pad
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02dd ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft X-Box One pad (Firmware 2015)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02e0 ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft X-Box One S pad (Bluetooth)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02e3 ), k_eControllerType_XBoxOneController, "Xbox One Elite Controller" }, // Microsoft X-Box One Elite pad
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02ea ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft X-Box One S pad
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02fd ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft X-Box One S pad (Bluetooth)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02ff ), k_eControllerType_XBoxOneController, NULL }, // Microsoft X-Box One controller with XBOXGIP driver on Windows
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b00 ), k_eControllerType_XBoxOneController, "Xbox One Elite 2 Controller" }, // Microsoft X-Box One Elite Series 2 pad
|
||||
// { MAKE_CONTROLLER_ID( 0x045e, 0x0b02 ), k_eControllerType_XBoxOneController, "Xbox One Elite 2 Controller" }, // The virtual keyboard generated by XboxGip drivers for Xbox One Controllers (see https://github.com/libsdl-org/SDL/pull/5121 for details)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b05 ), k_eControllerType_XBoxOneController, "Xbox One Elite 2 Controller" }, // Microsoft X-Box One Elite Series 2 pad (Bluetooth)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b0a ), k_eControllerType_XBoxOneController, "Xbox Adaptive Controller" }, // Microsoft X-Box Adaptive pad
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b0c ), k_eControllerType_XBoxOneController, "Xbox Adaptive Controller" }, // Microsoft X-Box Adaptive pad (Bluetooth)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b12 ), k_eControllerType_XBoxOneController, "Xbox Series X Controller" }, // Microsoft X-Box Series X pad
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b13 ), k_eControllerType_XBoxOneController, "Xbox Series X Controller" }, // Microsoft X-Box Series X pad (BLE)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b20 ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft X-Box One S pad (BLE)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b21 ), k_eControllerType_XBoxOneController, "Xbox Adaptive Controller" }, // Microsoft X-Box Adaptive pad (BLE)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b22 ), k_eControllerType_XBoxOneController, "Xbox One Elite 2 Controller" }, // Microsoft X-Box One Elite Series 2 pad (BLE)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02d1 ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft Xbox One Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02dd ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft Xbox One Controller (Firmware 2015)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02e0 ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft Xbox One S Controller (Bluetooth)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02ea ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft Xbox One S Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02fd ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft Xbox One S Controller (Bluetooth)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02ff ), k_eControllerType_XBoxOneController, "Xbox One Controller" }, // Microsoft Xbox One Controller with XBOXGIP driver on Windows
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b0a ), k_eControllerType_XBoxOneController, "Xbox Adaptive Controller" }, // Microsoft Xbox Adaptive Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b0c ), k_eControllerType_XBoxOneController, "Xbox Adaptive Controller" }, // Microsoft Xbox Adaptive Controller (Bluetooth)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b12 ), k_eControllerType_XBoxOneController, "Xbox Series X Controller" }, // Microsoft Xbox Series X Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b13 ), k_eControllerType_XBoxOneController, "Xbox Series X Controller" }, // Microsoft Xbox Series X Controller (BLE)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b20 ), k_eControllerType_XBoxOneController, "Xbox One S Controller" }, // Microsoft Xbox One S Controller (BLE)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b21 ), k_eControllerType_XBoxOneController, "Xbox Adaptive Controller" }, // Microsoft Xbox Adaptive Controller (BLE)
|
||||
{ MAKE_CONTROLLER_ID( 0x0738, 0x4a01 ), k_eControllerType_XBoxOneController, NULL }, // Mad Catz FightStick TE 2
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0139 ), k_eControllerType_XBoxOneController, "PDP Xbox One Afterglow" }, // PDP Afterglow Wired Controller for Xbox One
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x013B ), k_eControllerType_XBoxOneController, "PDP Xbox One Face-Off Controller" }, // PDP Face-Off Gamepad for Xbox One
|
||||
@@ -408,7 +468,7 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0x2012 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X Cuphead EnWired Controller - Mugman
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0x2015 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller - Blue Hint
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0x2016 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller - Green Hint
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0x2017 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Cntroller - Arctic Camo
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0x2017 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller - Arctic Camo
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0x2018 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Arc Lightning
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0x2019 ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Royal Purple
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0x201a ), k_eControllerType_XBoxOneController, "PowerA Xbox Series X Controller" }, // PowerA Xbox Series X EnWired Controller Nebula
|
||||
@@ -425,14 +485,14 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x24c6, 0x592a ), k_eControllerType_XBoxOneController, NULL }, // BDA XB1 Spectra Pro
|
||||
{ MAKE_CONTROLLER_ID( 0x24c6, 0x791a ), k_eControllerType_XBoxOneController, NULL }, // PowerA Fusion Fight Pad
|
||||
{ MAKE_CONTROLLER_ID( 0x2dc8, 0x2002 ), k_eControllerType_XBoxOneController, NULL }, // 8BitDo Ultimate Wired Controller for Xbox
|
||||
{ MAKE_CONTROLLER_ID( 0x2dc8, 0x3106 ), k_eControllerType_XBoxOneController, NULL }, // 8BitDo Ultimate Wired Controller. Windows, Android, Switch.
|
||||
{ MAKE_CONTROLLER_ID( 0x2dc8, 0x310a ), k_eControllerType_XBoxOneController, NULL }, // 8BitDo Ultimate 2C Wireless Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x2e24, 0x0652 ), k_eControllerType_XBoxOneController, NULL }, // Hyperkin Duke
|
||||
{ MAKE_CONTROLLER_ID( 0x2e24, 0x1618 ), k_eControllerType_XBoxOneController, NULL }, // Hyperkin Duke
|
||||
{ MAKE_CONTROLLER_ID( 0x2e24, 0x1688 ), k_eControllerType_XBoxOneController, NULL }, // Hyperkin X91
|
||||
{ MAKE_CONTROLLER_ID( 0x146b, 0x0611 ), k_eControllerType_XBoxOneController, NULL }, // Xbox Controller Mode for NACON Revolution 3
|
||||
|
||||
// These have been added via Minidump for unrecognized Xinput controller assert
|
||||
{ MAKE_CONTROLLER_ID( 0x0000, 0x0000 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02a2 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller - Microsoft VID
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x1414 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0159 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x24c6, 0xfaff ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller
|
||||
@@ -444,6 +504,7 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x03eb, 0xff01 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0c12, 0x0ef8 ), k_eControllerType_XBox360Controller, NULL }, // Homemade fightstick based on brook pcb (with XInput driver??)
|
||||
{ MAKE_CONTROLLER_ID( 0x046d, 0x1000 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x11ff, 0x0511 ), k_eControllerType_XBox360Controller, NULL }, // PXN V900
|
||||
{ MAKE_CONTROLLER_ID( 0x1345, 0x6006 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller
|
||||
|
||||
{ MAKE_CONTROLLER_ID( 0x056e, 0x2012 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller
|
||||
@@ -456,7 +517,6 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x046d, 0x0291 ), k_eControllerType_XBox360Controller, NULL }, // logitech xinput
|
||||
{ MAKE_CONTROLLER_ID( 0x0079, 0x18d3 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0f0d, 0x00b1 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0001, 0x0001 ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0079, 0x188e ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0079, 0x187c ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0079, 0x189c ), k_eControllerType_XBox360Controller, NULL }, // Unknown Controller
|
||||
@@ -469,15 +529,12 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0xf0d, 0xed ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xf0d, 0xc0 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xe6f, 0x152 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xe6f, 0x2a7 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x46d, 0x1007 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xe6f, 0x2b8 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xe6f, 0x2a8 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x79, 0x18a1 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
|
||||
/* Added from Minidumps 10-9-19 */
|
||||
// Added from Minidumps 10-9-19
|
||||
{ MAKE_CONTROLLER_ID( 0x0, 0x6686 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x11ff, 0x511 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x12ab, 0x304 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x1430, 0x291 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x1430, 0x2a9 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
@@ -514,14 +571,7 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0xd62, 0x9a1b ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xe00, 0xe00 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xe6f, 0x12a ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xe6f, 0x2a1 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xe6f, 0x2a2 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xe6f, 0x2a5 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xe6f, 0x2b2 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xe6f, 0x2bd ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xe6f, 0x2bf ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xe6f, 0x2c0 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xe6f, 0x2c6 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xf0d, 0x97 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xf0d, 0xba ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xf0d, 0xd8 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
@@ -532,14 +582,12 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x2f24, 0x8f ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
{ MAKE_CONTROLLER_ID( 0xe6f, 0xf501 ), k_eControllerType_XBoxOneController, NULL }, // Unknown Controller
|
||||
|
||||
//{ MAKE_CONTROLLER_ID( 0x1949, 0x0402 ), /*android*/, NULL }, // Unknown Controller
|
||||
|
||||
{ MAKE_CONTROLLER_ID( 0x05ac, 0x0001 ), k_eControllerType_AppleController, NULL }, // MFI Extended Gamepad (generic entry for iOS/tvOS)
|
||||
{ MAKE_CONTROLLER_ID( 0x05ac, 0x0002 ), k_eControllerType_AppleController, NULL }, // MFI Standard Gamepad (generic entry for iOS/tvOS)
|
||||
|
||||
{ MAKE_CONTROLLER_ID( 0x057e, 0x2006 ), k_eControllerType_SwitchJoyConLeft, NULL }, // Nintendo Switch Joy-Con (Left)
|
||||
{ MAKE_CONTROLLER_ID( 0x057e, 0x2067 ), k_eControllerType_SwitchJoyConLeft, NULL }, // Nintendo Switch 2 Joy-Con (Left)
|
||||
{ MAKE_CONTROLLER_ID( 0x057e, 0x2007 ), k_eControllerType_SwitchJoyConRight, NULL }, // Nintendo Switch Joy-Con (Right)
|
||||
{ MAKE_CONTROLLER_ID( 0x057e, 0x2066 ), k_eControllerType_SwitchJoyConRight, NULL }, // Nintendo Switch 2 Joy-Con (Right)
|
||||
{ MAKE_CONTROLLER_ID( 0x057e, 0x2008 ), k_eControllerType_SwitchJoyConPair, NULL }, // Nintendo Switch Joy-Con (Left+Right Combined)
|
||||
{ MAKE_CONTROLLER_ID( 0x057e, 0x2068 ), k_eControllerType_SwitchJoyConPair, NULL }, // Nintendo Switch 2 Joy-Con (Left+Right Combined)
|
||||
|
||||
// This same controller ID is spoofed by many 3rd-party Switch controllers.
|
||||
// The ones we currently know of are:
|
||||
@@ -548,6 +596,7 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
// * ZhiXu Gamepad Wireless
|
||||
// * Sunwaytek Wireless Motion Controller for Nintendo Switch
|
||||
{ MAKE_CONTROLLER_ID( 0x057e, 0x2009 ), k_eControllerType_SwitchProController, NULL }, // Nintendo Switch Pro Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x057e, 0x2069 ), k_eControllerType_Switch2ProController, NULL }, // Nintendo Switch 2 Pro Controller
|
||||
//{ MAKE_CONTROLLER_ID( 0x057e, 0x2017 ), k_eControllerType_SwitchProController, NULL }, // Nintendo Online SNES Controller
|
||||
//{ MAKE_CONTROLLER_ID( 0x057e, 0x2019 ), k_eControllerType_SwitchProController, NULL }, // Nintendo Online N64 Controller
|
||||
//{ MAKE_CONTROLLER_ID( 0x057e, 0x201e ), k_eControllerType_SwitchProController, NULL }, // Nintendo Online SEGA Genesis Controller
|
||||
@@ -564,7 +613,7 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
// The first two, at least, shouldn't have their buttons remapped, and since we
|
||||
// can't tell which model we're actually using, we won't do any button remapping
|
||||
// for any of them.
|
||||
{ MAKE_CONTROLLER_ID( 0x0f0d, 0x00dc ), k_eControllerType_XInputSwitchController, NULL }, // HORIPAD S - Looks like a Switch controller but uses the Xbox 360 controller protocol
|
||||
{ MAKE_CONTROLLER_ID( 0x0f0d, 0x00dc ), k_eControllerType_XInputSwitchController, NULL }, // HORIPAD S - Looks like a Switch controller but uses the Xbox 360 controller protocol, there is also a version of this that looks like a GameCube controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0180 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Faceoff Wired Pro Controller for Nintendo Switch
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0181 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Faceoff Deluxe Wired Pro Controller for Nintendo Switch
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0184 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Faceoff Wired Deluxe+ Audio Controller
|
||||
@@ -572,6 +621,12 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0186 ), k_eControllerType_SwitchProController, NULL }, // PDP Afterglow Wireless Switch Controller - working gyro. USB is for charging only. Many later "Wireless" line devices w/ gyro also use this vid/pid
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0187 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Rockcandy Wired Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0188 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Afterglow Wired Deluxe+ Audio Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x018b ), k_eControllerType_SwitchInputOnlyController, NULL }, // PDP Afterglow Wave Wired/Wireless Controller for Switch
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x018c ), k_eControllerType_SwitchProController, "PDP REALMz Wireless Controller" }, // PDP REALMz Wireless Controller for Switch
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0193 ), k_eControllerType_Switch2ProController, NULL }, // Turtle Beach Afterglow Wireless RGB Gaming Controller for Nintendo Switch 2 and the Turtle Beach Rematch Wireless RGB Gaming Controller for Nintendo Switch 2
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0196 ), k_eControllerType_Switch2InputOnlyController, NULL }, // Turtle Beach Rematch Wired Controller for Nintendo Switch 2
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0197 ), k_eControllerType_Switch2InputOnlyController, NULL }, // Turtle Beach Afterglow Wave Wired Controller for Nintendo Switch 2
|
||||
{ MAKE_CONTROLLER_ID( 0x0e6f, 0x0198 ), k_eControllerType_Switch2InputOnlyController, NULL }, // Turtle Beach Afterglow Wired Controller for Switch 2
|
||||
{ MAKE_CONTROLLER_ID( 0x0f0d, 0x00aa ), k_eControllerType_SwitchInputOnlyController, NULL }, // HORI Real Arcade Pro V Hayabusa in Switch Mode
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0xa711 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Wired Controller Plus/PowerA Wired Controller Nintendo GameCube Style
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0xa712 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Nintendo Switch Fusion Fight Pad
|
||||
@@ -579,6 +634,27 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0xa714 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Nintendo Switch Spectra Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0xa715 ), k_eControllerType_SwitchInputOnlyController, NULL }, // Power A Fusion Wireless Arcade Stick (USB Mode) Over BT is shows up as 057e 2009
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0xa716 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Nintendo Switch Fusion Pro Controller - USB requires toggling switch on back of device
|
||||
{ MAKE_CONTROLLER_ID( 0x20d6, 0xa718 ), k_eControllerType_SwitchInputOnlyController, NULL }, // PowerA Nintendo Switch Nano Wired Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x33dd, 0x0001 ), k_eControllerType_SwitchInputOnlyController, NULL }, // ZUIKI MasCon for Nintendo Switch Black
|
||||
{ MAKE_CONTROLLER_ID( 0x33dd, 0x0002 ), k_eControllerType_SwitchInputOnlyController, NULL }, // ZUIKI MasCon for Nintendo Switch ??
|
||||
{ MAKE_CONTROLLER_ID( 0x33dd, 0x0003 ), k_eControllerType_SwitchInputOnlyController, NULL }, // ZUIKI MasCon for Nintendo Switch Red
|
||||
{ MAKE_CONTROLLER_ID( 0x0f0d, 0x00f0 ), k_eControllerType_SwitchInputOnlyController, NULL }, // HORI Taiko Controller For Switch
|
||||
|
||||
{ MAKE_CONTROLLER_ID( 0x054c, 0x0df2 ), k_eControllerType_PS5EdgeController, NULL }, // Sony DualSense Edge Controller
|
||||
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x02e3 ), k_eControllerType_XBoxEliteController, "Xbox One Elite Controller" }, // Microsoft Xbox One Elite Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b00 ), k_eControllerType_XBoxEliteController, "Xbox One Elite 2 Controller" }, // Microsoft Xbox One Elite Series 2 Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b05 ), k_eControllerType_XBoxEliteController, "Xbox One Elite 2 Controller" }, // Microsoft Xbox One Elite Series 2 Controller (Bluetooth)
|
||||
{ MAKE_CONTROLLER_ID( 0x045e, 0x0b22 ), k_eControllerType_XBoxEliteController, "Xbox One Elite 2 Controller" }, // Microsoft Xbox One Elite Series 2 Controller (BLE)
|
||||
|
||||
{ MAKE_CONTROLLER_ID( 0x2dc8, 0x6000 ), k_eControllerType_8BitDoController, "8Bitdo SF30 Controller" }, // 8BitDo SF30 Pro Controller in Steam Mode
|
||||
{ MAKE_CONTROLLER_ID( 0x2dc8, 0x6100 ), k_eControllerType_8BitDoController, "8Bitdo SF30 Controller" }, // 8BitDo SF30 Pro Controller in Steam Mode (Bluetooth)
|
||||
{ MAKE_CONTROLLER_ID( 0x2dc8, 0x6001 ), k_eControllerType_8BitDoController, "8Bitdo SN30 Controller" }, // 8BitDo SN30 Pro Controller in Steam Mode
|
||||
{ MAKE_CONTROLLER_ID( 0x2dc8, 0x6101 ), k_eControllerType_8BitDoController, "8Bitdo SN30 Controller" }, // 8BitDo SN30 Pro Controller in Steam Mode (Bluetooth)
|
||||
{ MAKE_CONTROLLER_ID( 0x2dc8, 0x6003 ), k_eControllerType_8BitDoController, "8Bitdo Pro 2 Controller" }, // 8BitDo Pro 2 Controller in Steam Mode
|
||||
{ MAKE_CONTROLLER_ID( 0x2dc8, 0x6006 ), k_eControllerType_8BitDoController, "8Bitdo Pro 2 Controller" }, // 8BitDo Pro 2 Controller in Steam Mode
|
||||
{ MAKE_CONTROLLER_ID( 0x2dc8, 0x6009 ), k_eControllerType_8BitDoController, "8Bitdo Pro 3 Controller" }, // 8BitDo Pro 3 Controller in Steam Mode (Bluetooth)
|
||||
{ MAKE_CONTROLLER_ID( 0x2dc8, 0x6012 ), k_eControllerType_8BitDoController, "8Bitdo Ultimate 2 Wireless Controller" }, // 8BitDo Ultimate 2 Wireless Controller in Steam Mode (Bluetooth)
|
||||
|
||||
// Valve products
|
||||
{ MAKE_CONTROLLER_ID( 0x0000, 0x11fb ), k_eControllerType_MobileTouch, NULL }, // Streaming mobile touch virtual controls
|
||||
@@ -586,7 +662,16 @@ static const ControllerDescription_t arrControllers[] = {
|
||||
{ MAKE_CONTROLLER_ID( 0x28de, 0x1102 ), k_eControllerType_SteamController, NULL }, // Valve wired Steam Controller (D0G)
|
||||
{ MAKE_CONTROLLER_ID( 0x28de, 0x1105 ), k_eControllerType_SteamController, NULL }, // Valve Bluetooth Steam Controller (D0G)
|
||||
{ MAKE_CONTROLLER_ID( 0x28de, 0x1106 ), k_eControllerType_SteamController, NULL }, // Valve Bluetooth Steam Controller (D0G)
|
||||
{ MAKE_CONTROLLER_ID( 0x28de, 0x11ff ), k_eControllerType_UnknownNonSteamController, NULL }, // Steam Virtual Gamepad
|
||||
{ MAKE_CONTROLLER_ID( 0x28de, 0x1142 ), k_eControllerType_SteamController, NULL }, // Valve wireless Steam Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x28de, 0x1201 ), k_eControllerType_SteamControllerV2, NULL }, // Valve wired Steam Controller (HEADCRAB)
|
||||
{ MAKE_CONTROLLER_ID( 0x28de, 0x1202 ), k_eControllerType_SteamControllerV2, NULL }, // Valve Bluetooth Steam Controller (HEADCRAB)
|
||||
{ MAKE_CONTROLLER_ID( 0x28de, 0x1205 ), k_eControllerType_SteamControllerNeptune, NULL }, // Valve Steam Deck Builtin Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x28de, 0x1302 ), k_eControllerType_SteamControllerTriton, NULL }, // Valve Steam Triton Controller
|
||||
{ MAKE_CONTROLLER_ID( 0x28de, 0x1303 ), k_eControllerType_SteamControllerTriton, NULL }, // Valve Steam Triton Controller (BLE)
|
||||
{ MAKE_CONTROLLER_ID( 0x28de, 0x1304 ), k_eControllerType_SteamControllerTriton, NULL }, // Valve Steam Proteus Dongle (Proprietary)
|
||||
{ MAKE_CONTROLLER_ID( 0x28de, 0x1305 ), k_eControllerType_SteamControllerTriton, NULL }, // Valve Steam Nereid Dongle (Proprietary)
|
||||
|
||||
{ MAKE_CONTROLLER_ID( 0x0f0d, 0x01AB ), k_eControllerType_HoriSteamController, NULL }, // HORI Wireless HORIPAD for Steam
|
||||
{ MAKE_CONTROLLER_ID( 0x0f0d, 0x0196 ), k_eControllerType_HoriSteamController, NULL }, // HORI Wireless HORIPAD for Steam ( BT )
|
||||
};
|
||||
@@ -37,6 +37,9 @@ typedef enum
|
||||
k_eControllerType_UnknownSteamController = 1,
|
||||
k_eControllerType_SteamController = 2,
|
||||
k_eControllerType_SteamControllerV2 = 3,
|
||||
k_eControllerType_SteamControllerNeptune = 4,
|
||||
|
||||
k_eControllerType_SteamControllerTriton = 10,
|
||||
|
||||
// Other Controllers
|
||||
k_eControllerType_UnknownNonSteamController = 30,
|
||||
@@ -55,7 +58,13 @@ typedef enum
|
||||
k_eControllerType_MobileTouch = 43,
|
||||
k_eControllerType_XInputSwitchController = 44, // Client-side only, used to mark Nintendo Switch style controllers as using XInput instead of the Nintendo Switch protocol
|
||||
k_eControllerType_PS5Controller = 45,
|
||||
k_eControllerType_XInputPS4Controller = 46, // Client-side only, used to mark DualShock 4 style controllers using XInput instead of the DualShock 4 controller protocol
|
||||
k_eControllerType_XBoxEliteController = 46,
|
||||
k_eControllerType_XInputPS4Controller = 47, // Client-side only, used to mark DualShock 4 style controllers using XInput instead of the DualShock 4 controller protocol
|
||||
k_eControllerType_PS5EdgeController = 48,
|
||||
k_eControllerType_HoriSteamController = 49,
|
||||
k_eControllerType_8BitDoController = 50,
|
||||
k_eControllerType_Switch2ProController = 51,
|
||||
k_eControllerType_Switch2InputOnlyController = 52,
|
||||
k_eControllerType_LastController, // Don't add game controllers below this enumeration - this enumeration can change value
|
||||
|
||||
// Keyboards and Mice
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,100 +0,0 @@
|
||||
ANDROID_API_TARGET=21
|
||||
PARALLEL_JOBS=$(nproc)
|
||||
|
||||
rm -r ./android
|
||||
mkdir android
|
||||
|
||||
function build_one
|
||||
{
|
||||
PREFIX=$(pwd)/android/$CPU
|
||||
SYSROOT=$NDK/platforms/android-$ANDROID_API_TARGET/arch-$SYSROOT_CPU
|
||||
TOOLCHAIN_PATH=$NDK/toolchains/$TOOLCHAIN_DIR/prebuilt/linux-x86_64
|
||||
export PATH=$PATH:$TOOLCHAIN_PATH/bin
|
||||
./configure \
|
||||
--build=x86_64-unknown-linux-gnu \
|
||||
--host=$TOOLCHAIN_BIN_PREFIX \
|
||||
--target=$TOOLCHAIN_BIN_PREFIX \
|
||||
CFLAGS="--sysroot=$SYSROOT -O2 $ADDI_CFLAGS" \
|
||||
$ADDI_CONFIGURE_FLAGS
|
||||
make clean
|
||||
make -j$PARALLEL_JOBS
|
||||
mkdir android/$CPU
|
||||
cp .libs/libopus.a android/$CPU
|
||||
}
|
||||
|
||||
function build_mips
|
||||
{
|
||||
CPU=mips
|
||||
SYSROOT_CPU=mips
|
||||
TOOLCHAIN_BIN_PREFIX=mipsel-linux-android
|
||||
TOOLCHAIN_DIR=mipsel-linux-android-4.9
|
||||
ADDI_CFLAGS="-mips32 -mhard-float -EL -mno-dsp"
|
||||
ADDI_CONFIGURE_FLAGS="--enable-fixed-point" # fixed point
|
||||
build_one
|
||||
}
|
||||
|
||||
function build_mips64
|
||||
{
|
||||
CPU=mips64
|
||||
SYSROOT_CPU=mips64
|
||||
TOOLCHAIN_BIN_PREFIX=mips64el-linux-android
|
||||
TOOLCHAIN_DIR=mips64el-linux-android-4.9
|
||||
ADDI_CFLAGS="-mips64r6"
|
||||
ADDI_CONFIGURE_FLAGS="--enable-fixed-point" # fixed point
|
||||
build_one
|
||||
}
|
||||
|
||||
function build_x86
|
||||
{
|
||||
CPU=x86
|
||||
SYSROOT_CPU=x86
|
||||
TOOLCHAIN_BIN_PREFIX=i686-linux-android
|
||||
TOOLCHAIN_DIR=x86-4.9
|
||||
ADDI_CFLAGS="-march=i686 -mtune=atom -mstackrealign -msse -msse2 -msse3 -mssse3 -mfpmath=sse -m32"
|
||||
ADDI_CONFIGURE_FLAGS="" # floating point for SSE optimizations
|
||||
build_one
|
||||
}
|
||||
|
||||
function build_x86_64
|
||||
{
|
||||
CPU=x86_64
|
||||
SYSROOT_CPU=x86_64
|
||||
TOOLCHAIN_BIN_PREFIX=x86_64-linux-android
|
||||
TOOLCHAIN_DIR=x86_64-4.9
|
||||
ADDI_CFLAGS="-msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -mpopcnt -m64"
|
||||
ADDI_CONFIGURE_FLAGS="" # floating point for SSE optimizations
|
||||
build_one
|
||||
}
|
||||
|
||||
function build_armv7
|
||||
{
|
||||
CPU=arm
|
||||
SYSROOT_CPU=arm
|
||||
TOOLCHAIN_BIN_PREFIX=arm-linux-androideabi
|
||||
TOOLCHAIN_DIR=arm-linux-androideabi-4.9
|
||||
ADDI_CFLAGS="-marm -mfpu=vfpv3-d16"
|
||||
ADDI_LDFLAGS=""
|
||||
ADDI_CONFIGURE_FLAGS="--enable-fixed-point" # fixed point for NEON, EDSP, Media
|
||||
build_one
|
||||
}
|
||||
|
||||
# ARMv8 doesn't currently have assembly in the opus project. We still use fixed point
|
||||
# anyway in the hopes that it will be more performant even without assembly.
|
||||
function build_armv8
|
||||
{
|
||||
CPU=aarch64
|
||||
SYSROOT_CPU=arm64
|
||||
TOOLCHAIN_BIN_PREFIX=aarch64-linux-android
|
||||
TOOLCHAIN_DIR=aarch64-linux-android-4.9
|
||||
ADDI_CFLAGS=""
|
||||
ADDI_LDFLAGS=""
|
||||
ADDI_CONFIGURE_FLAGS="--enable-fixed-point"
|
||||
build_one
|
||||
}
|
||||
|
||||
build_mips
|
||||
build_mips64
|
||||
build_x86
|
||||
build_x86_64
|
||||
build_armv7
|
||||
build_armv8
|
||||
@@ -1,342 +0,0 @@
|
||||
/* Copyright (c) 2007-2008 CSIRO
|
||||
Copyright (c) 2007-2009 Xiph.Org Foundation
|
||||
Copyright (c) 2008-2012 Gregory Maxwell
|
||||
Written by Jean-Marc Valin and Gregory Maxwell */
|
||||
/*
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
|
||||
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/**
|
||||
@file opus_custom.h
|
||||
@brief Opus-Custom reference implementation API
|
||||
*/
|
||||
|
||||
#ifndef OPUS_CUSTOM_H
|
||||
#define OPUS_CUSTOM_H
|
||||
|
||||
#include "opus_defines.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef CUSTOM_MODES
|
||||
# define OPUS_CUSTOM_EXPORT OPUS_EXPORT
|
||||
# define OPUS_CUSTOM_EXPORT_STATIC OPUS_EXPORT
|
||||
#else
|
||||
# define OPUS_CUSTOM_EXPORT
|
||||
# ifdef OPUS_BUILD
|
||||
# define OPUS_CUSTOM_EXPORT_STATIC static OPUS_INLINE
|
||||
# else
|
||||
# define OPUS_CUSTOM_EXPORT_STATIC
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/** @defgroup opus_custom Opus Custom
|
||||
* @{
|
||||
* Opus Custom is an optional part of the Opus specification and
|
||||
* reference implementation which uses a distinct API from the regular
|
||||
* API and supports frame sizes that are not normally supported.\ Use
|
||||
* of Opus Custom is discouraged for all but very special applications
|
||||
* for which a frame size different from 2.5, 5, 10, or 20 ms is needed
|
||||
* (for either complexity or latency reasons) and where interoperability
|
||||
* is less important.
|
||||
*
|
||||
* In addition to the interoperability limitations the use of Opus custom
|
||||
* disables a substantial chunk of the codec and generally lowers the
|
||||
* quality available at a given bitrate. Normally when an application needs
|
||||
* a different frame size from the codec it should buffer to match the
|
||||
* sizes but this adds a small amount of delay which may be important
|
||||
* in some very low latency applications. Some transports (especially
|
||||
* constant rate RF transports) may also work best with frames of
|
||||
* particular durations.
|
||||
*
|
||||
* Libopus only supports custom modes if they are enabled at compile time.
|
||||
*
|
||||
* The Opus Custom API is similar to the regular API but the
|
||||
* @ref opus_encoder_create and @ref opus_decoder_create calls take
|
||||
* an additional mode parameter which is a structure produced by
|
||||
* a call to @ref opus_custom_mode_create. Both the encoder and decoder
|
||||
* must create a mode using the same sample rate (fs) and frame size
|
||||
* (frame size) so these parameters must either be signaled out of band
|
||||
* or fixed in a particular implementation.
|
||||
*
|
||||
* Similar to regular Opus the custom modes support on the fly frame size
|
||||
* switching, but the sizes available depend on the particular frame size in
|
||||
* use. For some initial frame sizes on a single on the fly size is available.
|
||||
*/
|
||||
|
||||
/** Contains the state of an encoder. One encoder state is needed
|
||||
for each stream. It is initialized once at the beginning of the
|
||||
stream. Do *not* re-initialize the state for every frame.
|
||||
@brief Encoder state
|
||||
*/
|
||||
typedef struct OpusCustomEncoder OpusCustomEncoder;
|
||||
|
||||
/** State of the decoder. One decoder state is needed for each stream.
|
||||
It is initialized once at the beginning of the stream. Do *not*
|
||||
re-initialize the state for every frame.
|
||||
@brief Decoder state
|
||||
*/
|
||||
typedef struct OpusCustomDecoder OpusCustomDecoder;
|
||||
|
||||
/** The mode contains all the information necessary to create an
|
||||
encoder. Both the encoder and decoder need to be initialized
|
||||
with exactly the same mode, otherwise the output will be
|
||||
corrupted.
|
||||
@brief Mode configuration
|
||||
*/
|
||||
typedef struct OpusCustomMode OpusCustomMode;
|
||||
|
||||
/** Creates a new mode struct. This will be passed to an encoder or
|
||||
* decoder. The mode MUST NOT BE DESTROYED until the encoders and
|
||||
* decoders that use it are destroyed as well.
|
||||
* @param [in] Fs <tt>int</tt>: Sampling rate (8000 to 96000 Hz)
|
||||
* @param [in] frame_size <tt>int</tt>: Number of samples (per channel) to encode in each
|
||||
* packet (64 - 1024, prime factorization must contain zero or more 2s, 3s, or 5s and no other primes)
|
||||
* @param [out] error <tt>int*</tt>: Returned error code (if NULL, no error will be returned)
|
||||
* @return A newly created mode
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomMode *opus_custom_mode_create(opus_int32 Fs, int frame_size, int *error);
|
||||
|
||||
/** Destroys a mode struct. Only call this after all encoders and
|
||||
* decoders using this mode are destroyed as well.
|
||||
* @param [in] mode <tt>OpusCustomMode*</tt>: Mode to be freed.
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT void opus_custom_mode_destroy(OpusCustomMode *mode);
|
||||
|
||||
|
||||
#if !defined(OPUS_BUILD) || defined(CELT_ENCODER_C)
|
||||
|
||||
/* Encoder */
|
||||
/** Gets the size of an OpusCustomEncoder structure.
|
||||
* @param [in] mode <tt>OpusCustomMode *</tt>: Mode configuration
|
||||
* @param [in] channels <tt>int</tt>: Number of channels
|
||||
* @returns size
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_encoder_get_size(
|
||||
const OpusCustomMode *mode,
|
||||
int channels
|
||||
) OPUS_ARG_NONNULL(1);
|
||||
|
||||
# ifdef CUSTOM_MODES
|
||||
/** Initializes a previously allocated encoder state
|
||||
* The memory pointed to by st must be the size returned by opus_custom_encoder_get_size.
|
||||
* This is intended for applications which use their own allocator instead of malloc.
|
||||
* @see opus_custom_encoder_create(),opus_custom_encoder_get_size()
|
||||
* To reset a previously initialized state use the OPUS_RESET_STATE CTL.
|
||||
* @param [in] st <tt>OpusCustomEncoder*</tt>: Encoder state
|
||||
* @param [in] mode <tt>OpusCustomMode *</tt>: Contains all the information about the characteristics of
|
||||
* the stream (must be the same characteristics as used for the
|
||||
* decoder)
|
||||
* @param [in] channels <tt>int</tt>: Number of channels
|
||||
* @return OPUS_OK Success or @ref opus_errorcodes
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT int opus_custom_encoder_init(
|
||||
OpusCustomEncoder *st,
|
||||
const OpusCustomMode *mode,
|
||||
int channels
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/** Creates a new encoder state. Each stream needs its own encoder
|
||||
* state (can't be shared across simultaneous streams).
|
||||
* @param [in] mode <tt>OpusCustomMode*</tt>: Contains all the information about the characteristics of
|
||||
* the stream (must be the same characteristics as used for the
|
||||
* decoder)
|
||||
* @param [in] channels <tt>int</tt>: Number of channels
|
||||
* @param [out] error <tt>int*</tt>: Returns an error code
|
||||
* @return Newly created encoder state.
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomEncoder *opus_custom_encoder_create(
|
||||
const OpusCustomMode *mode,
|
||||
int channels,
|
||||
int *error
|
||||
) OPUS_ARG_NONNULL(1);
|
||||
|
||||
|
||||
/** Destroys a an encoder state.
|
||||
* @param[in] st <tt>OpusCustomEncoder*</tt>: State to be freed.
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT void opus_custom_encoder_destroy(OpusCustomEncoder *st);
|
||||
|
||||
/** Encodes a frame of audio.
|
||||
* @param [in] st <tt>OpusCustomEncoder*</tt>: Encoder state
|
||||
* @param [in] pcm <tt>float*</tt>: PCM audio in float format, with a normal range of +/-1.0.
|
||||
* Samples with a range beyond +/-1.0 are supported but will
|
||||
* be clipped by decoders using the integer API and should
|
||||
* only be used if it is known that the far end supports
|
||||
* extended dynamic range. There must be exactly
|
||||
* frame_size samples per channel.
|
||||
* @param [in] frame_size <tt>int</tt>: Number of samples per frame of input signal
|
||||
* @param [out] compressed <tt>char *</tt>: The compressed data is written here. This may not alias pcm and must be at least maxCompressedBytes long.
|
||||
* @param [in] maxCompressedBytes <tt>int</tt>: Maximum number of bytes to use for compressing the frame
|
||||
* (can change from one frame to another)
|
||||
* @return Number of bytes written to "compressed".
|
||||
* If negative, an error has occurred (see error codes). It is IMPORTANT that
|
||||
* the length returned be somehow transmitted to the decoder. Otherwise, no
|
||||
* decoding is possible.
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_encode_float(
|
||||
OpusCustomEncoder *st,
|
||||
const float *pcm,
|
||||
int frame_size,
|
||||
unsigned char *compressed,
|
||||
int maxCompressedBytes
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Encodes a frame of audio.
|
||||
* @param [in] st <tt>OpusCustomEncoder*</tt>: Encoder state
|
||||
* @param [in] pcm <tt>opus_int16*</tt>: PCM audio in signed 16-bit format (native endian).
|
||||
* There must be exactly frame_size samples per channel.
|
||||
* @param [in] frame_size <tt>int</tt>: Number of samples per frame of input signal
|
||||
* @param [out] compressed <tt>char *</tt>: The compressed data is written here. This may not alias pcm and must be at least maxCompressedBytes long.
|
||||
* @param [in] maxCompressedBytes <tt>int</tt>: Maximum number of bytes to use for compressing the frame
|
||||
* (can change from one frame to another)
|
||||
* @return Number of bytes written to "compressed".
|
||||
* If negative, an error has occurred (see error codes). It is IMPORTANT that
|
||||
* the length returned be somehow transmitted to the decoder. Otherwise, no
|
||||
* decoding is possible.
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_encode(
|
||||
OpusCustomEncoder *st,
|
||||
const opus_int16 *pcm,
|
||||
int frame_size,
|
||||
unsigned char *compressed,
|
||||
int maxCompressedBytes
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Perform a CTL function on an Opus custom encoder.
|
||||
*
|
||||
* Generally the request and subsequent arguments are generated
|
||||
* by a convenience macro.
|
||||
* @see opus_encoderctls
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT int opus_custom_encoder_ctl(OpusCustomEncoder * OPUS_RESTRICT st, int request, ...) OPUS_ARG_NONNULL(1);
|
||||
|
||||
|
||||
#if !defined(OPUS_BUILD) || defined(CELT_DECODER_C)
|
||||
/* Decoder */
|
||||
|
||||
/** Gets the size of an OpusCustomDecoder structure.
|
||||
* @param [in] mode <tt>OpusCustomMode *</tt>: Mode configuration
|
||||
* @param [in] channels <tt>int</tt>: Number of channels
|
||||
* @returns size
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_decoder_get_size(
|
||||
const OpusCustomMode *mode,
|
||||
int channels
|
||||
) OPUS_ARG_NONNULL(1);
|
||||
|
||||
/** Initializes a previously allocated decoder state
|
||||
* The memory pointed to by st must be the size returned by opus_custom_decoder_get_size.
|
||||
* This is intended for applications which use their own allocator instead of malloc.
|
||||
* @see opus_custom_decoder_create(),opus_custom_decoder_get_size()
|
||||
* To reset a previously initialized state use the OPUS_RESET_STATE CTL.
|
||||
* @param [in] st <tt>OpusCustomDecoder*</tt>: Decoder state
|
||||
* @param [in] mode <tt>OpusCustomMode *</tt>: Contains all the information about the characteristics of
|
||||
* the stream (must be the same characteristics as used for the
|
||||
* encoder)
|
||||
* @param [in] channels <tt>int</tt>: Number of channels
|
||||
* @return OPUS_OK Success or @ref opus_errorcodes
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT_STATIC int opus_custom_decoder_init(
|
||||
OpusCustomDecoder *st,
|
||||
const OpusCustomMode *mode,
|
||||
int channels
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/** Creates a new decoder state. Each stream needs its own decoder state (can't
|
||||
* be shared across simultaneous streams).
|
||||
* @param [in] mode <tt>OpusCustomMode</tt>: Contains all the information about the characteristics of the
|
||||
* stream (must be the same characteristics as used for the encoder)
|
||||
* @param [in] channels <tt>int</tt>: Number of channels
|
||||
* @param [out] error <tt>int*</tt>: Returns an error code
|
||||
* @return Newly created decoder state.
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT OpusCustomDecoder *opus_custom_decoder_create(
|
||||
const OpusCustomMode *mode,
|
||||
int channels,
|
||||
int *error
|
||||
) OPUS_ARG_NONNULL(1);
|
||||
|
||||
/** Destroys a an decoder state.
|
||||
* @param[in] st <tt>OpusCustomDecoder*</tt>: State to be freed.
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT void opus_custom_decoder_destroy(OpusCustomDecoder *st);
|
||||
|
||||
/** Decode an opus custom frame with floating point output
|
||||
* @param [in] st <tt>OpusCustomDecoder*</tt>: Decoder state
|
||||
* @param [in] data <tt>char*</tt>: Input payload. Use a NULL pointer to indicate packet loss
|
||||
* @param [in] len <tt>int</tt>: Number of bytes in payload
|
||||
* @param [out] pcm <tt>float*</tt>: Output signal (interleaved if 2 channels). length
|
||||
* is frame_size*channels*sizeof(float)
|
||||
* @param [in] frame_size Number of samples per channel of available space in *pcm.
|
||||
* @returns Number of decoded samples or @ref opus_errorcodes
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_decode_float(
|
||||
OpusCustomDecoder *st,
|
||||
const unsigned char *data,
|
||||
int len,
|
||||
float *pcm,
|
||||
int frame_size
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Decode an opus custom frame
|
||||
* @param [in] st <tt>OpusCustomDecoder*</tt>: Decoder state
|
||||
* @param [in] data <tt>char*</tt>: Input payload. Use a NULL pointer to indicate packet loss
|
||||
* @param [in] len <tt>int</tt>: Number of bytes in payload
|
||||
* @param [out] pcm <tt>opus_int16*</tt>: Output signal (interleaved if 2 channels). length
|
||||
* is frame_size*channels*sizeof(opus_int16)
|
||||
* @param [in] frame_size Number of samples per channel of available space in *pcm.
|
||||
* @returns Number of decoded samples or @ref opus_errorcodes
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT OPUS_WARN_UNUSED_RESULT int opus_custom_decode(
|
||||
OpusCustomDecoder *st,
|
||||
const unsigned char *data,
|
||||
int len,
|
||||
opus_int16 *pcm,
|
||||
int frame_size
|
||||
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
|
||||
|
||||
/** Perform a CTL function on an Opus custom decoder.
|
||||
*
|
||||
* Generally the request and subsequent arguments are generated
|
||||
* by a convenience macro.
|
||||
* @see opus_genericctls
|
||||
*/
|
||||
OPUS_CUSTOM_EXPORT int opus_custom_decoder_ctl(OpusCustomDecoder * OPUS_RESTRICT st, int request, ...) OPUS_ARG_NONNULL(1);
|
||||
|
||||
/**@}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* OPUS_CUSTOM_H */
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2023 Sam Lantinga <slouken@libsdl.org>
|
||||
Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@@ -22,86 +22,222 @@
|
||||
// This file includes a few functions standalone from SDL_joystick.c useful for joystick typing
|
||||
|
||||
#include "minisdl.h"
|
||||
#include "controller_type.h"
|
||||
#include "controller_list.h"
|
||||
#include "usb_ids.h"
|
||||
|
||||
SDL_bool SDL_IsJoystickXboxOneElite(Uint16 vendor_id, Uint16 product_id)
|
||||
// Macro to combine a USB vendor ID and product ID into a single Uint32 value
|
||||
#define MAKE_VIDPID(VID, PID) (((Uint32)(VID)) << 16 | (PID))
|
||||
|
||||
static Uint32 initial_old_xboxone_controllers[] = {
|
||||
MAKE_VIDPID(0x0000, 0x6686),
|
||||
MAKE_VIDPID(0x0079, 0x18a1),
|
||||
MAKE_VIDPID(0x0079, 0x18c2),
|
||||
MAKE_VIDPID(0x0079, 0x18c8),
|
||||
MAKE_VIDPID(0x0079, 0x18cf),
|
||||
MAKE_VIDPID(0x03f0, 0x0495),
|
||||
MAKE_VIDPID(0x045e, 0x02d1),
|
||||
MAKE_VIDPID(0x045e, 0x02dd),
|
||||
MAKE_VIDPID(0x045e, 0x02e0),
|
||||
MAKE_VIDPID(0x045e, 0x02e3),
|
||||
MAKE_VIDPID(0x045e, 0x02ea),
|
||||
MAKE_VIDPID(0x045e, 0x02fd),
|
||||
MAKE_VIDPID(0x045e, 0x02ff),
|
||||
MAKE_VIDPID(0x045e, 0x0867),
|
||||
MAKE_VIDPID(0x045e, 0x0b00),
|
||||
MAKE_VIDPID(0x045e, 0x0b05),
|
||||
MAKE_VIDPID(0x045e, 0x0b0a),
|
||||
MAKE_VIDPID(0x045e, 0x0b0c),
|
||||
MAKE_VIDPID(0x045e, 0x0b20),
|
||||
MAKE_VIDPID(0x045e, 0x0b21),
|
||||
MAKE_VIDPID(0x045e, 0x0b22),
|
||||
MAKE_VIDPID(0x046d, 0x0000),
|
||||
MAKE_VIDPID(0x046d, 0x1004),
|
||||
MAKE_VIDPID(0x046d, 0x1007),
|
||||
MAKE_VIDPID(0x046d, 0x1008),
|
||||
MAKE_VIDPID(0x046d, 0xf301),
|
||||
MAKE_VIDPID(0x0738, 0x02a0),
|
||||
MAKE_VIDPID(0x0738, 0x4a01),
|
||||
MAKE_VIDPID(0x0738, 0x7263),
|
||||
MAKE_VIDPID(0x0738, 0xb738),
|
||||
MAKE_VIDPID(0x0738, 0xcb29),
|
||||
MAKE_VIDPID(0x0738, 0xf401),
|
||||
MAKE_VIDPID(0x0c12, 0x0e17),
|
||||
MAKE_VIDPID(0x0c12, 0x0e1c),
|
||||
MAKE_VIDPID(0x0c12, 0x0e22),
|
||||
MAKE_VIDPID(0x0c12, 0x0e30),
|
||||
MAKE_VIDPID(0x0d62, 0x9a1a),
|
||||
MAKE_VIDPID(0x0d62, 0x9a1b),
|
||||
MAKE_VIDPID(0x0e00, 0x0e00),
|
||||
MAKE_VIDPID(0x0e6f, 0x012a),
|
||||
MAKE_VIDPID(0x0e6f, 0x0139),
|
||||
MAKE_VIDPID(0x0e6f, 0x013B),
|
||||
MAKE_VIDPID(0x0e6f, 0x013a),
|
||||
MAKE_VIDPID(0x0e6f, 0x0145),
|
||||
MAKE_VIDPID(0x0e6f, 0x0146),
|
||||
MAKE_VIDPID(0x0e6f, 0x0152),
|
||||
MAKE_VIDPID(0x0e6f, 0x015b),
|
||||
MAKE_VIDPID(0x0e6f, 0x015c),
|
||||
MAKE_VIDPID(0x0e6f, 0x015d),
|
||||
MAKE_VIDPID(0x0e6f, 0x015f),
|
||||
MAKE_VIDPID(0x0e6f, 0x0160),
|
||||
MAKE_VIDPID(0x0e6f, 0x0161),
|
||||
MAKE_VIDPID(0x0e6f, 0x0162),
|
||||
MAKE_VIDPID(0x0e6f, 0x0163),
|
||||
MAKE_VIDPID(0x0e6f, 0x0164),
|
||||
MAKE_VIDPID(0x0e6f, 0x0165),
|
||||
MAKE_VIDPID(0x0e6f, 0x0166),
|
||||
MAKE_VIDPID(0x0e6f, 0x0167),
|
||||
MAKE_VIDPID(0x0e6f, 0x0205),
|
||||
MAKE_VIDPID(0x0e6f, 0x0206),
|
||||
MAKE_VIDPID(0x0e6f, 0x0246),
|
||||
MAKE_VIDPID(0x0e6f, 0x0261),
|
||||
MAKE_VIDPID(0x0e6f, 0x0262),
|
||||
MAKE_VIDPID(0x0e6f, 0x02a0),
|
||||
MAKE_VIDPID(0x0e6f, 0x02a1),
|
||||
MAKE_VIDPID(0x0e6f, 0x02a2),
|
||||
MAKE_VIDPID(0x0e6f, 0x02a3),
|
||||
MAKE_VIDPID(0x0e6f, 0x02a4),
|
||||
MAKE_VIDPID(0x0e6f, 0x02a5),
|
||||
MAKE_VIDPID(0x0e6f, 0x02a6),
|
||||
MAKE_VIDPID(0x0e6f, 0x02a7),
|
||||
MAKE_VIDPID(0x0e6f, 0x02a8),
|
||||
MAKE_VIDPID(0x0e6f, 0x02a9),
|
||||
MAKE_VIDPID(0x0e6f, 0x02aa),
|
||||
MAKE_VIDPID(0x0e6f, 0x02ab),
|
||||
MAKE_VIDPID(0x0e6f, 0x02ac),
|
||||
MAKE_VIDPID(0x0e6f, 0x02ad),
|
||||
MAKE_VIDPID(0x0e6f, 0x02ae),
|
||||
MAKE_VIDPID(0x0e6f, 0x02af),
|
||||
MAKE_VIDPID(0x0e6f, 0x02b0),
|
||||
MAKE_VIDPID(0x0e6f, 0x02b1),
|
||||
MAKE_VIDPID(0x0e6f, 0x02b2),
|
||||
MAKE_VIDPID(0x0e6f, 0x02b3),
|
||||
MAKE_VIDPID(0x0e6f, 0x02b5),
|
||||
MAKE_VIDPID(0x0e6f, 0x02b6),
|
||||
MAKE_VIDPID(0x0e6f, 0x02b8),
|
||||
MAKE_VIDPID(0x0e6f, 0x02bd),
|
||||
MAKE_VIDPID(0x0e6f, 0x02be),
|
||||
MAKE_VIDPID(0x0e6f, 0x02bf),
|
||||
MAKE_VIDPID(0x0e6f, 0x02c0),
|
||||
MAKE_VIDPID(0x0e6f, 0x02c1),
|
||||
MAKE_VIDPID(0x0e6f, 0x02c2),
|
||||
MAKE_VIDPID(0x0e6f, 0x02c3),
|
||||
MAKE_VIDPID(0x0e6f, 0x02c4),
|
||||
MAKE_VIDPID(0x0e6f, 0x02c5),
|
||||
MAKE_VIDPID(0x0e6f, 0x02c6),
|
||||
MAKE_VIDPID(0x0e6f, 0x02c7),
|
||||
MAKE_VIDPID(0x0e6f, 0x02c8),
|
||||
MAKE_VIDPID(0x0e6f, 0x02c9),
|
||||
MAKE_VIDPID(0x0e6f, 0x02ca),
|
||||
MAKE_VIDPID(0x0e6f, 0x02cb),
|
||||
MAKE_VIDPID(0x0e6f, 0x02cd),
|
||||
MAKE_VIDPID(0x0e6f, 0x02ce),
|
||||
MAKE_VIDPID(0x0e6f, 0x02cf),
|
||||
MAKE_VIDPID(0x0e6f, 0x02d5),
|
||||
MAKE_VIDPID(0x0e6f, 0x0346),
|
||||
MAKE_VIDPID(0x0e6f, 0x0446),
|
||||
MAKE_VIDPID(0x0e6f, 0xf501),
|
||||
MAKE_VIDPID(0x0f0d, 0x0063),
|
||||
MAKE_VIDPID(0x0f0d, 0x0067),
|
||||
MAKE_VIDPID(0x0f0d, 0x0078),
|
||||
MAKE_VIDPID(0x0f0d, 0x0097),
|
||||
MAKE_VIDPID(0x0f0d, 0x00ba),
|
||||
MAKE_VIDPID(0x0f0d, 0x00c0),
|
||||
MAKE_VIDPID(0x0f0d, 0x00c5),
|
||||
MAKE_VIDPID(0x0f0d, 0x00d8),
|
||||
MAKE_VIDPID(0x0f0d, 0x00ed),
|
||||
MAKE_VIDPID(0x0fff, 0x02a1),
|
||||
MAKE_VIDPID(0x12ab, 0x0304),
|
||||
MAKE_VIDPID(0x1430, 0x0291),
|
||||
MAKE_VIDPID(0x1430, 0x02a9),
|
||||
MAKE_VIDPID(0x1430, 0x070b),
|
||||
MAKE_VIDPID(0x1430, 0x0719),
|
||||
MAKE_VIDPID(0x146b, 0x0611),
|
||||
MAKE_VIDPID(0x1532, 0x0a00),
|
||||
MAKE_VIDPID(0x1532, 0x0a03),
|
||||
MAKE_VIDPID(0x1532, 0x0a14),
|
||||
MAKE_VIDPID(0x1532, 0x0a15),
|
||||
MAKE_VIDPID(0x16d0, 0x0f3f),
|
||||
MAKE_VIDPID(0x1bad, 0x028e),
|
||||
MAKE_VIDPID(0x1bad, 0x02a0),
|
||||
MAKE_VIDPID(0x1bad, 0x5500),
|
||||
MAKE_VIDPID(0x20ab, 0x55ef),
|
||||
MAKE_VIDPID(0x24c6, 0x541a),
|
||||
MAKE_VIDPID(0x24c6, 0x542a),
|
||||
MAKE_VIDPID(0x24c6, 0x543a),
|
||||
MAKE_VIDPID(0x24c6, 0x5509),
|
||||
MAKE_VIDPID(0x24c6, 0x551a),
|
||||
MAKE_VIDPID(0x24c6, 0x561a),
|
||||
MAKE_VIDPID(0x24c6, 0x581a),
|
||||
MAKE_VIDPID(0x24c6, 0x591a),
|
||||
MAKE_VIDPID(0x24c6, 0x592a),
|
||||
MAKE_VIDPID(0x24c6, 0x791a),
|
||||
MAKE_VIDPID(0x2516, 0x0069),
|
||||
MAKE_VIDPID(0x25b1, 0x0360),
|
||||
MAKE_VIDPID(0x2c22, 0x2203),
|
||||
MAKE_VIDPID(0x2e24, 0x0652),
|
||||
MAKE_VIDPID(0x2e24, 0x1618),
|
||||
MAKE_VIDPID(0x2e24, 0x1688),
|
||||
MAKE_VIDPID(0x2f24, 0x0011),
|
||||
MAKE_VIDPID(0x2f24, 0x002e),
|
||||
MAKE_VIDPID(0x2f24, 0x0050),
|
||||
MAKE_VIDPID(0x2f24, 0x0053),
|
||||
MAKE_VIDPID(0x2f24, 0x008f),
|
||||
MAKE_VIDPID(0x2f24, 0x0091),
|
||||
MAKE_VIDPID(0x2f24, 0x00b7),
|
||||
MAKE_VIDPID(0xd2d2, 0xd2d2),
|
||||
};
|
||||
|
||||
EControllerType GuessControllerType( int nVID, int nPID )
|
||||
{
|
||||
if (vendor_id == USB_VENDOR_MICROSOFT) {
|
||||
if (product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_1 ||
|
||||
product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2 ||
|
||||
product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2_BLUETOOTH ||
|
||||
product_id == USB_PRODUCT_XBOX_ONE_ELITE_SERIES_2_BLE) {
|
||||
return SDL_TRUE;
|
||||
unsigned int unDeviceID = MAKE_CONTROLLER_ID( nVID, nPID );
|
||||
int iIndex;
|
||||
|
||||
for ( iIndex = 0; iIndex < sizeof( arrControllers ) / sizeof( arrControllers[0] ); ++iIndex )
|
||||
{
|
||||
if ( unDeviceID == arrControllers[ iIndex ].m_unDeviceID )
|
||||
{
|
||||
return arrControllers[ iIndex ].m_eControllerType;
|
||||
}
|
||||
}
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
SDL_bool SDL_IsJoystickXboxSeriesX(Uint16 vendor_id, Uint16 product_id)
|
||||
{
|
||||
if (vendor_id == USB_VENDOR_MICROSOFT) {
|
||||
if (product_id == USB_PRODUCT_XBOX_SERIES_X ||
|
||||
product_id == USB_PRODUCT_XBOX_SERIES_X_BLE) {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
}
|
||||
if (vendor_id == USB_VENDOR_PDP) {
|
||||
if (product_id == USB_PRODUCT_XBOX_SERIES_X_VICTRIX_GAMBIT ||
|
||||
product_id == USB_PRODUCT_XBOX_SERIES_X_PDP_BLUE ||
|
||||
product_id == USB_PRODUCT_XBOX_SERIES_X_PDP_AFTERGLOW) {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
}
|
||||
if (vendor_id == USB_VENDOR_POWERA_ALT) {
|
||||
if ((product_id >= 0x2001 && product_id <= 0x201a) ||
|
||||
product_id == USB_PRODUCT_XBOX_SERIES_X_POWERA_FUSION_PRO2 ||
|
||||
product_id == USB_PRODUCT_XBOX_SERIES_X_POWERA_MOGA_XP_ULTRA ||
|
||||
product_id == USB_PRODUCT_XBOX_SERIES_X_POWERA_SPECTRA) {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
}
|
||||
if (vendor_id == USB_VENDOR_HORI) {
|
||||
if (product_id == USB_PRODUCT_HORI_FIGHTING_COMMANDER_OCTA_SERIES_X ||
|
||||
product_id == USB_PRODUCT_HORI_HORIPAD_PRO_SERIES_X) {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
}
|
||||
if (vendor_id == USB_VENDOR_RAZER) {
|
||||
if (product_id == USB_PRODUCT_RAZER_WOLVERINE_V2 ||
|
||||
product_id == USB_PRODUCT_RAZER_WOLVERINE_V2_CHROMA) {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
}
|
||||
if (vendor_id == USB_VENDOR_THRUSTMASTER) {
|
||||
if (product_id == USB_PRODUCT_THRUSTMASTER_ESWAPX_PRO) {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
}
|
||||
if (vendor_id == USB_VENDOR_TURTLE_BEACH) {
|
||||
if (product_id == USB_PRODUCT_TURTLE_BEACH_SERIES_X_REACT_R ||
|
||||
product_id == USB_PRODUCT_TURTLE_BEACH_SERIES_X_RECON) {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
}
|
||||
if (vendor_id == USB_VENDOR_8BITDO) {
|
||||
if (product_id == USB_PRODUCT_8BITDO_XBOX_CONTROLLER) {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
}
|
||||
if (vendor_id == USB_VENDOR_GAMESIR) {
|
||||
if (product_id == USB_PRODUCT_GAMESIR_G7) {
|
||||
return SDL_TRUE;
|
||||
}
|
||||
}
|
||||
return SDL_FALSE;
|
||||
return k_eControllerType_UnknownNonSteamController;
|
||||
}
|
||||
|
||||
SDL_bool SDL_IsJoystickDualSenseEdge(Uint16 vendor_id, Uint16 product_id)
|
||||
bool SDL_IsJoystickXboxOne(Uint16 vendor_id, Uint16 product_id)
|
||||
{
|
||||
if (vendor_id == USB_VENDOR_SONY) {
|
||||
if (product_id == USB_PRODUCT_SONY_DS5_EDGE) {
|
||||
return SDL_TRUE;
|
||||
EControllerType eType = GuessControllerType(vendor_id, product_id);
|
||||
return eType == k_eControllerType_XBoxOneController ||
|
||||
eType == k_eControllerType_XBoxEliteController;
|
||||
}
|
||||
|
||||
bool SDL_IsJoystickXboxOneElite(Uint16 vendor_id, Uint16 product_id)
|
||||
{
|
||||
EControllerType eType = GuessControllerType(vendor_id, product_id);
|
||||
return eType == k_eControllerType_XBoxEliteController;
|
||||
}
|
||||
|
||||
bool SDL_IsJoystickXboxSeriesX(Uint16 vendor_id, Uint16 product_id)
|
||||
{
|
||||
if (!SDL_IsJoystickXboxOne(vendor_id, product_id)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Most new controllers have the share button, so we'll default to true and
|
||||
// have a list of older XBox One controllers that are known not to have it.
|
||||
Uint32 vidpid = MAKE_VIDPID(vendor_id, product_id);
|
||||
for (int i = 0; i < (sizeof(initial_old_xboxone_controllers) / sizeof(*initial_old_xboxone_controllers)); i++) {
|
||||
if (vidpid == initial_old_xboxone_controllers[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return SDL_FALSE;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDL_IsJoystickDualSenseEdge(Uint16 vendor_id, Uint16 product_id)
|
||||
{
|
||||
EControllerType eType = GuessControllerType(vendor_id, product_id);
|
||||
return eType == k_eControllerType_PS5EdgeController;
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
typedef int SDL_bool;
|
||||
#define SDL_TRUE 1
|
||||
#define SDL_FALSE 0
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef unsigned short Uint16;
|
||||
typedef uint16_t Uint16;
|
||||
typedef uint32_t Uint32;
|
||||
|
||||
SDL_bool SDL_IsJoystickXboxOneElite(Uint16 vendor_id, Uint16 product_id);
|
||||
SDL_bool SDL_IsJoystickXboxSeriesX(Uint16 vendor_id, Uint16 product_id);
|
||||
SDL_bool SDL_IsJoystickDualSenseEdge(Uint16 vendor_id, Uint16 product_id);
|
||||
bool SDL_IsJoystickXboxOneElite(Uint16 vendor_id, Uint16 product_id);
|
||||
bool SDL_IsJoystickXboxSeriesX(Uint16 vendor_id, Uint16 product_id);
|
||||
bool SDL_IsJoystickDualSenseEdge(Uint16 vendor_id, Uint16 product_id);
|
||||
Submodule app/src/main/jni/moonlight-core/moonlight-common-c updated: 5de4a5b85a...874ac9548f.
@@ -1,11 +1,5 @@
|
||||
LOCAL_PATH:= $(call my-dir)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE:= libssl
|
||||
LOCAL_SRC_FILES:= $(TARGET_ARCH_ABI)/libssl.a
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include
|
||||
include $(PREBUILT_STATIC_LIBRARY)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE:= libcrypto
|
||||
LOCAL_SRC_FILES:= $(TARGET_ARCH_ABI)/libcrypto.a
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
/*
|
||||
* Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2002-2026 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_AES_H
|
||||
#ifndef OPENSSL_AES_H
|
||||
#define OPENSSL_AES_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_AES_H
|
||||
#endif
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
|
||||
@@ -17,15 +23,14 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define AES_BLOCK_SIZE 16
|
||||
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
|
||||
#define AES_ENCRYPT 1
|
||||
#define AES_DECRYPT 0
|
||||
|
||||
/*
|
||||
* Because array size can't be a const in C, the following two are macros.
|
||||
* Both sizes are in bytes.
|
||||
*/
|
||||
#define AES_MAXNR 14
|
||||
# define AES_BLOCK_SIZE 16
|
||||
|
||||
/* This should be a hidden type, but EVP requires that the size be known */
|
||||
struct aes_key_st {
|
||||
@@ -38,52 +43,64 @@ struct aes_key_st {
|
||||
};
|
||||
typedef struct aes_key_st AES_KEY;
|
||||
|
||||
const char *AES_options(void);
|
||||
|
||||
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 const char *AES_options(void);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int AES_set_encrypt_key(const unsigned char *userKey, int bits,
|
||||
AES_KEY *key);
|
||||
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int AES_set_decrypt_key(const unsigned char *userKey, int bits,
|
||||
AES_KEY *key);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_decrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const AES_KEY *key, const int enc);
|
||||
const AES_KEY *key, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, const int enc);
|
||||
unsigned char *ivec, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
unsigned char *ivec, int *num, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
unsigned char *ivec, int *num, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
unsigned char *ivec, int *num, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, int *num);
|
||||
|
||||
/* NB: the IV is _two_ blocks long */
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
unsigned char *ivec, const int enc);
|
||||
unsigned char *ivec, int enc);
|
||||
/* NB: the IV is _four_ blocks long */
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const AES_KEY *key,
|
||||
const AES_KEY *key2, const unsigned char *ivec,
|
||||
const int enc);
|
||||
|
||||
size_t length, const AES_KEY *key, const AES_KEY *key2,
|
||||
const unsigned char *ivec, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int AES_wrap_key(AES_KEY *key, const unsigned char *iv,
|
||||
unsigned char *out,
|
||||
const unsigned char *in, unsigned int inlen);
|
||||
unsigned char *out, const unsigned char *in,
|
||||
unsigned int inlen);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int AES_unwrap_key(AES_KEY *key, const unsigned char *iv,
|
||||
unsigned char *out,
|
||||
const unsigned char *in, unsigned int inlen);
|
||||
|
||||
unsigned char *out, const unsigned char *in,
|
||||
unsigned int inlen);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,15 +1,31 @@
|
||||
/*
|
||||
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/asn1.h.in
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_ASN1_H
|
||||
# define HEADER_ASN1_H
|
||||
/* clang-format off */
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#ifndef OPENSSL_ASN1_H
|
||||
#define OPENSSL_ASN1_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_ASN1_H
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_STDIO
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#include <time.h>
|
||||
#include <openssl/e_os2.h>
|
||||
#include <openssl/opensslconf.h>
|
||||
@@ -18,10 +34,8 @@
|
||||
#include <openssl/asn1err.h>
|
||||
#include <openssl/symhacks.h>
|
||||
|
||||
# include <openssl/ossl_typ.h>
|
||||
# if OPENSSL_API_COMPAT < 0x10100000L
|
||||
#include <openssl/types.h>
|
||||
#include <openssl/bn.h>
|
||||
# endif
|
||||
|
||||
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
|
||||
#undef OPENSSL_EXTERN
|
||||
@@ -48,7 +62,7 @@ extern "C" {
|
||||
#define V_ASN1_UNDEF -1
|
||||
/* ASN.1 tag values */
|
||||
#define V_ASN1_EOC 0
|
||||
# define V_ASN1_BOOLEAN 1 /**/
|
||||
#define V_ASN1_BOOLEAN 1
|
||||
#define V_ASN1_INTEGER 2
|
||||
#define V_ASN1_BIT_STRING 3
|
||||
#define V_ASN1_OCTET_STRING 4
|
||||
@@ -61,19 +75,19 @@ extern "C" {
|
||||
#define V_ASN1_UTF8STRING 12
|
||||
#define V_ASN1_SEQUENCE 16
|
||||
#define V_ASN1_SET 17
|
||||
# define V_ASN1_NUMERICSTRING 18 /**/
|
||||
#define V_ASN1_NUMERICSTRING 18
|
||||
#define V_ASN1_PRINTABLESTRING 19
|
||||
#define V_ASN1_T61STRING 20
|
||||
#define V_ASN1_TELETEXSTRING 20 /* alias */
|
||||
# define V_ASN1_VIDEOTEXSTRING 21 /**/
|
||||
#define V_ASN1_VIDEOTEXSTRING 21
|
||||
#define V_ASN1_IA5STRING 22
|
||||
#define V_ASN1_UTCTIME 23
|
||||
# define V_ASN1_GENERALIZEDTIME 24 /**/
|
||||
# define V_ASN1_GRAPHICSTRING 25 /**/
|
||||
# define V_ASN1_ISO64STRING 26 /**/
|
||||
#define V_ASN1_GENERALIZEDTIME 24
|
||||
#define V_ASN1_GRAPHICSTRING 25
|
||||
#define V_ASN1_ISO64STRING 26
|
||||
#define V_ASN1_VISIBLESTRING 26 /* alias */
|
||||
# define V_ASN1_GENERALSTRING 27 /**/
|
||||
# define V_ASN1_UNIVERSALSTRING 28 /**/
|
||||
#define V_ASN1_GENERALSTRING 27
|
||||
#define V_ASN1_UNIVERSALSTRING 28
|
||||
#define V_ASN1_BMPSTRING 30
|
||||
|
||||
/*
|
||||
@@ -115,45 +129,40 @@ extern "C" {
|
||||
#define SMIME_OLDMIME 0x400
|
||||
#define SMIME_CRLFEOL 0x800
|
||||
#define SMIME_STREAM 0x1000
|
||||
struct X509_algor_st;
|
||||
DEFINE_STACK_OF(X509_ALGOR)
|
||||
|
||||
# define ASN1_STRING_FLAG_BITS_LEFT 0x08/* Set if 0x07 has bits left value */
|
||||
/*
|
||||
* This indicates that the ASN1_STRING is not a real value but just a place
|
||||
* holder for the location where indefinite length constructed data should be
|
||||
* inserted in the memory buffer
|
||||
*/
|
||||
# define ASN1_STRING_FLAG_NDEF 0x010
|
||||
/* Stacks for types not otherwise defined in this header */
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(X509_ALGOR, X509_ALGOR, X509_ALGOR)
|
||||
#define sk_X509_ALGOR_num(sk) OPENSSL_sk_num(ossl_check_const_X509_ALGOR_sk_type(sk))
|
||||
#define sk_X509_ALGOR_value(sk, idx) ((X509_ALGOR *)OPENSSL_sk_value(ossl_check_const_X509_ALGOR_sk_type(sk), (idx)))
|
||||
#define sk_X509_ALGOR_new(cmp) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_X509_ALGOR_compfunc_type(cmp)), sk_X509_ALGOR_cmpfunc_thunk))
|
||||
#define sk_X509_ALGOR_new_null() ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_X509_ALGOR_freefunc_thunk))
|
||||
#define sk_X509_ALGOR_new_reserve(cmp, n) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_X509_ALGOR_compfunc_type(cmp), (n)), sk_X509_ALGOR_cmpfunc_thunk))
|
||||
#define sk_X509_ALGOR_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_ALGOR_sk_type(sk), (n))
|
||||
#define sk_X509_ALGOR_free(sk) OPENSSL_sk_free(ossl_check_X509_ALGOR_sk_type(sk))
|
||||
#define sk_X509_ALGOR_zero(sk) OPENSSL_sk_zero(ossl_check_X509_ALGOR_sk_type(sk))
|
||||
#define sk_X509_ALGOR_delete(sk, i) ((X509_ALGOR *)OPENSSL_sk_delete(ossl_check_X509_ALGOR_sk_type(sk), (i)))
|
||||
#define sk_X509_ALGOR_delete_ptr(sk, ptr) ((X509_ALGOR *)OPENSSL_sk_delete_ptr(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr)))
|
||||
#define sk_X509_ALGOR_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr))
|
||||
#define sk_X509_ALGOR_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr))
|
||||
#define sk_X509_ALGOR_pop(sk) ((X509_ALGOR *)OPENSSL_sk_pop(ossl_check_X509_ALGOR_sk_type(sk)))
|
||||
#define sk_X509_ALGOR_shift(sk) ((X509_ALGOR *)OPENSSL_sk_shift(ossl_check_X509_ALGOR_sk_type(sk)))
|
||||
#define sk_X509_ALGOR_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_freefunc_type(freefunc))
|
||||
#define sk_X509_ALGOR_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr), (idx))
|
||||
#define sk_X509_ALGOR_set(sk, idx, ptr) ((X509_ALGOR *)OPENSSL_sk_set(ossl_check_X509_ALGOR_sk_type(sk), (idx), ossl_check_X509_ALGOR_type(ptr)))
|
||||
#define sk_X509_ALGOR_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr))
|
||||
#define sk_X509_ALGOR_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr))
|
||||
#define sk_X509_ALGOR_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr), pnum)
|
||||
#define sk_X509_ALGOR_sort(sk) OPENSSL_sk_sort(ossl_check_X509_ALGOR_sk_type(sk))
|
||||
#define sk_X509_ALGOR_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_ALGOR_sk_type(sk))
|
||||
#define sk_X509_ALGOR_dup(sk) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_dup(ossl_check_const_X509_ALGOR_sk_type(sk)))
|
||||
#define sk_X509_ALGOR_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_copyfunc_type(copyfunc), ossl_check_X509_ALGOR_freefunc_type(freefunc)))
|
||||
#define sk_X509_ALGOR_set_cmp_func(sk, cmp) ((sk_X509_ALGOR_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_compfunc_type(cmp)))
|
||||
|
||||
/*
|
||||
* This flag is used by the CMS code to indicate that a string is not
|
||||
* complete and is a place holder for content when it had all been accessed.
|
||||
* The flag will be reset when content has been written to it.
|
||||
*/
|
||||
/* clang-format on */
|
||||
|
||||
# define ASN1_STRING_FLAG_CONT 0x020
|
||||
/*
|
||||
* This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING
|
||||
* type.
|
||||
*/
|
||||
# define ASN1_STRING_FLAG_MSTRING 0x040
|
||||
/* String is embedded and only content should be freed */
|
||||
# define ASN1_STRING_FLAG_EMBED 0x080
|
||||
/* String should be parsed in RFC 5280's time format */
|
||||
# define ASN1_STRING_FLAG_X509_TIME 0x100
|
||||
/* This is the base type that holds just about everything :-) */
|
||||
struct asn1_string_st {
|
||||
int length;
|
||||
int type;
|
||||
unsigned char *data;
|
||||
/*
|
||||
* The value of the following field depends on the type being held. It
|
||||
* is mostly being used for BIT_STRING so if the input data has a
|
||||
* non-zero 'unused bits' value, it will be handled correctly
|
||||
*/
|
||||
long flags;
|
||||
};
|
||||
struct asn1_string_st;
|
||||
|
||||
/*
|
||||
* ASN1_ENCODING structure: this is used to save the received encoding of an
|
||||
@@ -183,17 +192,45 @@ typedef struct ASN1_ENCODING_st {
|
||||
(B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING)
|
||||
#define PKCS9STRING_TYPE (DIRSTRING_TYPE | B_ASN1_IA5STRING)
|
||||
|
||||
typedef struct asn1_string_table_st {
|
||||
struct asn1_string_table_st {
|
||||
int nid;
|
||||
long minsize;
|
||||
long maxsize;
|
||||
unsigned long mask;
|
||||
unsigned long flags;
|
||||
} ASN1_STRING_TABLE;
|
||||
};
|
||||
|
||||
DEFINE_STACK_OF(ASN1_STRING_TABLE)
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_STRING_TABLE, ASN1_STRING_TABLE, ASN1_STRING_TABLE)
|
||||
#define sk_ASN1_STRING_TABLE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk))
|
||||
#define sk_ASN1_STRING_TABLE_value(sk, idx) ((ASN1_STRING_TABLE *)OPENSSL_sk_value(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk), (idx)))
|
||||
#define sk_ASN1_STRING_TABLE_new(cmp) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_ASN1_STRING_TABLE_compfunc_type(cmp)), sk_ASN1_STRING_TABLE_cmpfunc_thunk))
|
||||
#define sk_ASN1_STRING_TABLE_new_null() ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_ASN1_STRING_TABLE_freefunc_thunk))
|
||||
#define sk_ASN1_STRING_TABLE_new_reserve(cmp, n) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_ASN1_STRING_TABLE_compfunc_type(cmp), (n)), sk_ASN1_STRING_TABLE_cmpfunc_thunk))
|
||||
#define sk_ASN1_STRING_TABLE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_STRING_TABLE_sk_type(sk), (n))
|
||||
#define sk_ASN1_STRING_TABLE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_STRING_TABLE_sk_type(sk))
|
||||
#define sk_ASN1_STRING_TABLE_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_STRING_TABLE_sk_type(sk))
|
||||
#define sk_ASN1_STRING_TABLE_delete(sk, i) ((ASN1_STRING_TABLE *)OPENSSL_sk_delete(ossl_check_ASN1_STRING_TABLE_sk_type(sk), (i)))
|
||||
#define sk_ASN1_STRING_TABLE_delete_ptr(sk, ptr) ((ASN1_STRING_TABLE *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr)))
|
||||
#define sk_ASN1_STRING_TABLE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr))
|
||||
#define sk_ASN1_STRING_TABLE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr))
|
||||
#define sk_ASN1_STRING_TABLE_pop(sk) ((ASN1_STRING_TABLE *)OPENSSL_sk_pop(ossl_check_ASN1_STRING_TABLE_sk_type(sk)))
|
||||
#define sk_ASN1_STRING_TABLE_shift(sk) ((ASN1_STRING_TABLE *)OPENSSL_sk_shift(ossl_check_ASN1_STRING_TABLE_sk_type(sk)))
|
||||
#define sk_ASN1_STRING_TABLE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_freefunc_type(freefunc))
|
||||
#define sk_ASN1_STRING_TABLE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr), (idx))
|
||||
#define sk_ASN1_STRING_TABLE_set(sk, idx, ptr) ((ASN1_STRING_TABLE *)OPENSSL_sk_set(ossl_check_ASN1_STRING_TABLE_sk_type(sk), (idx), ossl_check_ASN1_STRING_TABLE_type(ptr)))
|
||||
#define sk_ASN1_STRING_TABLE_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr))
|
||||
#define sk_ASN1_STRING_TABLE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr))
|
||||
#define sk_ASN1_STRING_TABLE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr), pnum)
|
||||
#define sk_ASN1_STRING_TABLE_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_STRING_TABLE_sk_type(sk))
|
||||
#define sk_ASN1_STRING_TABLE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk))
|
||||
#define sk_ASN1_STRING_TABLE_dup(sk) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_dup(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk)))
|
||||
#define sk_ASN1_STRING_TABLE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_copyfunc_type(copyfunc), ossl_check_ASN1_STRING_TABLE_freefunc_type(freefunc)))
|
||||
#define sk_ASN1_STRING_TABLE_set_cmp_func(sk, cmp) ((sk_ASN1_STRING_TABLE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_compfunc_type(cmp)))
|
||||
|
||||
/* size limits: this stuff is taken straight from RFC2459 */
|
||||
/* clang-format on */
|
||||
|
||||
/* size limits: this stuff is taken straight from RFC 5280 */
|
||||
|
||||
#define ub_name 32768
|
||||
#define ub_common_name 64
|
||||
@@ -212,52 +249,81 @@ typedef struct ASN1_TLC_st ASN1_TLC;
|
||||
/* This is just an opaque pointer */
|
||||
typedef struct ASN1_VALUE_st ASN1_VALUE;
|
||||
|
||||
/* Declare ASN1 functions: the implement macro in in asn1t.h */
|
||||
/* Declare ASN1 functions: the implement macro is in asn1t.h */
|
||||
|
||||
# define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type)
|
||||
/*
|
||||
* The mysterious 'extern' that's passed to some macros is innocuous,
|
||||
* and is there to quiet pre-C99 compilers that may complain about empty
|
||||
* arguments in macro calls.
|
||||
*/
|
||||
|
||||
#define DECLARE_ASN1_FUNCTIONS_attr(attr, type) \
|
||||
DECLARE_ASN1_FUNCTIONS_name_attr(attr, type, type)
|
||||
#define DECLARE_ASN1_FUNCTIONS(type) \
|
||||
DECLARE_ASN1_FUNCTIONS_attr(extern, type)
|
||||
|
||||
#define DECLARE_ASN1_ALLOC_FUNCTIONS_attr(attr, type) \
|
||||
DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(attr, type, type)
|
||||
#define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \
|
||||
DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type)
|
||||
DECLARE_ASN1_ALLOC_FUNCTIONS_attr(extern, type)
|
||||
|
||||
#define DECLARE_ASN1_FUNCTIONS_name_attr(attr, type, name) \
|
||||
DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(attr, type, name) \
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(attr, type, name)
|
||||
#define DECLARE_ASN1_FUNCTIONS_name(type, name) \
|
||||
DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name)
|
||||
|
||||
# define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \
|
||||
DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
|
||||
DECLARE_ASN1_FUNCTIONS_name_attr(extern, type, name)
|
||||
|
||||
#define DECLARE_ASN1_ENCODE_FUNCTIONS_attr(attr, type, itname, name) \
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(attr, type, name) \
|
||||
DECLARE_ASN1_ITEM_attr(attr, itname)
|
||||
#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
|
||||
type *d2i_##name(type **a, const unsigned char **in, long len); \
|
||||
int i2d_##name(type *a, unsigned char **out); \
|
||||
DECLARE_ASN1_ITEM(itname)
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_attr(extern, type, itname, name)
|
||||
|
||||
# define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
|
||||
type *d2i_##name(type **a, const unsigned char **in, long len); \
|
||||
int i2d_##name(const type *a, unsigned char **out); \
|
||||
DECLARE_ASN1_ITEM(name)
|
||||
#define DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(attr, type, name) \
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_attr(attr, type, name, name)
|
||||
#define DECLARE_ASN1_ENCODE_FUNCTIONS_name(type, name) \
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(extern, type, name)
|
||||
|
||||
#define DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(attr, type, name) \
|
||||
attr type *d2i_##name(type **a, const unsigned char **in, long len); \
|
||||
attr int i2d_##name(const type *a, unsigned char **out);
|
||||
#define DECLARE_ASN1_ENCODE_FUNCTIONS_only(type, name) \
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(extern, type, name)
|
||||
|
||||
#define DECLARE_ASN1_NDEF_FUNCTION_attr(attr, name) \
|
||||
attr int i2d_##name##_NDEF(const name *a, unsigned char **out);
|
||||
#define DECLARE_ASN1_NDEF_FUNCTION(name) \
|
||||
int i2d_##name##_NDEF(name *a, unsigned char **out);
|
||||
|
||||
# define DECLARE_ASN1_FUNCTIONS_const(name) \
|
||||
DECLARE_ASN1_ALLOC_FUNCTIONS(name) \
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name)
|
||||
DECLARE_ASN1_NDEF_FUNCTION_attr(extern, name)
|
||||
|
||||
#define DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(attr, type, name) \
|
||||
attr type *name##_new(void); \
|
||||
attr void name##_free(type *a);
|
||||
#define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
|
||||
type *name##_new(void); \
|
||||
void name##_free(type *a);
|
||||
DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(extern, type, name)
|
||||
|
||||
#define DECLARE_ASN1_DUP_FUNCTION_attr(attr, type) \
|
||||
DECLARE_ASN1_DUP_FUNCTION_name_attr(attr, type, type)
|
||||
#define DECLARE_ASN1_DUP_FUNCTION(type) \
|
||||
DECLARE_ASN1_DUP_FUNCTION_attr(extern, type)
|
||||
|
||||
#define DECLARE_ASN1_DUP_FUNCTION_name_attr(attr, type, name) \
|
||||
attr type *name##_dup(const type *a);
|
||||
#define DECLARE_ASN1_DUP_FUNCTION_name(type, name) \
|
||||
DECLARE_ASN1_DUP_FUNCTION_name_attr(extern, type, name)
|
||||
|
||||
#define DECLARE_ASN1_PRINT_FUNCTION_attr(attr, stname) \
|
||||
DECLARE_ASN1_PRINT_FUNCTION_fname_attr(attr, stname, stname)
|
||||
#define DECLARE_ASN1_PRINT_FUNCTION(stname) \
|
||||
DECLARE_ASN1_PRINT_FUNCTION_fname(stname, stname)
|
||||
DECLARE_ASN1_PRINT_FUNCTION_attr(extern, stname)
|
||||
|
||||
# define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \
|
||||
int fname##_print_ctx(BIO *out, stname *x, int indent, \
|
||||
#define DECLARE_ASN1_PRINT_FUNCTION_fname_attr(attr, stname, fname) \
|
||||
attr int fname##_print_ctx(BIO *out, const stname *x, int indent, \
|
||||
const ASN1_PCTX *pctx);
|
||||
#define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \
|
||||
DECLARE_ASN1_PRINT_FUNCTION_fname_attr(extern, stname, fname)
|
||||
|
||||
#define D2I_OF(type) type *(*)(type **, const unsigned char **, long)
|
||||
# define I2D_OF(type) int (*)(type *,unsigned char **)
|
||||
# define I2D_OF_const(type) int (*)(const type *,unsigned char **)
|
||||
#define I2D_OF(type) int (*)(const type *, unsigned char **)
|
||||
|
||||
#define CHECKED_D2I_OF(type, d2i) \
|
||||
((d2i_of_void *)(1 ? d2i : ((D2I_OF(type))0)))
|
||||
@@ -271,10 +337,14 @@ typedef struct ASN1_VALUE_st ASN1_VALUE;
|
||||
((void **)(1 ? p : (type **)0))
|
||||
|
||||
#define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **, const unsigned char **, long)
|
||||
# define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **)
|
||||
# define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type)
|
||||
#define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(const type *, unsigned char **)
|
||||
#define TYPEDEF_D2I2D_OF(type) \
|
||||
TYPEDEF_D2I_OF(type); \
|
||||
TYPEDEF_I2D_OF(type)
|
||||
|
||||
TYPEDEF_D2I2D_OF(void);
|
||||
typedef void *d2i_of_void(void **, const unsigned char **, long);
|
||||
typedef int i2d_of_void(const void *, unsigned char **);
|
||||
typedef int OSSL_i2d_of_void_ctx(const void *, unsigned char **, void *vctx);
|
||||
|
||||
/*-
|
||||
* The following macros and typedefs allow an ASN1_ITEM
|
||||
@@ -312,24 +382,6 @@ TYPEDEF_D2I2D_OF(void);
|
||||
*
|
||||
*/
|
||||
|
||||
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
|
||||
/* ASN1_ITEM pointer exported type */
|
||||
typedef const ASN1_ITEM ASN1_ITEM_EXP;
|
||||
|
||||
/* Macro to obtain ASN1_ITEM pointer from exported type */
|
||||
# define ASN1_ITEM_ptr(iptr) (iptr)
|
||||
|
||||
/* Macro to include ASN1_ITEM pointer from base type */
|
||||
# define ASN1_ITEM_ref(iptr) (&(iptr##_it))
|
||||
|
||||
# define ASN1_ITEM_rptr(ref) (&(ref##_it))
|
||||
|
||||
# define DECLARE_ASN1_ITEM(name) \
|
||||
OPENSSL_EXTERN const ASN1_ITEM name##_it;
|
||||
|
||||
# else
|
||||
|
||||
/*
|
||||
* Platforms that can't easily handle shared global variables are declared as
|
||||
* functions returning ASN1_ITEM pointers.
|
||||
@@ -346,10 +398,10 @@ typedef const ASN1_ITEM *ASN1_ITEM_EXP (void);
|
||||
|
||||
#define ASN1_ITEM_rptr(ref) (ref##_it())
|
||||
|
||||
#define DECLARE_ASN1_ITEM_attr(attr, name) \
|
||||
attr const ASN1_ITEM *name##_it(void);
|
||||
#define DECLARE_ASN1_ITEM(name) \
|
||||
const ASN1_ITEM * name##_it(void);
|
||||
|
||||
# endif
|
||||
DECLARE_ASN1_ITEM_attr(extern, name)
|
||||
|
||||
/* Parameters used by ASN1_STRING_print_ex() */
|
||||
|
||||
@@ -362,6 +414,11 @@ typedef const ASN1_ITEM *ASN1_ITEM_EXP (void);
|
||||
#define ASN1_STRFLGS_ESC_CTRL 2
|
||||
#define ASN1_STRFLGS_ESC_MSB 4
|
||||
|
||||
/* Lower 8 bits are reserved as an output type specifier */
|
||||
#define ASN1_DTFLGS_TYPE_MASK 0x0FUL
|
||||
#define ASN1_DTFLGS_RFC822 0x00UL
|
||||
#define ASN1_DTFLGS_ISO8601 0x01UL
|
||||
|
||||
/*
|
||||
* This flag determines how we do escaping: normally RC2253 backslash only,
|
||||
* set this to use backslash and quote.
|
||||
@@ -428,20 +485,9 @@ typedef const ASN1_ITEM *ASN1_ITEM_EXP (void);
|
||||
* isn't essential in RFC2253 but it is advisable anyway.
|
||||
*/
|
||||
|
||||
# define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \
|
||||
ASN1_STRFLGS_ESC_CTRL | \
|
||||
ASN1_STRFLGS_ESC_MSB | \
|
||||
ASN1_STRFLGS_UTF8_CONVERT | \
|
||||
ASN1_STRFLGS_DUMP_UNKNOWN | \
|
||||
ASN1_STRFLGS_DUMP_DER)
|
||||
#define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB | ASN1_STRFLGS_UTF8_CONVERT | ASN1_STRFLGS_DUMP_UNKNOWN | ASN1_STRFLGS_DUMP_DER)
|
||||
|
||||
DEFINE_STACK_OF(ASN1_INTEGER)
|
||||
|
||||
DEFINE_STACK_OF(ASN1_GENERALSTRING)
|
||||
|
||||
DEFINE_STACK_OF(ASN1_UTF8STRING)
|
||||
|
||||
typedef struct asn1_type_st {
|
||||
struct asn1_type_st {
|
||||
int type;
|
||||
union {
|
||||
char *ptr;
|
||||
@@ -470,14 +516,42 @@ typedef struct asn1_type_st {
|
||||
ASN1_STRING *sequence;
|
||||
ASN1_VALUE *asn1_value;
|
||||
} value;
|
||||
} ASN1_TYPE;
|
||||
};
|
||||
|
||||
DEFINE_STACK_OF(ASN1_TYPE)
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_TYPE, ASN1_TYPE, ASN1_TYPE)
|
||||
#define sk_ASN1_TYPE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_TYPE_sk_type(sk))
|
||||
#define sk_ASN1_TYPE_value(sk, idx) ((ASN1_TYPE *)OPENSSL_sk_value(ossl_check_const_ASN1_TYPE_sk_type(sk), (idx)))
|
||||
#define sk_ASN1_TYPE_new(cmp) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_ASN1_TYPE_compfunc_type(cmp)), sk_ASN1_TYPE_cmpfunc_thunk))
|
||||
#define sk_ASN1_TYPE_new_null() ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_ASN1_TYPE_freefunc_thunk))
|
||||
#define sk_ASN1_TYPE_new_reserve(cmp, n) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_ASN1_TYPE_compfunc_type(cmp), (n)), sk_ASN1_TYPE_cmpfunc_thunk))
|
||||
#define sk_ASN1_TYPE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_TYPE_sk_type(sk), (n))
|
||||
#define sk_ASN1_TYPE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_TYPE_sk_type(sk))
|
||||
#define sk_ASN1_TYPE_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_TYPE_sk_type(sk))
|
||||
#define sk_ASN1_TYPE_delete(sk, i) ((ASN1_TYPE *)OPENSSL_sk_delete(ossl_check_ASN1_TYPE_sk_type(sk), (i)))
|
||||
#define sk_ASN1_TYPE_delete_ptr(sk, ptr) ((ASN1_TYPE *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr)))
|
||||
#define sk_ASN1_TYPE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr))
|
||||
#define sk_ASN1_TYPE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr))
|
||||
#define sk_ASN1_TYPE_pop(sk) ((ASN1_TYPE *)OPENSSL_sk_pop(ossl_check_ASN1_TYPE_sk_type(sk)))
|
||||
#define sk_ASN1_TYPE_shift(sk) ((ASN1_TYPE *)OPENSSL_sk_shift(ossl_check_ASN1_TYPE_sk_type(sk)))
|
||||
#define sk_ASN1_TYPE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_freefunc_type(freefunc))
|
||||
#define sk_ASN1_TYPE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr), (idx))
|
||||
#define sk_ASN1_TYPE_set(sk, idx, ptr) ((ASN1_TYPE *)OPENSSL_sk_set(ossl_check_ASN1_TYPE_sk_type(sk), (idx), ossl_check_ASN1_TYPE_type(ptr)))
|
||||
#define sk_ASN1_TYPE_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr))
|
||||
#define sk_ASN1_TYPE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr))
|
||||
#define sk_ASN1_TYPE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr), pnum)
|
||||
#define sk_ASN1_TYPE_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_TYPE_sk_type(sk))
|
||||
#define sk_ASN1_TYPE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_TYPE_sk_type(sk))
|
||||
#define sk_ASN1_TYPE_dup(sk) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_dup(ossl_check_const_ASN1_TYPE_sk_type(sk)))
|
||||
#define sk_ASN1_TYPE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_copyfunc_type(copyfunc), ossl_check_ASN1_TYPE_freefunc_type(freefunc)))
|
||||
#define sk_ASN1_TYPE_set_cmp_func(sk, cmp) ((sk_ASN1_TYPE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY;
|
||||
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY)
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SET_ANY)
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_name(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY)
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_name(ASN1_SEQUENCE_ANY, ASN1_SET_ANY)
|
||||
|
||||
/* This is used to contain a list of bit names */
|
||||
typedef struct BIT_STRING_BITNAME_st {
|
||||
@@ -487,35 +561,19 @@ typedef struct BIT_STRING_BITNAME_st {
|
||||
} BIT_STRING_BITNAME;
|
||||
|
||||
#define B_ASN1_TIME \
|
||||
B_ASN1_UTCTIME | \
|
||||
B_ASN1_GENERALIZEDTIME
|
||||
B_ASN1_UTCTIME | B_ASN1_GENERALIZEDTIME
|
||||
|
||||
#define B_ASN1_PRINTABLE \
|
||||
B_ASN1_NUMERICSTRING| \
|
||||
B_ASN1_PRINTABLESTRING| \
|
||||
B_ASN1_T61STRING| \
|
||||
B_ASN1_IA5STRING| \
|
||||
B_ASN1_BIT_STRING| \
|
||||
B_ASN1_UNIVERSALSTRING|\
|
||||
B_ASN1_BMPSTRING|\
|
||||
B_ASN1_UTF8STRING|\
|
||||
B_ASN1_SEQUENCE|\
|
||||
B_ASN1_UNKNOWN
|
||||
B_ASN1_NUMERICSTRING | B_ASN1_PRINTABLESTRING | B_ASN1_T61STRING | B_ASN1_IA5STRING | B_ASN1_BIT_STRING | B_ASN1_UNIVERSALSTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING | B_ASN1_SEQUENCE | B_ASN1_UNKNOWN
|
||||
|
||||
#define B_ASN1_DIRECTORYSTRING \
|
||||
B_ASN1_PRINTABLESTRING| \
|
||||
B_ASN1_TELETEXSTRING|\
|
||||
B_ASN1_BMPSTRING|\
|
||||
B_ASN1_UNIVERSALSTRING|\
|
||||
B_ASN1_UTF8STRING
|
||||
B_ASN1_PRINTABLESTRING | B_ASN1_TELETEXSTRING | B_ASN1_BMPSTRING | B_ASN1_UNIVERSALSTRING | B_ASN1_UTF8STRING
|
||||
|
||||
#define B_ASN1_DISPLAYTEXT \
|
||||
B_ASN1_IA5STRING| \
|
||||
B_ASN1_VISIBLESTRING| \
|
||||
B_ASN1_BMPSTRING|\
|
||||
B_ASN1_UTF8STRING
|
||||
B_ASN1_IA5STRING | B_ASN1_VISIBLESTRING | B_ASN1_BMPSTRING | B_ASN1_UTF8STRING
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
|
||||
DECLARE_ASN1_ALLOC_FUNCTIONS_name(ASN1_TYPE, ASN1_TYPE)
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
|
||||
|
||||
int ASN1_TYPE_get(const ASN1_TYPE *a);
|
||||
void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
|
||||
@@ -525,21 +583,47 @@ int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b);
|
||||
ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t);
|
||||
void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t);
|
||||
|
||||
ASN1_OBJECT *ASN1_OBJECT_new(void);
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_OBJECT, ASN1_OBJECT, ASN1_OBJECT)
|
||||
#define sk_ASN1_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_OBJECT_sk_type(sk))
|
||||
#define sk_ASN1_OBJECT_value(sk, idx) ((ASN1_OBJECT *)OPENSSL_sk_value(ossl_check_const_ASN1_OBJECT_sk_type(sk), (idx)))
|
||||
#define sk_ASN1_OBJECT_new(cmp) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_ASN1_OBJECT_compfunc_type(cmp)), sk_ASN1_OBJECT_cmpfunc_thunk))
|
||||
#define sk_ASN1_OBJECT_new_null() ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_ASN1_OBJECT_freefunc_thunk))
|
||||
#define sk_ASN1_OBJECT_new_reserve(cmp, n) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_ASN1_OBJECT_compfunc_type(cmp), (n)), sk_ASN1_OBJECT_cmpfunc_thunk))
|
||||
#define sk_ASN1_OBJECT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_OBJECT_sk_type(sk), (n))
|
||||
#define sk_ASN1_OBJECT_free(sk) OPENSSL_sk_free(ossl_check_ASN1_OBJECT_sk_type(sk))
|
||||
#define sk_ASN1_OBJECT_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_OBJECT_sk_type(sk))
|
||||
#define sk_ASN1_OBJECT_delete(sk, i) ((ASN1_OBJECT *)OPENSSL_sk_delete(ossl_check_ASN1_OBJECT_sk_type(sk), (i)))
|
||||
#define sk_ASN1_OBJECT_delete_ptr(sk, ptr) ((ASN1_OBJECT *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr)))
|
||||
#define sk_ASN1_OBJECT_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr))
|
||||
#define sk_ASN1_OBJECT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr))
|
||||
#define sk_ASN1_OBJECT_pop(sk) ((ASN1_OBJECT *)OPENSSL_sk_pop(ossl_check_ASN1_OBJECT_sk_type(sk)))
|
||||
#define sk_ASN1_OBJECT_shift(sk) ((ASN1_OBJECT *)OPENSSL_sk_shift(ossl_check_ASN1_OBJECT_sk_type(sk)))
|
||||
#define sk_ASN1_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_freefunc_type(freefunc))
|
||||
#define sk_ASN1_OBJECT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr), (idx))
|
||||
#define sk_ASN1_OBJECT_set(sk, idx, ptr) ((ASN1_OBJECT *)OPENSSL_sk_set(ossl_check_ASN1_OBJECT_sk_type(sk), (idx), ossl_check_ASN1_OBJECT_type(ptr)))
|
||||
#define sk_ASN1_OBJECT_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr))
|
||||
#define sk_ASN1_OBJECT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr))
|
||||
#define sk_ASN1_OBJECT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr), pnum)
|
||||
#define sk_ASN1_OBJECT_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_OBJECT_sk_type(sk))
|
||||
#define sk_ASN1_OBJECT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_OBJECT_sk_type(sk))
|
||||
#define sk_ASN1_OBJECT_dup(sk) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_dup(ossl_check_const_ASN1_OBJECT_sk_type(sk)))
|
||||
#define sk_ASN1_OBJECT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_copyfunc_type(copyfunc), ossl_check_ASN1_OBJECT_freefunc_type(freefunc)))
|
||||
#define sk_ASN1_OBJECT_set_cmp_func(sk, cmp) ((sk_ASN1_OBJECT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#ifndef OPENSSL_NO_DEPRECATED_4_0
|
||||
OSSL_DEPRECATEDIN_4_0 ASN1_OBJECT *ASN1_OBJECT_new(void);
|
||||
#endif /* OPENSSL_NO_DEPRECATED_4_0 */
|
||||
void ASN1_OBJECT_free(ASN1_OBJECT *a);
|
||||
int i2d_ASN1_OBJECT(const ASN1_OBJECT *a, unsigned char **pp);
|
||||
ASN1_OBJECT *d2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp,
|
||||
long length);
|
||||
|
||||
DECLARE_ASN1_ITEM(ASN1_OBJECT)
|
||||
|
||||
DEFINE_STACK_OF(ASN1_OBJECT)
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(extern, ASN1_OBJECT, ASN1_OBJECT)
|
||||
|
||||
ASN1_STRING *ASN1_STRING_new(void);
|
||||
void ASN1_STRING_free(ASN1_STRING *a);
|
||||
void ASN1_STRING_clear_free(ASN1_STRING *a);
|
||||
int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str);
|
||||
ASN1_STRING *ASN1_STRING_dup(const ASN1_STRING *a);
|
||||
DECLARE_ASN1_DUP_FUNCTION(ASN1_STRING)
|
||||
ASN1_STRING *ASN1_STRING_type_new(int type);
|
||||
int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b);
|
||||
/*
|
||||
@@ -549,9 +633,10 @@ int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b);
|
||||
int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
|
||||
void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len);
|
||||
int ASN1_STRING_length(const ASN1_STRING *x);
|
||||
void ASN1_STRING_length_set(ASN1_STRING *x, int n);
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 void ASN1_STRING_length_set(ASN1_STRING *x, int n);
|
||||
#endif
|
||||
int ASN1_STRING_type(const ASN1_STRING *x);
|
||||
DEPRECATEDIN_1_1_0(unsigned char *ASN1_STRING_data(ASN1_STRING *x))
|
||||
const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x);
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING)
|
||||
@@ -566,11 +651,45 @@ int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
|
||||
int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl);
|
||||
int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value,
|
||||
BIT_STRING_BITNAME *tbl);
|
||||
int ASN1_BIT_STRING_get_length(const ASN1_BIT_STRING *abs, size_t *length,
|
||||
int *unused_bits);
|
||||
int ASN1_BIT_STRING_set1(ASN1_BIT_STRING *abs, const uint8_t *data,
|
||||
size_t length, int unused_bits);
|
||||
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_INTEGER, ASN1_INTEGER, ASN1_INTEGER)
|
||||
#define sk_ASN1_INTEGER_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_INTEGER_sk_type(sk))
|
||||
#define sk_ASN1_INTEGER_value(sk, idx) ((ASN1_INTEGER *)OPENSSL_sk_value(ossl_check_const_ASN1_INTEGER_sk_type(sk), (idx)))
|
||||
#define sk_ASN1_INTEGER_new(cmp) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_ASN1_INTEGER_compfunc_type(cmp)), sk_ASN1_INTEGER_cmpfunc_thunk))
|
||||
#define sk_ASN1_INTEGER_new_null() ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_ASN1_INTEGER_freefunc_thunk))
|
||||
#define sk_ASN1_INTEGER_new_reserve(cmp, n) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_ASN1_INTEGER_compfunc_type(cmp), (n)), sk_ASN1_INTEGER_cmpfunc_thunk))
|
||||
#define sk_ASN1_INTEGER_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_INTEGER_sk_type(sk), (n))
|
||||
#define sk_ASN1_INTEGER_free(sk) OPENSSL_sk_free(ossl_check_ASN1_INTEGER_sk_type(sk))
|
||||
#define sk_ASN1_INTEGER_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_INTEGER_sk_type(sk))
|
||||
#define sk_ASN1_INTEGER_delete(sk, i) ((ASN1_INTEGER *)OPENSSL_sk_delete(ossl_check_ASN1_INTEGER_sk_type(sk), (i)))
|
||||
#define sk_ASN1_INTEGER_delete_ptr(sk, ptr) ((ASN1_INTEGER *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr)))
|
||||
#define sk_ASN1_INTEGER_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr))
|
||||
#define sk_ASN1_INTEGER_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr))
|
||||
#define sk_ASN1_INTEGER_pop(sk) ((ASN1_INTEGER *)OPENSSL_sk_pop(ossl_check_ASN1_INTEGER_sk_type(sk)))
|
||||
#define sk_ASN1_INTEGER_shift(sk) ((ASN1_INTEGER *)OPENSSL_sk_shift(ossl_check_ASN1_INTEGER_sk_type(sk)))
|
||||
#define sk_ASN1_INTEGER_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_freefunc_type(freefunc))
|
||||
#define sk_ASN1_INTEGER_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr), (idx))
|
||||
#define sk_ASN1_INTEGER_set(sk, idx, ptr) ((ASN1_INTEGER *)OPENSSL_sk_set(ossl_check_ASN1_INTEGER_sk_type(sk), (idx), ossl_check_ASN1_INTEGER_type(ptr)))
|
||||
#define sk_ASN1_INTEGER_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr))
|
||||
#define sk_ASN1_INTEGER_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr))
|
||||
#define sk_ASN1_INTEGER_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr), pnum)
|
||||
#define sk_ASN1_INTEGER_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_INTEGER_sk_type(sk))
|
||||
#define sk_ASN1_INTEGER_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_INTEGER_sk_type(sk))
|
||||
#define sk_ASN1_INTEGER_dup(sk) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_dup(ossl_check_const_ASN1_INTEGER_sk_type(sk)))
|
||||
#define sk_ASN1_INTEGER_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_copyfunc_type(copyfunc), ossl_check_ASN1_INTEGER_freefunc_type(freefunc)))
|
||||
#define sk_ASN1_INTEGER_set_cmp_func(sk, cmp) ((sk_ASN1_INTEGER_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER)
|
||||
ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
|
||||
long length);
|
||||
ASN1_INTEGER *ASN1_INTEGER_dup(const ASN1_INTEGER *x);
|
||||
DECLARE_ASN1_DUP_FUNCTION(ASN1_INTEGER)
|
||||
int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y);
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED)
|
||||
@@ -594,12 +713,42 @@ int ASN1_TIME_diff(int *pday, int *psec,
|
||||
const ASN1_TIME *from, const ASN1_TIME *to);
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING)
|
||||
ASN1_OCTET_STRING *ASN1_OCTET_STRING_dup(const ASN1_OCTET_STRING *a);
|
||||
DECLARE_ASN1_DUP_FUNCTION(ASN1_OCTET_STRING)
|
||||
int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a,
|
||||
const ASN1_OCTET_STRING *b);
|
||||
int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data,
|
||||
int len);
|
||||
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_UTF8STRING, ASN1_UTF8STRING, ASN1_UTF8STRING)
|
||||
#define sk_ASN1_UTF8STRING_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_UTF8STRING_sk_type(sk))
|
||||
#define sk_ASN1_UTF8STRING_value(sk, idx) ((ASN1_UTF8STRING *)OPENSSL_sk_value(ossl_check_const_ASN1_UTF8STRING_sk_type(sk), (idx)))
|
||||
#define sk_ASN1_UTF8STRING_new(cmp) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_ASN1_UTF8STRING_compfunc_type(cmp)), sk_ASN1_UTF8STRING_cmpfunc_thunk))
|
||||
#define sk_ASN1_UTF8STRING_new_null() ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_ASN1_UTF8STRING_freefunc_thunk))
|
||||
#define sk_ASN1_UTF8STRING_new_reserve(cmp, n) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_ASN1_UTF8STRING_compfunc_type(cmp), (n)), sk_ASN1_UTF8STRING_cmpfunc_thunk))
|
||||
#define sk_ASN1_UTF8STRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_UTF8STRING_sk_type(sk), (n))
|
||||
#define sk_ASN1_UTF8STRING_free(sk) OPENSSL_sk_free(ossl_check_ASN1_UTF8STRING_sk_type(sk))
|
||||
#define sk_ASN1_UTF8STRING_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_UTF8STRING_sk_type(sk))
|
||||
#define sk_ASN1_UTF8STRING_delete(sk, i) ((ASN1_UTF8STRING *)OPENSSL_sk_delete(ossl_check_ASN1_UTF8STRING_sk_type(sk), (i)))
|
||||
#define sk_ASN1_UTF8STRING_delete_ptr(sk, ptr) ((ASN1_UTF8STRING *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr)))
|
||||
#define sk_ASN1_UTF8STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))
|
||||
#define sk_ASN1_UTF8STRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))
|
||||
#define sk_ASN1_UTF8STRING_pop(sk) ((ASN1_UTF8STRING *)OPENSSL_sk_pop(ossl_check_ASN1_UTF8STRING_sk_type(sk)))
|
||||
#define sk_ASN1_UTF8STRING_shift(sk) ((ASN1_UTF8STRING *)OPENSSL_sk_shift(ossl_check_ASN1_UTF8STRING_sk_type(sk)))
|
||||
#define sk_ASN1_UTF8STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_freefunc_type(freefunc))
|
||||
#define sk_ASN1_UTF8STRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr), (idx))
|
||||
#define sk_ASN1_UTF8STRING_set(sk, idx, ptr) ((ASN1_UTF8STRING *)OPENSSL_sk_set(ossl_check_ASN1_UTF8STRING_sk_type(sk), (idx), ossl_check_ASN1_UTF8STRING_type(ptr)))
|
||||
#define sk_ASN1_UTF8STRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))
|
||||
#define sk_ASN1_UTF8STRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))
|
||||
#define sk_ASN1_UTF8STRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr), pnum)
|
||||
#define sk_ASN1_UTF8STRING_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_UTF8STRING_sk_type(sk))
|
||||
#define sk_ASN1_UTF8STRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_UTF8STRING_sk_type(sk))
|
||||
#define sk_ASN1_UTF8STRING_dup(sk) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_dup(ossl_check_const_ASN1_UTF8STRING_sk_type(sk)))
|
||||
#define sk_ASN1_UTF8STRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_copyfunc_type(copyfunc), ossl_check_ASN1_UTF8STRING_freefunc_type(freefunc)))
|
||||
#define sk_ASN1_UTF8STRING_set_cmp_func(sk, cmp) ((sk_ASN1_UTF8STRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING)
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING)
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING)
|
||||
@@ -609,6 +758,36 @@ DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING)
|
||||
int UTF8_getc(const unsigned char *str, int len, unsigned long *val);
|
||||
int UTF8_putc(unsigned char *str, int len, unsigned long value);
|
||||
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_GENERALSTRING, ASN1_GENERALSTRING, ASN1_GENERALSTRING)
|
||||
#define sk_ASN1_GENERALSTRING_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk))
|
||||
#define sk_ASN1_GENERALSTRING_value(sk, idx) ((ASN1_GENERALSTRING *)OPENSSL_sk_value(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk), (idx)))
|
||||
#define sk_ASN1_GENERALSTRING_new(cmp) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_ASN1_GENERALSTRING_compfunc_type(cmp)), sk_ASN1_GENERALSTRING_cmpfunc_thunk))
|
||||
#define sk_ASN1_GENERALSTRING_new_null() ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_ASN1_GENERALSTRING_freefunc_thunk))
|
||||
#define sk_ASN1_GENERALSTRING_new_reserve(cmp, n) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_ASN1_GENERALSTRING_compfunc_type(cmp), (n)), sk_ASN1_GENERALSTRING_cmpfunc_thunk))
|
||||
#define sk_ASN1_GENERALSTRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_GENERALSTRING_sk_type(sk), (n))
|
||||
#define sk_ASN1_GENERALSTRING_free(sk) OPENSSL_sk_free(ossl_check_ASN1_GENERALSTRING_sk_type(sk))
|
||||
#define sk_ASN1_GENERALSTRING_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_GENERALSTRING_sk_type(sk))
|
||||
#define sk_ASN1_GENERALSTRING_delete(sk, i) ((ASN1_GENERALSTRING *)OPENSSL_sk_delete(ossl_check_ASN1_GENERALSTRING_sk_type(sk), (i)))
|
||||
#define sk_ASN1_GENERALSTRING_delete_ptr(sk, ptr) ((ASN1_GENERALSTRING *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr)))
|
||||
#define sk_ASN1_GENERALSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr))
|
||||
#define sk_ASN1_GENERALSTRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr))
|
||||
#define sk_ASN1_GENERALSTRING_pop(sk) ((ASN1_GENERALSTRING *)OPENSSL_sk_pop(ossl_check_ASN1_GENERALSTRING_sk_type(sk)))
|
||||
#define sk_ASN1_GENERALSTRING_shift(sk) ((ASN1_GENERALSTRING *)OPENSSL_sk_shift(ossl_check_ASN1_GENERALSTRING_sk_type(sk)))
|
||||
#define sk_ASN1_GENERALSTRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_freefunc_type(freefunc))
|
||||
#define sk_ASN1_GENERALSTRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr), (idx))
|
||||
#define sk_ASN1_GENERALSTRING_set(sk, idx, ptr) ((ASN1_GENERALSTRING *)OPENSSL_sk_set(ossl_check_ASN1_GENERALSTRING_sk_type(sk), (idx), ossl_check_ASN1_GENERALSTRING_type(ptr)))
|
||||
#define sk_ASN1_GENERALSTRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr))
|
||||
#define sk_ASN1_GENERALSTRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr))
|
||||
#define sk_ASN1_GENERALSTRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr), pnum)
|
||||
#define sk_ASN1_GENERALSTRING_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_GENERALSTRING_sk_type(sk))
|
||||
#define sk_ASN1_GENERALSTRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk))
|
||||
#define sk_ASN1_GENERALSTRING_dup(sk) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_dup(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk)))
|
||||
#define sk_ASN1_GENERALSTRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_copyfunc_type(copyfunc), ossl_check_ASN1_GENERALSTRING_freefunc_type(freefunc)))
|
||||
#define sk_ASN1_GENERALSTRING_set_cmp_func(sk, cmp) ((sk_ASN1_GENERALSTRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE)
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING)
|
||||
@@ -621,6 +800,10 @@ DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME)
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME)
|
||||
DECLARE_ASN1_FUNCTIONS(ASN1_TIME)
|
||||
|
||||
DECLARE_ASN1_DUP_FUNCTION(ASN1_TIME)
|
||||
DECLARE_ASN1_DUP_FUNCTION(ASN1_UTCTIME)
|
||||
DECLARE_ASN1_DUP_FUNCTION(ASN1_GENERALIZEDTIME)
|
||||
|
||||
DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF)
|
||||
|
||||
ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t);
|
||||
@@ -662,7 +845,6 @@ BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn);
|
||||
int ASN1_ENUMERATED_get_int64(int64_t *pr, const ASN1_ENUMERATED *a);
|
||||
int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *a, int64_t r);
|
||||
|
||||
|
||||
int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);
|
||||
long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a);
|
||||
ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai);
|
||||
@@ -685,19 +867,23 @@ int ASN1_put_eoc(unsigned char **pp);
|
||||
int ASN1_object_size(int constructed, int length, int tag);
|
||||
|
||||
/* Used to implement other functions */
|
||||
void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, void *x);
|
||||
void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, const void *x);
|
||||
|
||||
#define ASN1_dup_of(type, i2d, d2i, x) \
|
||||
((type *)ASN1_dup(CHECKED_I2D_OF(type, i2d), \
|
||||
CHECKED_D2I_OF(type, d2i), \
|
||||
CHECKED_PTR_OF(type, x)))
|
||||
|
||||
# define ASN1_dup_of_const(type,i2d,d2i,x) \
|
||||
((type*)ASN1_dup(CHECKED_I2D_OF(const type, i2d), \
|
||||
CHECKED_D2I_OF(type, d2i), \
|
||||
CHECKED_PTR_OF(const type, x)))
|
||||
|
||||
void *ASN1_item_dup(const ASN1_ITEM *it, void *x);
|
||||
void *ASN1_item_dup(const ASN1_ITEM *it, const void *x);
|
||||
int ASN1_item_sign_ex(const ASN1_ITEM *it, X509_ALGOR *algor1,
|
||||
X509_ALGOR *algor2, ASN1_BIT_STRING *signature,
|
||||
const void *data, const ASN1_OCTET_STRING *id,
|
||||
EVP_PKEY *pkey, const EVP_MD *md, OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
int ASN1_item_verify_ex(const ASN1_ITEM *it, const X509_ALGOR *alg,
|
||||
const ASN1_BIT_STRING *signature, const void *data,
|
||||
const ASN1_OCTET_STRING *id, EVP_PKEY *pkey,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
/* ASN1 alloc/free macros for when a type is only used internally */
|
||||
|
||||
@@ -714,20 +900,17 @@ void *ASN1_d2i_fp(void *(*xnew) (void), d2i_of_void *d2i, FILE *in, void **x);
|
||||
in, \
|
||||
CHECKED_PPTR_OF(type, x)))
|
||||
|
||||
void *ASN1_item_d2i_fp_ex(const ASN1_ITEM *it, FILE *in, void *x,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x);
|
||||
int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, void *x);
|
||||
int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, const void *x);
|
||||
|
||||
#define ASN1_i2d_fp_of(type, i2d, out, x) \
|
||||
(ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \
|
||||
out, \
|
||||
CHECKED_PTR_OF(type, x)))
|
||||
|
||||
# define ASN1_i2d_fp_of_const(type,i2d,out,x) \
|
||||
(ASN1_i2d_fp(CHECKED_I2D_OF(const type, i2d), \
|
||||
out, \
|
||||
CHECKED_PTR_OF(const type, x)))
|
||||
|
||||
int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x);
|
||||
int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, const void *x);
|
||||
int ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str, unsigned long flags);
|
||||
#endif
|
||||
|
||||
@@ -741,23 +924,22 @@ void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x);
|
||||
in, \
|
||||
CHECKED_PPTR_OF(type, x)))
|
||||
|
||||
void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x);
|
||||
int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, unsigned char *x);
|
||||
void *ASN1_item_d2i_bio_ex(const ASN1_ITEM *it, BIO *in, void *pval,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *pval);
|
||||
int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, const void *x);
|
||||
|
||||
#define ASN1_i2d_bio_of(type, i2d, out, x) \
|
||||
(ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \
|
||||
out, \
|
||||
CHECKED_PTR_OF(type, x)))
|
||||
|
||||
# define ASN1_i2d_bio_of_const(type,i2d,out,x) \
|
||||
(ASN1_i2d_bio(CHECKED_I2D_OF(const type, i2d), \
|
||||
out, \
|
||||
CHECKED_PTR_OF(const type, x)))
|
||||
|
||||
int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x);
|
||||
int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, const void *x);
|
||||
BIO *ASN1_item_i2d_mem_bio(const ASN1_ITEM *it, const ASN1_VALUE *val);
|
||||
int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a);
|
||||
int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a);
|
||||
int ASN1_TIME_print(BIO *fp, const ASN1_TIME *a);
|
||||
int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm);
|
||||
int ASN1_TIME_print_ex(BIO *bp, const ASN1_TIME *tm, unsigned long flags);
|
||||
int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v);
|
||||
int ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags);
|
||||
int ASN1_buf_print(BIO *bp, const unsigned char *buf, size_t buflen, int off);
|
||||
@@ -780,6 +962,8 @@ int ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *a, long *num,
|
||||
unsigned char *data, int max_len);
|
||||
|
||||
void *ASN1_item_unpack(const ASN1_STRING *oct, const ASN1_ITEM *it);
|
||||
void *ASN1_item_unpack_ex(const ASN1_STRING *oct, const ASN1_ITEM *it,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it,
|
||||
ASN1_OCTET_STRING **oct);
|
||||
@@ -804,11 +988,16 @@ void ASN1_STRING_TABLE_cleanup(void);
|
||||
|
||||
/* Old API compatible functions */
|
||||
ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it);
|
||||
ASN1_VALUE *ASN1_item_new_ex(const ASN1_ITEM *it, OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it);
|
||||
ASN1_VALUE *ASN1_item_d2i_ex(ASN1_VALUE **val, const unsigned char **in,
|
||||
long len, const ASN1_ITEM *it,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in,
|
||||
long len, const ASN1_ITEM *it);
|
||||
int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
|
||||
int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out,
|
||||
int ASN1_item_i2d(const ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
|
||||
int ASN1_item_ndef_i2d(const ASN1_VALUE *val, unsigned char **out,
|
||||
const ASN1_ITEM *it);
|
||||
|
||||
void ASN1_add_oid_module(void);
|
||||
@@ -839,7 +1028,7 @@ int ASN1_str2mask(const char *str, unsigned long *pmask);
|
||||
/* Don't show structure name even at top level */
|
||||
#define ASN1_PCTX_FLAGS_NO_STRUCT_NAME 0x100
|
||||
|
||||
int ASN1_item_print(BIO *out, ASN1_VALUE *ifld, int indent,
|
||||
int ASN1_item_print(BIO *out, const ASN1_VALUE *ifld, int indent,
|
||||
const ASN1_ITEM *it, const ASN1_PCTX *pctx);
|
||||
ASN1_PCTX *ASN1_PCTX_new(void);
|
||||
void ASN1_PCTX_free(ASN1_PCTX *p);
|
||||
@@ -864,22 +1053,43 @@ void *ASN1_SCTX_get_app_data(ASN1_SCTX *p);
|
||||
|
||||
const BIO_METHOD *BIO_f_asn1(void);
|
||||
|
||||
/* cannot constify val because of CMS_stream() */
|
||||
BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it);
|
||||
|
||||
int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
|
||||
const ASN1_ITEM *it);
|
||||
int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags,
|
||||
const char *hdr, const ASN1_ITEM *it);
|
||||
/* cannot constify val because of CMS_dataFinal() */
|
||||
int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
|
||||
int ctype_nid, int econt_nid,
|
||||
STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it);
|
||||
int SMIME_write_ASN1_ex(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
|
||||
int ctype_nid, int econt_nid,
|
||||
STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it);
|
||||
ASN1_VALUE *SMIME_read_ASN1_ex(BIO *bio, int flags, BIO **bcont,
|
||||
const ASN1_ITEM *it, ASN1_VALUE **x,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
int SMIME_crlf_copy(BIO *in, BIO *out, int flags);
|
||||
int SMIME_text(BIO *in, BIO *out);
|
||||
|
||||
const ASN1_ITEM *ASN1_ITEM_lookup(const char *name);
|
||||
const ASN1_ITEM *ASN1_ITEM_get(size_t i);
|
||||
|
||||
/* Legacy compatibility */
|
||||
#define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \
|
||||
DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
|
||||
#define DECLARE_ASN1_FUNCTIONS_const(type) DECLARE_ASN1_FUNCTIONS(type)
|
||||
#define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS(type, name)
|
||||
#define I2D_OF_const(type) I2D_OF(type)
|
||||
#define ASN1_dup_of_const(type, i2d, d2i, x) ASN1_dup_of(type, i2d, d2i, x)
|
||||
#define ASN1_i2d_fp_of_const(type, i2d, out, x) ASN1_i2d_fp_of(type, i2d, out, x)
|
||||
#define ASN1_i2d_bio_of_const(type, i2d, out, x) ASN1_i2d_bio_of(type, i2d, out, x)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#error "This file is obsolete; please update your software."
|
||||
@@ -1,140 +1,20 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_ASN1ERR_H
|
||||
# define HEADER_ASN1ERR_H
|
||||
#ifndef OPENSSL_ASN1ERR_H
|
||||
#define OPENSSL_ASN1ERR_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/symhacks.h>
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
int ERR_load_ASN1_strings(void);
|
||||
|
||||
/*
|
||||
* ASN1 function codes.
|
||||
*/
|
||||
# define ASN1_F_A2D_ASN1_OBJECT 100
|
||||
# define ASN1_F_A2I_ASN1_INTEGER 102
|
||||
# define ASN1_F_A2I_ASN1_STRING 103
|
||||
# define ASN1_F_APPEND_EXP 176
|
||||
# define ASN1_F_ASN1_BIO_INIT 113
|
||||
# define ASN1_F_ASN1_BIT_STRING_SET_BIT 183
|
||||
# define ASN1_F_ASN1_CB 177
|
||||
# define ASN1_F_ASN1_CHECK_TLEN 104
|
||||
# define ASN1_F_ASN1_COLLECT 106
|
||||
# define ASN1_F_ASN1_D2I_EX_PRIMITIVE 108
|
||||
# define ASN1_F_ASN1_D2I_FP 109
|
||||
# define ASN1_F_ASN1_D2I_READ_BIO 107
|
||||
# define ASN1_F_ASN1_DIGEST 184
|
||||
# define ASN1_F_ASN1_DO_ADB 110
|
||||
# define ASN1_F_ASN1_DO_LOCK 233
|
||||
# define ASN1_F_ASN1_DUP 111
|
||||
# define ASN1_F_ASN1_ENC_SAVE 115
|
||||
# define ASN1_F_ASN1_EX_C2I 204
|
||||
# define ASN1_F_ASN1_FIND_END 190
|
||||
# define ASN1_F_ASN1_GENERALIZEDTIME_ADJ 216
|
||||
# define ASN1_F_ASN1_GENERATE_V3 178
|
||||
# define ASN1_F_ASN1_GET_INT64 224
|
||||
# define ASN1_F_ASN1_GET_OBJECT 114
|
||||
# define ASN1_F_ASN1_GET_UINT64 225
|
||||
# define ASN1_F_ASN1_I2D_BIO 116
|
||||
# define ASN1_F_ASN1_I2D_FP 117
|
||||
# define ASN1_F_ASN1_ITEM_D2I_FP 206
|
||||
# define ASN1_F_ASN1_ITEM_DUP 191
|
||||
# define ASN1_F_ASN1_ITEM_EMBED_D2I 120
|
||||
# define ASN1_F_ASN1_ITEM_EMBED_NEW 121
|
||||
# define ASN1_F_ASN1_ITEM_EX_I2D 144
|
||||
# define ASN1_F_ASN1_ITEM_FLAGS_I2D 118
|
||||
# define ASN1_F_ASN1_ITEM_I2D_BIO 192
|
||||
# define ASN1_F_ASN1_ITEM_I2D_FP 193
|
||||
# define ASN1_F_ASN1_ITEM_PACK 198
|
||||
# define ASN1_F_ASN1_ITEM_SIGN 195
|
||||
# define ASN1_F_ASN1_ITEM_SIGN_CTX 220
|
||||
# define ASN1_F_ASN1_ITEM_UNPACK 199
|
||||
# define ASN1_F_ASN1_ITEM_VERIFY 197
|
||||
# define ASN1_F_ASN1_MBSTRING_NCOPY 122
|
||||
# define ASN1_F_ASN1_OBJECT_NEW 123
|
||||
# define ASN1_F_ASN1_OUTPUT_DATA 214
|
||||
# define ASN1_F_ASN1_PCTX_NEW 205
|
||||
# define ASN1_F_ASN1_PRIMITIVE_NEW 119
|
||||
# define ASN1_F_ASN1_SCTX_NEW 221
|
||||
# define ASN1_F_ASN1_SIGN 128
|
||||
# define ASN1_F_ASN1_STR2TYPE 179
|
||||
# define ASN1_F_ASN1_STRING_GET_INT64 227
|
||||
# define ASN1_F_ASN1_STRING_GET_UINT64 230
|
||||
# define ASN1_F_ASN1_STRING_SET 186
|
||||
# define ASN1_F_ASN1_STRING_TABLE_ADD 129
|
||||
# define ASN1_F_ASN1_STRING_TO_BN 228
|
||||
# define ASN1_F_ASN1_STRING_TYPE_NEW 130
|
||||
# define ASN1_F_ASN1_TEMPLATE_EX_D2I 132
|
||||
# define ASN1_F_ASN1_TEMPLATE_NEW 133
|
||||
# define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I 131
|
||||
# define ASN1_F_ASN1_TIME_ADJ 217
|
||||
# define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 134
|
||||
# define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 135
|
||||
# define ASN1_F_ASN1_UTCTIME_ADJ 218
|
||||
# define ASN1_F_ASN1_VERIFY 137
|
||||
# define ASN1_F_B64_READ_ASN1 209
|
||||
# define ASN1_F_B64_WRITE_ASN1 210
|
||||
# define ASN1_F_BIO_NEW_NDEF 208
|
||||
# define ASN1_F_BITSTR_CB 180
|
||||
# define ASN1_F_BN_TO_ASN1_STRING 229
|
||||
# define ASN1_F_C2I_ASN1_BIT_STRING 189
|
||||
# define ASN1_F_C2I_ASN1_INTEGER 194
|
||||
# define ASN1_F_C2I_ASN1_OBJECT 196
|
||||
# define ASN1_F_C2I_IBUF 226
|
||||
# define ASN1_F_C2I_UINT64_INT 101
|
||||
# define ASN1_F_COLLECT_DATA 140
|
||||
# define ASN1_F_D2I_ASN1_OBJECT 147
|
||||
# define ASN1_F_D2I_ASN1_UINTEGER 150
|
||||
# define ASN1_F_D2I_AUTOPRIVATEKEY 207
|
||||
# define ASN1_F_D2I_PRIVATEKEY 154
|
||||
# define ASN1_F_D2I_PUBLICKEY 155
|
||||
# define ASN1_F_DO_BUF 142
|
||||
# define ASN1_F_DO_CREATE 124
|
||||
# define ASN1_F_DO_DUMP 125
|
||||
# define ASN1_F_DO_TCREATE 222
|
||||
# define ASN1_F_I2A_ASN1_OBJECT 126
|
||||
# define ASN1_F_I2D_ASN1_BIO_STREAM 211
|
||||
# define ASN1_F_I2D_ASN1_OBJECT 143
|
||||
# define ASN1_F_I2D_DSA_PUBKEY 161
|
||||
# define ASN1_F_I2D_EC_PUBKEY 181
|
||||
# define ASN1_F_I2D_PRIVATEKEY 163
|
||||
# define ASN1_F_I2D_PUBLICKEY 164
|
||||
# define ASN1_F_I2D_RSA_PUBKEY 165
|
||||
# define ASN1_F_LONG_C2I 166
|
||||
# define ASN1_F_NDEF_PREFIX 127
|
||||
# define ASN1_F_NDEF_SUFFIX 136
|
||||
# define ASN1_F_OID_MODULE_INIT 174
|
||||
# define ASN1_F_PARSE_TAGGING 182
|
||||
# define ASN1_F_PKCS5_PBE2_SET_IV 167
|
||||
# define ASN1_F_PKCS5_PBE2_SET_SCRYPT 231
|
||||
# define ASN1_F_PKCS5_PBE_SET 202
|
||||
# define ASN1_F_PKCS5_PBE_SET0_ALGOR 215
|
||||
# define ASN1_F_PKCS5_PBKDF2_SET 219
|
||||
# define ASN1_F_PKCS5_SCRYPT_SET 232
|
||||
# define ASN1_F_SMIME_READ_ASN1 212
|
||||
# define ASN1_F_SMIME_TEXT 213
|
||||
# define ASN1_F_STABLE_GET 138
|
||||
# define ASN1_F_STBL_MODULE_INIT 223
|
||||
# define ASN1_F_UINT32_C2I 105
|
||||
# define ASN1_F_UINT32_NEW 139
|
||||
# define ASN1_F_UINT64_C2I 112
|
||||
# define ASN1_F_UINT64_NEW 141
|
||||
# define ASN1_F_X509_CRL_ADD0_REVOKED 169
|
||||
# define ASN1_F_X509_INFO_NEW 170
|
||||
# define ASN1_F_X509_NAME_ENCODE 203
|
||||
# define ASN1_F_X509_NAME_EX_D2I 158
|
||||
# define ASN1_F_X509_NAME_EX_NEW 171
|
||||
# define ASN1_F_X509_PKEY_NEW 173
|
||||
#include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
/*
|
||||
* ASN1 reason codes.
|
||||
@@ -165,6 +45,7 @@ int ERR_load_ASN1_strings(void);
|
||||
#define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120
|
||||
#define ASN1_R_FIELD_MISSING 121
|
||||
#define ASN1_R_FIRST_NUM_TOO_LARGE 122
|
||||
#define ASN1_R_GENERALIZEDTIME_IS_TOO_SHORT 232
|
||||
#define ASN1_R_HEADER_TOO_LONG 123
|
||||
#define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175
|
||||
#define ASN1_R_ILLEGAL_BOOLEAN 176
|
||||
@@ -199,6 +80,7 @@ int ERR_load_ASN1_strings(void);
|
||||
#define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133
|
||||
#define ASN1_R_INVALID_UTF8STRING 134
|
||||
#define ASN1_R_INVALID_VALUE 219
|
||||
#define ASN1_R_LENGTH_TOO_LONG 231
|
||||
#define ASN1_R_LIST_ERROR 188
|
||||
#define ASN1_R_MIME_NO_CONTENT_TYPE 206
|
||||
#define ASN1_R_MIME_PARSE_ERROR 207
|
||||
@@ -239,6 +121,7 @@ int ERR_load_ASN1_strings(void);
|
||||
#define ASN1_R_TYPE_NOT_PRIMITIVE 195
|
||||
#define ASN1_R_UNEXPECTED_EOC 159
|
||||
#define ASN1_R_UNIVERSALSTRING_IS_WRONG_LENGTH 215
|
||||
#define ASN1_R_UNKNOWN_DIGEST 229
|
||||
#define ASN1_R_UNKNOWN_FORMAT 160
|
||||
#define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161
|
||||
#define ASN1_R_UNKNOWN_OBJECT_TYPE 162
|
||||
@@ -249,6 +132,7 @@ int ERR_load_ASN1_strings(void);
|
||||
#define ASN1_R_UNSUPPORTED_CIPHER 228
|
||||
#define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167
|
||||
#define ASN1_R_UNSUPPORTED_TYPE 196
|
||||
#define ASN1_R_UTCTIME_IS_TOO_SHORT 233
|
||||
#define ASN1_R_WRONG_INTEGER_TYPE 225
|
||||
#define ASN1_R_WRONG_PUBLIC_KEY_TYPE 200
|
||||
#define ASN1_R_WRONG_TAG 168
|
||||
|
||||
@@ -1,14 +1,27 @@
|
||||
/*
|
||||
* Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/asn1t.h.in
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_ASN1T_H
|
||||
/* clang-format off */
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#ifndef OPENSSL_ASN1T_H
|
||||
#define OPENSSL_ASN1T_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_ASN1T_H
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <openssl/e_os2.h>
|
||||
@@ -25,23 +38,54 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
/*-
|
||||
* These are the possible values for the itype field of the
|
||||
* ASN1_ITEM structure and determine how it is interpreted.
|
||||
*
|
||||
* For PRIMITIVE types the underlying type
|
||||
* determines the behaviour if items is NULL.
|
||||
*
|
||||
* Otherwise templates must contain a single
|
||||
* template and the type is treated in the
|
||||
* same way as the type specified in the template.
|
||||
*
|
||||
* For SEQUENCE types the templates field points
|
||||
* to the members, the size field is the
|
||||
* structure size.
|
||||
*
|
||||
* For CHOICE types the templates field points
|
||||
* to each possible member (typically a union)
|
||||
* and the 'size' field is the offset of the
|
||||
* selector.
|
||||
*
|
||||
* The 'funcs' field is used for application-specific
|
||||
* data and functions.
|
||||
*
|
||||
* The EXTERN type uses a new style d2i/i2d.
|
||||
* The new style should be used where possible
|
||||
* because it avoids things like the d2i IMPLICIT
|
||||
* hack.
|
||||
*
|
||||
* MSTRING is a multiple string type, it is used
|
||||
* for a CHOICE of character strings where the
|
||||
* actual strings all occupy an ASN1_STRING
|
||||
* structure. In this case the 'utype' field
|
||||
* has a special meaning, it is used as a mask
|
||||
* of acceptable types using the B_ASN1 constants.
|
||||
*
|
||||
* NDEF_SEQUENCE is the same as SEQUENCE except
|
||||
* that it will use indefinite length constructed
|
||||
* encoding if requested.
|
||||
*
|
||||
*/
|
||||
|
||||
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
|
||||
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr))
|
||||
|
||||
/* Macros for start and end of ASN1_ITEM definition */
|
||||
|
||||
# define ASN1_ITEM_start(itname) \
|
||||
const ASN1_ITEM itname##_it = {
|
||||
|
||||
# define static_ASN1_ITEM_start(itname) \
|
||||
static const ASN1_ITEM itname##_it = {
|
||||
|
||||
# define ASN1_ITEM_end(itname) \
|
||||
};
|
||||
|
||||
# else
|
||||
#define ASN1_ITYPE_PRIMITIVE 0x0
|
||||
#define ASN1_ITYPE_SEQUENCE 0x1
|
||||
#define ASN1_ITYPE_CHOICE 0x2
|
||||
/* unused value 0x3 */
|
||||
#define ASN1_ITYPE_EXTERN 0x4
|
||||
#define ASN1_ITYPE_MSTRING 0x5
|
||||
#define ASN1_ITYPE_NDEF_SEQUENCE 0x6
|
||||
|
||||
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
|
||||
#define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
|
||||
@@ -57,12 +101,11 @@ extern "C" {
|
||||
static ASN1_ITEM_start(itname)
|
||||
|
||||
#define ASN1_ITEM_end(itname) \
|
||||
}; \
|
||||
} \
|
||||
; \
|
||||
return &local_it; \
|
||||
}
|
||||
|
||||
# endif
|
||||
|
||||
/* Macros to aid ASN1 template writing */
|
||||
|
||||
#define ASN1_ITEM_TEMPLATE(tname) \
|
||||
@@ -77,8 +120,7 @@ extern "C" {
|
||||
0, \
|
||||
NULL, \
|
||||
0, \
|
||||
#tname \
|
||||
ASN1_ITEM_end(tname)
|
||||
#tname ASN1_ITEM_end(tname)
|
||||
#define static_ASN1_ITEM_TEMPLATE_END(tname) \
|
||||
; \
|
||||
static_ASN1_ITEM_start(tname) \
|
||||
@@ -88,8 +130,7 @@ extern "C" {
|
||||
0, \
|
||||
NULL, \
|
||||
0, \
|
||||
#tname \
|
||||
ASN1_ITEM_end(tname)
|
||||
#tname ASN1_ITEM_end(tname)
|
||||
|
||||
/* This is a ASN1 type which just embeds a template */
|
||||
|
||||
@@ -130,8 +171,7 @@ extern "C" {
|
||||
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
|
||||
NULL, \
|
||||
sizeof(stname), \
|
||||
#tname \
|
||||
ASN1_ITEM_end(tname)
|
||||
#tname ASN1_ITEM_end(tname)
|
||||
|
||||
#define static_ASN1_SEQUENCE_END_name(stname, tname) \
|
||||
; \
|
||||
@@ -142,8 +182,7 @@ extern "C" {
|
||||
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
|
||||
NULL, \
|
||||
sizeof(stname), \
|
||||
#stname \
|
||||
ASN1_ITEM_end(tname)
|
||||
#stname ASN1_ITEM_end(tname)
|
||||
|
||||
#define ASN1_NDEF_SEQUENCE(tname) \
|
||||
ASN1_SEQUENCE(tname)
|
||||
@@ -152,19 +191,23 @@ extern "C" {
|
||||
ASN1_SEQUENCE_cb(tname, cb)
|
||||
|
||||
#define ASN1_SEQUENCE_cb(tname, cb) \
|
||||
static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
|
||||
static const ASN1_AUX tname##_aux = { NULL, 0, 0, 0, cb, 0, NULL }; \
|
||||
ASN1_SEQUENCE(tname)
|
||||
|
||||
# define ASN1_BROKEN_SEQUENCE(tname) \
|
||||
static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \
|
||||
#define ASN1_SEQUENCE_const_cb(tname, const_cb) \
|
||||
static const ASN1_AUX tname##_aux = { NULL, ASN1_AFLG_CONST_CB, 0, 0, NULL, 0, const_cb }; \
|
||||
ASN1_SEQUENCE(tname)
|
||||
|
||||
#define ASN1_SEQUENCE_cb_const_cb(tname, cb, const_cb) \
|
||||
static const ASN1_AUX tname##_aux = { NULL, ASN1_AFLG_CONST_CB, 0, 0, cb, 0, const_cb }; \
|
||||
ASN1_SEQUENCE(tname)
|
||||
|
||||
#define ASN1_SEQUENCE_ref(tname, cb) \
|
||||
static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), offsetof(tname, lock), cb, 0}; \
|
||||
static const ASN1_AUX tname##_aux = { NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), offsetof(tname, lock), cb, 0, NULL }; \
|
||||
ASN1_SEQUENCE(tname)
|
||||
|
||||
#define ASN1_SEQUENCE_enc(tname, enc, cb) \
|
||||
static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \
|
||||
static const ASN1_AUX tname##_aux = { NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc), NULL }; \
|
||||
ASN1_SEQUENCE(tname)
|
||||
|
||||
#define ASN1_NDEF_SEQUENCE_END(tname) \
|
||||
@@ -176,8 +219,7 @@ extern "C" {
|
||||
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
|
||||
NULL, \
|
||||
sizeof(tname), \
|
||||
#tname \
|
||||
ASN1_ITEM_end(tname)
|
||||
#tname ASN1_ITEM_end(tname)
|
||||
#define static_ASN1_NDEF_SEQUENCE_END(tname) \
|
||||
; \
|
||||
static_ASN1_ITEM_start(tname) \
|
||||
@@ -187,12 +229,7 @@ extern "C" {
|
||||
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
|
||||
NULL, \
|
||||
sizeof(tname), \
|
||||
#tname \
|
||||
ASN1_ITEM_end(tname)
|
||||
|
||||
# define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname)
|
||||
# define static_ASN1_BROKEN_SEQUENCE_END(stname) \
|
||||
static_ASN1_SEQUENCE_END_ref(stname, stname)
|
||||
#tname ASN1_ITEM_end(tname)
|
||||
|
||||
#define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
|
||||
|
||||
@@ -208,8 +245,7 @@ extern "C" {
|
||||
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
|
||||
&tname##_aux, \
|
||||
sizeof(stname), \
|
||||
#tname \
|
||||
ASN1_ITEM_end(tname)
|
||||
#tname ASN1_ITEM_end(tname)
|
||||
#define static_ASN1_SEQUENCE_END_ref(stname, tname) \
|
||||
; \
|
||||
static_ASN1_ITEM_start(tname) \
|
||||
@@ -219,8 +255,7 @@ extern "C" {
|
||||
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
|
||||
&tname##_aux, \
|
||||
sizeof(stname), \
|
||||
#stname \
|
||||
ASN1_ITEM_end(tname)
|
||||
#stname ASN1_ITEM_end(tname)
|
||||
|
||||
#define ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \
|
||||
; \
|
||||
@@ -231,8 +266,7 @@ extern "C" {
|
||||
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
|
||||
&tname##_aux, \
|
||||
sizeof(stname), \
|
||||
#stname \
|
||||
ASN1_ITEM_end(tname)
|
||||
#stname ASN1_ITEM_end(tname)
|
||||
|
||||
/*-
|
||||
* This pair helps declare a CHOICE type. We can do:
|
||||
@@ -261,7 +295,7 @@ extern "C" {
|
||||
static const ASN1_TEMPLATE tname##_ch_tt[]
|
||||
|
||||
#define ASN1_CHOICE_cb(tname, cb) \
|
||||
static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
|
||||
static const ASN1_AUX tname##_aux = { NULL, 0, 0, 0, cb, 0, NULL }; \
|
||||
ASN1_CHOICE(tname)
|
||||
|
||||
#define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname)
|
||||
@@ -281,8 +315,7 @@ extern "C" {
|
||||
sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE), \
|
||||
NULL, \
|
||||
sizeof(stname), \
|
||||
#stname \
|
||||
ASN1_ITEM_end(tname)
|
||||
#stname ASN1_ITEM_end(tname)
|
||||
|
||||
#define static_ASN1_CHOICE_END_selector(stname, tname, selname) \
|
||||
; \
|
||||
@@ -293,8 +326,7 @@ extern "C" {
|
||||
sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE), \
|
||||
NULL, \
|
||||
sizeof(stname), \
|
||||
#stname \
|
||||
ASN1_ITEM_end(tname)
|
||||
#stname ASN1_ITEM_end(tname)
|
||||
|
||||
#define ASN1_CHOICE_END_cb(stname, tname, selname) \
|
||||
; \
|
||||
@@ -305,14 +337,14 @@ extern "C" {
|
||||
sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE), \
|
||||
&tname##_aux, \
|
||||
sizeof(stname), \
|
||||
#stname \
|
||||
ASN1_ITEM_end(tname)
|
||||
#stname ASN1_ITEM_end(tname)
|
||||
|
||||
/* This helps with the template wrapper form of ASN1_ITEM */
|
||||
|
||||
#define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \
|
||||
(flags), (tag), 0, \
|
||||
#name, ASN1_ITEM_ref(type) }
|
||||
#name, ASN1_ITEM_ref(type) \
|
||||
}
|
||||
|
||||
/* These help with SEQUENCE or CHOICE components */
|
||||
|
||||
@@ -320,7 +352,8 @@ extern "C" {
|
||||
|
||||
#define ASN1_EX_TYPE(flags, tag, stname, field, type) { \
|
||||
(flags), (tag), offsetof(stname, field), \
|
||||
#field, ASN1_ITEM_ref(type) }
|
||||
#field, ASN1_ITEM_ref(type) \
|
||||
}
|
||||
|
||||
/* implicit and explicit helper macros */
|
||||
|
||||
@@ -332,13 +365,9 @@ extern "C" {
|
||||
|
||||
/* Any defined by macros: the field used is in the table itself */
|
||||
|
||||
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
|
||||
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
|
||||
# else
|
||||
#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
|
||||
#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
|
||||
# endif
|
||||
|
||||
/* Plain simple type */
|
||||
#define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0, 0, stname, field, type)
|
||||
/* Embedded simple type */
|
||||
@@ -418,28 +447,11 @@ extern "C" {
|
||||
#define ASN1_ADB(name) \
|
||||
static const ASN1_ADB_TABLE name##_adbtbl[]
|
||||
|
||||
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
|
||||
|
||||
# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
|
||||
;\
|
||||
static const ASN1_ADB name##_adb = {\
|
||||
flags,\
|
||||
offsetof(name, field),\
|
||||
adb_cb,\
|
||||
name##_adbtbl,\
|
||||
sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
|
||||
def,\
|
||||
none\
|
||||
}
|
||||
|
||||
# else
|
||||
|
||||
#define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
|
||||
; \
|
||||
static const ASN1_ITEM *name##_adb(void) \
|
||||
{ \
|
||||
static const ASN1_ADB internal_adb = \
|
||||
{\
|
||||
static const ASN1_ADB internal_adb = { \
|
||||
flags, \
|
||||
offsetof(name, field), \
|
||||
adb_cb, \
|
||||
@@ -452,8 +464,6 @@ extern "C" {
|
||||
} \
|
||||
void dummy_function(void)
|
||||
|
||||
# endif
|
||||
|
||||
#define ADB_ENTRY(val, template) { val, template }
|
||||
|
||||
#define ASN1_ADB_TEMPLATE(name) \
|
||||
@@ -584,64 +594,12 @@ struct ASN1_ITEM_st {
|
||||
const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains
|
||||
* the contents */
|
||||
long tcount; /* Number of templates if SEQUENCE or CHOICE */
|
||||
const void *funcs; /* functions that handle this type */
|
||||
const void *funcs; /* further data and type-specific functions */
|
||||
/* funcs can be ASN1_PRIMITIVE_FUNCS*, ASN1_EXTERN_FUNCS*, or ASN1_AUX* */
|
||||
long size; /* Structure size (usually) */
|
||||
const char *sname; /* Structure name */
|
||||
};
|
||||
|
||||
/*-
|
||||
* These are values for the itype field and
|
||||
* determine how the type is interpreted.
|
||||
*
|
||||
* For PRIMITIVE types the underlying type
|
||||
* determines the behaviour if items is NULL.
|
||||
*
|
||||
* Otherwise templates must contain a single
|
||||
* template and the type is treated in the
|
||||
* same way as the type specified in the template.
|
||||
*
|
||||
* For SEQUENCE types the templates field points
|
||||
* to the members, the size field is the
|
||||
* structure size.
|
||||
*
|
||||
* For CHOICE types the templates field points
|
||||
* to each possible member (typically a union)
|
||||
* and the 'size' field is the offset of the
|
||||
* selector.
|
||||
*
|
||||
* The 'funcs' field is used for application
|
||||
* specific functions.
|
||||
*
|
||||
* The EXTERN type uses a new style d2i/i2d.
|
||||
* The new style should be used where possible
|
||||
* because it avoids things like the d2i IMPLICIT
|
||||
* hack.
|
||||
*
|
||||
* MSTRING is a multiple string type, it is used
|
||||
* for a CHOICE of character strings where the
|
||||
* actual strings all occupy an ASN1_STRING
|
||||
* structure. In this case the 'utype' field
|
||||
* has a special meaning, it is used as a mask
|
||||
* of acceptable types using the B_ASN1 constants.
|
||||
*
|
||||
* NDEF_SEQUENCE is the same as SEQUENCE except
|
||||
* that it will use indefinite length constructed
|
||||
* encoding if requested.
|
||||
*
|
||||
*/
|
||||
|
||||
# define ASN1_ITYPE_PRIMITIVE 0x0
|
||||
|
||||
# define ASN1_ITYPE_SEQUENCE 0x1
|
||||
|
||||
# define ASN1_ITYPE_CHOICE 0x2
|
||||
|
||||
# define ASN1_ITYPE_EXTERN 0x4
|
||||
|
||||
# define ASN1_ITYPE_MSTRING 0x5
|
||||
|
||||
# define ASN1_ITYPE_NDEF_SEQUENCE 0x6
|
||||
|
||||
/*
|
||||
* Cache for ASN1 tag and length, so we don't keep re-reading it for things
|
||||
* like CHOICE
|
||||
@@ -661,21 +619,27 @@ typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
const ASN1_ITEM *it, int tag, int aclass, char opt,
|
||||
ASN1_TLC *ctx);
|
||||
|
||||
typedef int ASN1_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
|
||||
typedef int ASN1_ex_d2i_ex(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
const ASN1_ITEM *it, int tag, int aclass, char opt,
|
||||
ASN1_TLC *ctx, OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
typedef int ASN1_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
|
||||
const ASN1_ITEM *it, int tag, int aclass);
|
||||
typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
||||
typedef int ASN1_ex_new_ex_func(ASN1_VALUE **pval, const ASN1_ITEM *it,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
|
||||
|
||||
typedef int ASN1_ex_print_func(BIO *out, ASN1_VALUE **pval,
|
||||
typedef int ASN1_ex_print_func(BIO *out, const ASN1_VALUE **pval,
|
||||
int indent, const char *fname,
|
||||
const ASN1_PCTX *pctx);
|
||||
|
||||
typedef int ASN1_primitive_i2c(ASN1_VALUE **pval, unsigned char *cont,
|
||||
typedef int ASN1_primitive_i2c(const ASN1_VALUE **pval, unsigned char *cont,
|
||||
int *putype, const ASN1_ITEM *it);
|
||||
typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont,
|
||||
int len, int utype, char *free_cont,
|
||||
const ASN1_ITEM *it);
|
||||
typedef int ASN1_primitive_print(BIO *out, ASN1_VALUE **pval,
|
||||
typedef int ASN1_primitive_print(BIO *out, const ASN1_VALUE **pval,
|
||||
const ASN1_ITEM *it, int indent,
|
||||
const ASN1_PCTX *pctx);
|
||||
|
||||
@@ -687,6 +651,8 @@ typedef struct ASN1_EXTERN_FUNCS_st {
|
||||
ASN1_ex_d2i *asn1_ex_d2i;
|
||||
ASN1_ex_i2d *asn1_ex_i2d;
|
||||
ASN1_ex_print_func *asn1_ex_print;
|
||||
ASN1_ex_new_ex_func *asn1_ex_new_ex;
|
||||
ASN1_ex_d2i_ex *asn1_ex_d2i_ex;
|
||||
} ASN1_EXTERN_FUNCS;
|
||||
|
||||
typedef struct ASN1_PRIMITIVE_FUNCS_st {
|
||||
@@ -711,18 +677,25 @@ typedef struct ASN1_PRIMITIVE_FUNCS_st {
|
||||
* error has occurred and the main operation should be abandoned. If major
|
||||
* changes in the default behaviour are required then an external type is
|
||||
* more appropriate.
|
||||
* For the operations ASN1_OP_I2D_PRE, ASN1_OP_I2D_POST, ASN1_OP_PRINT_PRE, and
|
||||
* ASN1_OP_PRINT_POST, meanwhile a variant of the callback with const parameter
|
||||
* 'in' is provided to make clear statically that its input is not modified. If
|
||||
* and only if this variant is in use the flag ASN1_AFLG_CONST_CB must be set.
|
||||
*/
|
||||
|
||||
typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it,
|
||||
void *exarg);
|
||||
typedef int ASN1_aux_const_cb(int operation, const ASN1_VALUE **in,
|
||||
const ASN1_ITEM *it, void *exarg);
|
||||
|
||||
typedef struct ASN1_AUX_st {
|
||||
void *app_data;
|
||||
int flags;
|
||||
int ref_offset; /* Offset of reference value */
|
||||
int ref_lock; /* Lock type to use */
|
||||
int ref_lock; /* Offset of lock value */
|
||||
ASN1_aux_cb *asn1_cb;
|
||||
int enc_offset; /* Offset of ASN1_ENCODING structure */
|
||||
ASN1_aux_const_cb *asn1_const_cb; /* for ASN1_OP_I2D_ and ASN1_OP_PRINT_ */
|
||||
} ASN1_AUX;
|
||||
|
||||
/* For print related callbacks exarg points to this structure */
|
||||
@@ -750,6 +723,8 @@ typedef struct ASN1_STREAM_ARG_st {
|
||||
#define ASN1_AFLG_ENCODING 2
|
||||
/* The Sequence length is invalid */
|
||||
#define ASN1_AFLG_BROKEN 4
|
||||
/* Use the new asn1_const_cb */
|
||||
#define ASN1_AFLG_CONST_CB 8
|
||||
|
||||
/* operation values for asn1_cb */
|
||||
|
||||
@@ -767,19 +742,23 @@ typedef struct ASN1_STREAM_ARG_st {
|
||||
#define ASN1_OP_STREAM_POST 11
|
||||
#define ASN1_OP_DETACHED_PRE 12
|
||||
#define ASN1_OP_DETACHED_POST 13
|
||||
#define ASN1_OP_DUP_PRE 14
|
||||
#define ASN1_OP_DUP_POST 15
|
||||
#define ASN1_OP_GET0_LIBCTX 16
|
||||
#define ASN1_OP_GET0_PROPQ 17
|
||||
|
||||
/* Macro to implement a primitive type */
|
||||
#define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0)
|
||||
#define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \
|
||||
ASN1_ITEM_start(itname) \
|
||||
ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
|
||||
ASN1_ITEM_end(itname)
|
||||
ASN1_ITYPE_PRIMITIVE, \
|
||||
V_##vname, NULL, 0, NULL, ex, #itname ASN1_ITEM_end(itname)
|
||||
|
||||
/* Macro to implement a multi string type */
|
||||
#define IMPLEMENT_ASN1_MSTRING(itname, mask) \
|
||||
ASN1_ITEM_start(itname) \
|
||||
ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
|
||||
ASN1_ITEM_end(itname)
|
||||
ASN1_ITYPE_MSTRING, \
|
||||
mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname ASN1_ITEM_end(itname)
|
||||
|
||||
#define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \
|
||||
ASN1_ITEM_start(sname) \
|
||||
@@ -789,8 +768,7 @@ typedef struct ASN1_STREAM_ARG_st {
|
||||
0, \
|
||||
&fptrs, \
|
||||
0, \
|
||||
#sname \
|
||||
ASN1_ITEM_end(sname)
|
||||
#sname ASN1_ITEM_end(sname)
|
||||
|
||||
/* Macro to implement standard functions in terms of ASN1_ITEM structures */
|
||||
|
||||
@@ -836,15 +814,15 @@ typedef struct ASN1_STREAM_ARG_st {
|
||||
{ \
|
||||
return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname)); \
|
||||
} \
|
||||
int i2d_##fname(stname *a, unsigned char **out) \
|
||||
int i2d_##fname(const stname *a, unsigned char **out) \
|
||||
{ \
|
||||
return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
|
||||
return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname)); \
|
||||
}
|
||||
|
||||
#define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \
|
||||
int i2d_##stname##_NDEF(stname *a, unsigned char **out) \
|
||||
int i2d_##stname##_NDEF(const stname *a, unsigned char **out) \
|
||||
{ \
|
||||
return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\
|
||||
return ASN1_item_ndef_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname)); \
|
||||
}
|
||||
|
||||
#define IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(stname) \
|
||||
@@ -854,28 +832,14 @@ typedef struct ASN1_STREAM_ARG_st {
|
||||
return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, \
|
||||
ASN1_ITEM_rptr(stname)); \
|
||||
} \
|
||||
static int i2d_##stname(stname *a, unsigned char **out) \
|
||||
static int i2d_##stname(const stname *a, unsigned char **out) \
|
||||
{ \
|
||||
return ASN1_item_i2d((ASN1_VALUE *)a, out, \
|
||||
return ASN1_item_i2d((const ASN1_VALUE *)a, out, \
|
||||
ASN1_ITEM_rptr(stname)); \
|
||||
}
|
||||
|
||||
/*
|
||||
* This includes evil casts to remove const: they will go away when full ASN1
|
||||
* constification is done.
|
||||
*/
|
||||
# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
|
||||
stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
|
||||
{ \
|
||||
return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
|
||||
} \
|
||||
int i2d_##fname(const stname *a, unsigned char **out) \
|
||||
{ \
|
||||
return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
|
||||
}
|
||||
|
||||
#define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \
|
||||
stname * stname##_dup(stname *x) \
|
||||
stname *stname##_dup(const stname *x) \
|
||||
{ \
|
||||
return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
|
||||
}
|
||||
@@ -884,20 +848,13 @@ typedef struct ASN1_STREAM_ARG_st {
|
||||
IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, stname, stname)
|
||||
|
||||
#define IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, itname, fname) \
|
||||
int fname##_print_ctx(BIO *out, stname *x, int indent, \
|
||||
int fname##_print_ctx(BIO *out, const stname *x, int indent, \
|
||||
const ASN1_PCTX *pctx) \
|
||||
{ \
|
||||
return ASN1_item_print(out, (ASN1_VALUE *)x, indent, \
|
||||
return ASN1_item_print(out, (const ASN1_VALUE *)x, indent, \
|
||||
ASN1_ITEM_rptr(itname), pctx); \
|
||||
}
|
||||
|
||||
# define IMPLEMENT_ASN1_FUNCTIONS_const(name) \
|
||||
IMPLEMENT_ASN1_FUNCTIONS_const_fname(name, name, name)
|
||||
|
||||
# define IMPLEMENT_ASN1_FUNCTIONS_const_fname(stname, itname, fname) \
|
||||
IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
|
||||
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
|
||||
|
||||
/* external definitions for primitive types */
|
||||
|
||||
DECLARE_ASN1_ITEM(ASN1_BOOLEAN)
|
||||
@@ -915,7 +872,7 @@ DECLARE_ASN1_ITEM(ZINT64)
|
||||
DECLARE_ASN1_ITEM(UINT64)
|
||||
DECLARE_ASN1_ITEM(ZUINT64)
|
||||
|
||||
# if OPENSSL_API_COMPAT < 0x10200000L
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
/*
|
||||
* LONG and ZLONG are strongly discouraged for use as stored data, as the
|
||||
* underlying C type (long) differs in size depending on the architecture.
|
||||
@@ -925,7 +882,35 @@ DECLARE_ASN1_ITEM(LONG)
|
||||
DECLARE_ASN1_ITEM(ZLONG)
|
||||
#endif
|
||||
|
||||
DEFINE_STACK_OF(ASN1_VALUE)
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_VALUE, ASN1_VALUE, ASN1_VALUE)
|
||||
#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
|
||||
#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
|
||||
#define sk_ASN1_VALUE_new(cmp) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_ASN1_VALUE_compfunc_type(cmp)), sk_ASN1_VALUE_cmpfunc_thunk))
|
||||
#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_ASN1_VALUE_freefunc_thunk))
|
||||
#define sk_ASN1_VALUE_new_reserve(cmp, n) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_ASN1_VALUE_compfunc_type(cmp), (n)), sk_ASN1_VALUE_cmpfunc_thunk))
|
||||
#define sk_ASN1_VALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_VALUE_sk_type(sk), (n))
|
||||
#define sk_ASN1_VALUE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_VALUE_sk_type(sk))
|
||||
#define sk_ASN1_VALUE_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_VALUE_sk_type(sk))
|
||||
#define sk_ASN1_VALUE_delete(sk, i) ((ASN1_VALUE *)OPENSSL_sk_delete(ossl_check_ASN1_VALUE_sk_type(sk), (i)))
|
||||
#define sk_ASN1_VALUE_delete_ptr(sk, ptr) ((ASN1_VALUE *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr)))
|
||||
#define sk_ASN1_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
|
||||
#define sk_ASN1_VALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
|
||||
#define sk_ASN1_VALUE_pop(sk) ((ASN1_VALUE *)OPENSSL_sk_pop(ossl_check_ASN1_VALUE_sk_type(sk)))
|
||||
#define sk_ASN1_VALUE_shift(sk) ((ASN1_VALUE *)OPENSSL_sk_shift(ossl_check_ASN1_VALUE_sk_type(sk)))
|
||||
#define sk_ASN1_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_freefunc_type(freefunc))
|
||||
#define sk_ASN1_VALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr), (idx))
|
||||
#define sk_ASN1_VALUE_set(sk, idx, ptr) ((ASN1_VALUE *)OPENSSL_sk_set(ossl_check_ASN1_VALUE_sk_type(sk), (idx), ossl_check_ASN1_VALUE_type(ptr)))
|
||||
#define sk_ASN1_VALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
|
||||
#define sk_ASN1_VALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
|
||||
#define sk_ASN1_VALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr), pnum)
|
||||
#define sk_ASN1_VALUE_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_VALUE_sk_type(sk))
|
||||
#define sk_ASN1_VALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_VALUE_sk_type(sk))
|
||||
#define sk_ASN1_VALUE_dup(sk) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_dup(ossl_check_const_ASN1_VALUE_sk_type(sk)))
|
||||
#define sk_ASN1_VALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_copyfunc_type(copyfunc), ossl_check_ASN1_VALUE_freefunc_type(freefunc)))
|
||||
#define sk_ASN1_VALUE_set_cmp_func(sk, cmp) ((sk_ASN1_VALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
/* Functions used internally by the ASN1 code */
|
||||
|
||||
@@ -936,9 +921,14 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
|
||||
const ASN1_ITEM *it, int tag, int aclass, char opt,
|
||||
ASN1_TLC *ctx);
|
||||
|
||||
int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
|
||||
int ASN1_item_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
|
||||
const ASN1_ITEM *it, int tag, int aclass);
|
||||
|
||||
/* Legacy compatibility */
|
||||
#define IMPLEMENT_ASN1_FUNCTIONS_const(name) IMPLEMENT_ASN1_FUNCTIONS(name)
|
||||
#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
|
||||
IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2015-2022 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
@@ -9,8 +9,14 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef HEADER_ASYNC_H
|
||||
#ifndef OPENSSL_ASYNC_H
|
||||
#define OPENSSL_ASYNC_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_ASYNC_H
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#if defined(BASETYPES) || defined(_WINDEF_H)
|
||||
@@ -24,19 +30,24 @@
|
||||
#endif
|
||||
#include <openssl/asyncerr.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct async_job_st ASYNC_JOB;
|
||||
typedef struct async_wait_ctx_st ASYNC_WAIT_CTX;
|
||||
typedef int (*ASYNC_callback_fn)(void *arg);
|
||||
|
||||
#define ASYNC_ERR 0
|
||||
#define ASYNC_NO_JOBS 1
|
||||
#define ASYNC_PAUSE 2
|
||||
#define ASYNC_FINISH 3
|
||||
|
||||
#define ASYNC_STATUS_UNSUPPORTED 0
|
||||
#define ASYNC_STATUS_ERR 1
|
||||
#define ASYNC_STATUS_OK 2
|
||||
#define ASYNC_STATUS_EAGAIN 3
|
||||
|
||||
int ASYNC_init_thread(size_t max_size, size_t init_size);
|
||||
void ASYNC_cleanup_thread(void);
|
||||
|
||||
@@ -52,6 +63,14 @@ int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key,
|
||||
OSSL_ASYNC_FD *fd, void **custom_data);
|
||||
int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd,
|
||||
size_t *numfds);
|
||||
int ASYNC_WAIT_CTX_get_callback(ASYNC_WAIT_CTX *ctx,
|
||||
ASYNC_callback_fn *callback,
|
||||
void **callback_arg);
|
||||
int ASYNC_WAIT_CTX_set_callback(ASYNC_WAIT_CTX *ctx,
|
||||
ASYNC_callback_fn callback,
|
||||
void *callback_arg);
|
||||
int ASYNC_WAIT_CTX_set_status(ASYNC_WAIT_CTX *ctx, int status);
|
||||
int ASYNC_WAIT_CTX_get_status(ASYNC_WAIT_CTX *ctx);
|
||||
int ASYNC_WAIT_CTX_get_changed_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *addfd,
|
||||
size_t *numaddfds, OSSL_ASYNC_FD *delfd,
|
||||
size_t *numdelfds);
|
||||
@@ -60,6 +79,14 @@ int ASYNC_WAIT_CTX_clear_fd(ASYNC_WAIT_CTX *ctx, const void *key);
|
||||
|
||||
int ASYNC_is_capable(void);
|
||||
|
||||
typedef void *(*ASYNC_stack_alloc_fn)(size_t *num);
|
||||
typedef void (*ASYNC_stack_free_fn)(void *addr);
|
||||
|
||||
int ASYNC_set_mem_functions(ASYNC_stack_alloc_fn alloc_fn,
|
||||
ASYNC_stack_free_fn free_fn);
|
||||
void ASYNC_get_mem_functions(ASYNC_stack_alloc_fn *alloc_fn,
|
||||
ASYNC_stack_free_fn *free_fn);
|
||||
|
||||
int ASYNC_start_job(ASYNC_JOB **job, ASYNC_WAIT_CTX *ctx, int *ret,
|
||||
int (*func)(void *), void *args, size_t size);
|
||||
int ASYNC_pause_job(void);
|
||||
@@ -69,7 +96,6 @@ ASYNC_WAIT_CTX *ASYNC_get_wait_ctx(ASYNC_JOB *job);
|
||||
void ASYNC_block_pause(void);
|
||||
void ASYNC_unblock_pause(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,35 +1,20 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_ASYNCERR_H
|
||||
# define HEADER_ASYNCERR_H
|
||||
#ifndef OPENSSL_ASYNCERR_H
|
||||
#define OPENSSL_ASYNCERR_H
|
||||
#pragma once
|
||||
|
||||
# ifndef HEADER_SYMHACKS_H
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/symhacks.h>
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
int ERR_load_ASYNC_strings(void);
|
||||
|
||||
/*
|
||||
* ASYNC function codes.
|
||||
*/
|
||||
# define ASYNC_F_ASYNC_CTX_NEW 100
|
||||
# define ASYNC_F_ASYNC_INIT_THREAD 101
|
||||
# define ASYNC_F_ASYNC_JOB_NEW 102
|
||||
# define ASYNC_F_ASYNC_PAUSE_JOB 103
|
||||
# define ASYNC_F_ASYNC_START_FUNC 104
|
||||
# define ASYNC_F_ASYNC_START_JOB 105
|
||||
# define ASYNC_F_ASYNC_WAIT_CTX_SET_WAIT_FD 106
|
||||
#include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
/*
|
||||
* ASYNC reason codes.
|
||||
|
||||
@@ -1,14 +1,26 @@
|
||||
/*
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/bio.h.in
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
/* clang-format off */
|
||||
|
||||
#ifndef HEADER_BIO_H
|
||||
/* clang-format on */
|
||||
|
||||
#ifndef OPENSSL_BIO_H
|
||||
#define OPENSSL_BIO_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_BIO_H
|
||||
#endif
|
||||
|
||||
#include <openssl/e_os2.h>
|
||||
|
||||
@@ -19,6 +31,7 @@
|
||||
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/bioerr.h>
|
||||
#include <openssl/core.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -55,8 +68,14 @@ extern "C" {
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
#define BIO_TYPE_DGRAM_SCTP (24 | BIO_TYPE_SOURCE_SINK | BIO_TYPE_DESCRIPTOR)
|
||||
#endif
|
||||
#define BIO_TYPE_CORE_TO_PROV (25 | BIO_TYPE_SOURCE_SINK)
|
||||
#define BIO_TYPE_DGRAM_PAIR (26 | BIO_TYPE_SOURCE_SINK)
|
||||
#define BIO_TYPE_DGRAM_MEM (27 | BIO_TYPE_SOURCE_SINK)
|
||||
|
||||
/* Custom type starting index returned by BIO_get_new_index() */
|
||||
#define BIO_TYPE_START 128
|
||||
/* Custom type maximum index that can be returned by BIO_get_new_index() */
|
||||
#define BIO_TYPE_MASK 0xFF
|
||||
|
||||
/*
|
||||
* BIO_FILENAME_READ|BIO_CLOSE to open or close on free.
|
||||
@@ -89,7 +108,7 @@ extern "C" {
|
||||
|
||||
/* dgram BIO stuff */
|
||||
#define BIO_CTRL_DGRAM_CONNECT 31 /* BIO dgram special */
|
||||
# define BIO_CTRL_DGRAM_SET_CONNECTED 32/* allow for an externally connected
|
||||
#define BIO_CTRL_DGRAM_SET_CONNECTED 32 /* allow for an externally connected \
|
||||
* socket to be passed in */
|
||||
#define BIO_CTRL_DGRAM_SET_RECV_TIMEOUT 33 /* setsockopt, essentially */
|
||||
#define BIO_CTRL_DGRAM_GET_RECV_TIMEOUT 34 /* getsockopt, essentially */
|
||||
@@ -97,7 +116,7 @@ extern "C" {
|
||||
#define BIO_CTRL_DGRAM_GET_SEND_TIMEOUT 36 /* getsockopt, essentially */
|
||||
|
||||
#define BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP 37 /* flag whether the last */
|
||||
# define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38/* I/O operation tiemd out */
|
||||
#define BIO_CTRL_DGRAM_GET_SEND_TIMER_EXP 38 /* I/O operation timed out */
|
||||
|
||||
/* #ifdef IP_MTU_DISCOVER */
|
||||
#define BIO_CTRL_DGRAM_MTU_DISCOVER 39 /* set DF bit on egress packets */
|
||||
@@ -106,18 +125,18 @@ extern "C" {
|
||||
#define BIO_CTRL_DGRAM_QUERY_MTU 40 /* as kernel for current MTU */
|
||||
#define BIO_CTRL_DGRAM_GET_FALLBACK_MTU 47
|
||||
#define BIO_CTRL_DGRAM_GET_MTU 41 /* get cached value for MTU */
|
||||
# define BIO_CTRL_DGRAM_SET_MTU 42/* set cached value for MTU.
|
||||
* want to use this if asking
|
||||
#define BIO_CTRL_DGRAM_SET_MTU 42 /* set cached value for MTU. \
|
||||
* want to use this if asking \
|
||||
* the kernel fails */
|
||||
|
||||
# define BIO_CTRL_DGRAM_MTU_EXCEEDED 43/* check whether the MTU was
|
||||
* exceed in the previous write
|
||||
#define BIO_CTRL_DGRAM_MTU_EXCEEDED 43 /* check whether the MTU was \
|
||||
* exceed in the previous write \
|
||||
* operation */
|
||||
|
||||
#define BIO_CTRL_DGRAM_GET_PEER 46
|
||||
#define BIO_CTRL_DGRAM_SET_PEER 44 /* Destination for the data */
|
||||
|
||||
# define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45/* Next DTLS handshake timeout
|
||||
#define BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT 45 /* Next DTLS handshake timeout \
|
||||
* to adjust socket timeouts */
|
||||
#define BIO_CTRL_DGRAM_SET_DONT_FRAG 48
|
||||
|
||||
@@ -141,6 +160,59 @@ extern "C" {
|
||||
|
||||
#define BIO_CTRL_DGRAM_SET_PEEK_MODE 71
|
||||
|
||||
/*
|
||||
* internal BIO:
|
||||
* # define BIO_CTRL_SET_KTLS_SEND 72
|
||||
* # define BIO_CTRL_SET_KTLS_SEND_CTRL_MSG 74
|
||||
* # define BIO_CTRL_CLEAR_KTLS_CTRL_MSG 75
|
||||
*/
|
||||
|
||||
#define BIO_CTRL_GET_KTLS_SEND 73
|
||||
#define BIO_CTRL_GET_KTLS_RECV 76
|
||||
|
||||
#define BIO_CTRL_DGRAM_SCTP_WAIT_FOR_DRY 77
|
||||
#define BIO_CTRL_DGRAM_SCTP_MSG_WAITING 78
|
||||
|
||||
/* BIO_f_prefix controls */
|
||||
#define BIO_CTRL_SET_PREFIX 79
|
||||
#define BIO_CTRL_SET_INDENT 80
|
||||
#define BIO_CTRL_GET_INDENT 81
|
||||
|
||||
#define BIO_CTRL_DGRAM_GET_LOCAL_ADDR_CAP 82
|
||||
#define BIO_CTRL_DGRAM_GET_LOCAL_ADDR_ENABLE 83
|
||||
#define BIO_CTRL_DGRAM_SET_LOCAL_ADDR_ENABLE 84
|
||||
#define BIO_CTRL_DGRAM_GET_EFFECTIVE_CAPS 85
|
||||
#define BIO_CTRL_DGRAM_GET_CAPS 86
|
||||
#define BIO_CTRL_DGRAM_SET_CAPS 87
|
||||
#define BIO_CTRL_DGRAM_GET_NO_TRUNC 88
|
||||
#define BIO_CTRL_DGRAM_SET_NO_TRUNC 89
|
||||
|
||||
/*
|
||||
* internal BIO:
|
||||
* # define BIO_CTRL_SET_KTLS_TX_ZEROCOPY_SENDFILE 90
|
||||
*/
|
||||
|
||||
#define BIO_CTRL_GET_RPOLL_DESCRIPTOR 91
|
||||
#define BIO_CTRL_GET_WPOLL_DESCRIPTOR 92
|
||||
#define BIO_CTRL_DGRAM_DETECT_PEER_ADDR 93
|
||||
#define BIO_CTRL_DGRAM_SET0_LOCAL_ADDR 94
|
||||
|
||||
#define BIO_DGRAM_CAP_NONE 0U
|
||||
#define BIO_DGRAM_CAP_HANDLES_SRC_ADDR (1U << 0)
|
||||
#define BIO_DGRAM_CAP_HANDLES_DST_ADDR (1U << 1)
|
||||
#define BIO_DGRAM_CAP_PROVIDES_SRC_ADDR (1U << 2)
|
||||
#define BIO_DGRAM_CAP_PROVIDES_DST_ADDR (1U << 3)
|
||||
|
||||
#ifndef OPENSSL_NO_KTLS
|
||||
#define BIO_get_ktls_send(b) \
|
||||
(BIO_ctrl(b, BIO_CTRL_GET_KTLS_SEND, 0, NULL) > 0)
|
||||
#define BIO_get_ktls_recv(b) \
|
||||
(BIO_ctrl(b, BIO_CTRL_GET_KTLS_RECV, 0, NULL) > 0)
|
||||
#else
|
||||
#define BIO_get_ktls_send(b) (0)
|
||||
#define BIO_get_ktls_recv(b) (0)
|
||||
#endif
|
||||
|
||||
/* modifiers */
|
||||
#define BIO_FP_READ 0x02
|
||||
#define BIO_FP_WRITE 0x04
|
||||
@@ -152,14 +224,22 @@ extern "C" {
|
||||
#define BIO_FLAGS_IO_SPECIAL 0x04
|
||||
#define BIO_FLAGS_RWS (BIO_FLAGS_READ | BIO_FLAGS_WRITE | BIO_FLAGS_IO_SPECIAL)
|
||||
#define BIO_FLAGS_SHOULD_RETRY 0x08
|
||||
# ifndef BIO_FLAGS_UPLINK
|
||||
/*
|
||||
* "UPLINK" flag denotes file descriptors provided by application. It
|
||||
* defaults to 0, as most platforms don't require UPLINK interface.
|
||||
*/
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
/* This #define was replaced by an internal constant and should not be used. */
|
||||
#define BIO_FLAGS_UPLINK 0
|
||||
#endif
|
||||
|
||||
/* the BIO FLAGS values 0x10 to 0x80 are reserved for internal use */
|
||||
|
||||
/*
|
||||
* BIO FLAGS in the range 0x0100..0x8000 are BIO-type specific.
|
||||
* Their meaning is defined by the particular BIO implementation and
|
||||
* is not shared across different BIO types. The same bit value may
|
||||
* have a different meaning or no meaning at all in other BIOs.
|
||||
* Such flags may be part of the public API or internal to the BIO.
|
||||
*/
|
||||
|
||||
/* This is used with base64 BIO */
|
||||
#define BIO_FLAGS_BASE64_NO_NL 0x100
|
||||
|
||||
/*
|
||||
@@ -223,6 +303,8 @@ void BIO_clear_flags(BIO *b, int flags);
|
||||
#define BIO_CB_PUTS 0x04
|
||||
#define BIO_CB_GETS 0x05
|
||||
#define BIO_CB_CTRL 0x06
|
||||
#define BIO_CB_RECVMMSG 0x07
|
||||
#define BIO_CB_SENDMMSG 0x08
|
||||
|
||||
/*
|
||||
* The callback is called before and after the underling operation, The
|
||||
@@ -233,16 +315,23 @@ void BIO_clear_flags(BIO *b, int flags);
|
||||
#define BIO_cb_pre(a) (!((a) & BIO_CB_RETURN))
|
||||
#define BIO_cb_post(a) ((a) & BIO_CB_RETURN)
|
||||
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
typedef long (*BIO_callback_fn)(BIO *b, int oper, const char *argp, int argi,
|
||||
long argl, long ret);
|
||||
OSSL_DEPRECATEDIN_3_0 BIO_callback_fn BIO_get_callback(const BIO *b);
|
||||
OSSL_DEPRECATEDIN_3_0 void BIO_set_callback(BIO *b, BIO_callback_fn callback);
|
||||
OSSL_DEPRECATEDIN_3_0 long BIO_debug_callback(BIO *bio, int cmd,
|
||||
const char *argp, int argi,
|
||||
long argl, long ret);
|
||||
#endif
|
||||
|
||||
typedef long (*BIO_callback_fn_ex)(BIO *b, int oper, const char *argp,
|
||||
size_t len, int argi,
|
||||
long argl, int ret, size_t *processed);
|
||||
BIO_callback_fn BIO_get_callback(const BIO *b);
|
||||
void BIO_set_callback(BIO *b, BIO_callback_fn callback);
|
||||
|
||||
BIO_callback_fn_ex BIO_get_callback_ex(const BIO *b);
|
||||
void BIO_set_callback_ex(BIO *b, BIO_callback_fn_ex callback);
|
||||
long BIO_debug_callback_ex(BIO *bio, int oper, const char *argp, size_t len,
|
||||
int argi, long argl, int ret, size_t *processed);
|
||||
|
||||
char *BIO_get_callback_arg(const BIO *b);
|
||||
void BIO_set_callback_arg(BIO *b, char *arg);
|
||||
@@ -255,12 +344,43 @@ int BIO_method_type(const BIO *b);
|
||||
typedef int BIO_info_cb(BIO *, int, int);
|
||||
typedef BIO_info_cb bio_info_cb; /* backward compatibility */
|
||||
|
||||
DEFINE_STACK_OF(BIO)
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(BIO, BIO, BIO)
|
||||
#define sk_BIO_num(sk) OPENSSL_sk_num(ossl_check_const_BIO_sk_type(sk))
|
||||
#define sk_BIO_value(sk, idx) ((BIO *)OPENSSL_sk_value(ossl_check_const_BIO_sk_type(sk), (idx)))
|
||||
#define sk_BIO_new(cmp) ((STACK_OF(BIO) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_BIO_compfunc_type(cmp)), sk_BIO_cmpfunc_thunk))
|
||||
#define sk_BIO_new_null() ((STACK_OF(BIO) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_BIO_freefunc_thunk))
|
||||
#define sk_BIO_new_reserve(cmp, n) ((STACK_OF(BIO) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_BIO_compfunc_type(cmp), (n)), sk_BIO_cmpfunc_thunk))
|
||||
#define sk_BIO_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_BIO_sk_type(sk), (n))
|
||||
#define sk_BIO_free(sk) OPENSSL_sk_free(ossl_check_BIO_sk_type(sk))
|
||||
#define sk_BIO_zero(sk) OPENSSL_sk_zero(ossl_check_BIO_sk_type(sk))
|
||||
#define sk_BIO_delete(sk, i) ((BIO *)OPENSSL_sk_delete(ossl_check_BIO_sk_type(sk), (i)))
|
||||
#define sk_BIO_delete_ptr(sk, ptr) ((BIO *)OPENSSL_sk_delete_ptr(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr)))
|
||||
#define sk_BIO_push(sk, ptr) OPENSSL_sk_push(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr))
|
||||
#define sk_BIO_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr))
|
||||
#define sk_BIO_pop(sk) ((BIO *)OPENSSL_sk_pop(ossl_check_BIO_sk_type(sk)))
|
||||
#define sk_BIO_shift(sk) ((BIO *)OPENSSL_sk_shift(ossl_check_BIO_sk_type(sk)))
|
||||
#define sk_BIO_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_BIO_sk_type(sk), ossl_check_BIO_freefunc_type(freefunc))
|
||||
#define sk_BIO_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr), (idx))
|
||||
#define sk_BIO_set(sk, idx, ptr) ((BIO *)OPENSSL_sk_set(ossl_check_BIO_sk_type(sk), (idx), ossl_check_BIO_type(ptr)))
|
||||
#define sk_BIO_find(sk, ptr) OPENSSL_sk_find(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr))
|
||||
#define sk_BIO_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr))
|
||||
#define sk_BIO_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_BIO_sk_type(sk), ossl_check_BIO_type(ptr), pnum)
|
||||
#define sk_BIO_sort(sk) OPENSSL_sk_sort(ossl_check_BIO_sk_type(sk))
|
||||
#define sk_BIO_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_BIO_sk_type(sk))
|
||||
#define sk_BIO_dup(sk) ((STACK_OF(BIO) *)OPENSSL_sk_dup(ossl_check_const_BIO_sk_type(sk)))
|
||||
#define sk_BIO_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(BIO) *)OPENSSL_sk_deep_copy(ossl_check_const_BIO_sk_type(sk), ossl_check_BIO_copyfunc_type(copyfunc), ossl_check_BIO_freefunc_type(freefunc)))
|
||||
#define sk_BIO_set_cmp_func(sk, cmp) ((sk_BIO_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_BIO_sk_type(sk), ossl_check_BIO_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
/* Prefix and suffix callback in ASN1 BIO */
|
||||
typedef int asn1_ps_func(BIO *b, unsigned char **pbuf, int *plen,
|
||||
void *parg);
|
||||
|
||||
typedef void (*BIO_dgram_sctp_notification_handler_fn)(BIO *b,
|
||||
void *context,
|
||||
void *buf);
|
||||
#ifndef OPENSSL_NO_SCTP
|
||||
/* SCTP parameter structs */
|
||||
struct bio_dgram_sctp_sndinfo {
|
||||
@@ -286,6 +406,36 @@ struct bio_dgram_sctp_prinfo {
|
||||
};
|
||||
#endif
|
||||
|
||||
/* BIO_sendmmsg/BIO_recvmmsg-related definitions */
|
||||
typedef struct bio_msg_st {
|
||||
void *data;
|
||||
size_t data_len;
|
||||
BIO_ADDR *peer, *local;
|
||||
uint64_t flags;
|
||||
} BIO_MSG;
|
||||
|
||||
typedef struct bio_mmsg_cb_args_st {
|
||||
BIO_MSG *msg;
|
||||
size_t stride, num_msg;
|
||||
uint64_t flags;
|
||||
size_t *msgs_processed;
|
||||
} BIO_MMSG_CB_ARGS;
|
||||
|
||||
#define BIO_POLL_DESCRIPTOR_TYPE_NONE 0
|
||||
#define BIO_POLL_DESCRIPTOR_TYPE_SOCK_FD 1
|
||||
#define BIO_POLL_DESCRIPTOR_TYPE_SSL 2
|
||||
#define BIO_POLL_DESCRIPTOR_CUSTOM_START 8192
|
||||
|
||||
typedef struct bio_poll_descriptor_st {
|
||||
uint32_t type;
|
||||
union {
|
||||
int fd;
|
||||
void *custom;
|
||||
uintptr_t custom_ui;
|
||||
SSL *ssl;
|
||||
} value;
|
||||
} BIO_POLL_DESCRIPTOR;
|
||||
|
||||
/*
|
||||
* #define BIO_CONN_get_param_hostname BIO_ctrl
|
||||
*/
|
||||
@@ -320,7 +470,7 @@ struct bio_dgram_sctp_prinfo {
|
||||
#define BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT 127
|
||||
#define BIO_C_FILE_SEEK 128
|
||||
#define BIO_C_GET_CIPHER_CTX 129
|
||||
# define BIO_C_SET_BUF_MEM_EOF_RETURN 130/* return end of input
|
||||
#define BIO_C_SET_BUF_MEM_EOF_RETURN 130 /* return end of input \
|
||||
* value */
|
||||
#define BIO_C_SET_BIND_MODE 131
|
||||
#define BIO_C_GET_BIND_MODE 132
|
||||
@@ -352,10 +502,18 @@ struct bio_dgram_sctp_prinfo {
|
||||
|
||||
#define BIO_C_SET_CONNECT_MODE 155
|
||||
|
||||
#define BIO_C_SET_TFO 156 /* like BIO_C_SET_NBIO */
|
||||
|
||||
#define BIO_C_SET_SOCK_TYPE 157
|
||||
#define BIO_C_GET_SOCK_TYPE 158
|
||||
#define BIO_C_GET_DGRAM_BIO 159
|
||||
#define BIO_C_SET_SEND_FLAGS 160
|
||||
|
||||
#define BIO_set_app_data(s, arg) BIO_set_ex_data(s, 0, arg)
|
||||
#define BIO_get_app_data(s) BIO_get_ex_data(s, 0)
|
||||
|
||||
#define BIO_set_nbio(b, n) BIO_ctrl(b, BIO_C_SET_NBIO, (n), NULL)
|
||||
#define BIO_set_tfo(b, n) BIO_ctrl(b, BIO_C_SET_TFO, (n), NULL)
|
||||
|
||||
#ifndef OPENSSL_NO_SOCK
|
||||
/* IP families we support, for BIO_s_connect() and BIO_s_accept() */
|
||||
@@ -376,7 +534,11 @@ struct bio_dgram_sctp_prinfo {
|
||||
#define BIO_get_conn_port(b) ((const char *)BIO_ptr_ctrl(b, BIO_C_GET_CONNECT, 1))
|
||||
#define BIO_get_conn_address(b) ((const BIO_ADDR *)BIO_ptr_ctrl(b, BIO_C_GET_CONNECT, 2))
|
||||
#define BIO_get_conn_ip_family(b) BIO_ctrl(b, BIO_C_GET_CONNECT, 3, NULL)
|
||||
#define BIO_get_conn_mode(b) BIO_ctrl(b, BIO_C_GET_CONNECT, 4, NULL)
|
||||
#define BIO_set_conn_mode(b, n) BIO_ctrl(b, BIO_C_SET_CONNECT_MODE, (n), NULL)
|
||||
#define BIO_set_sock_type(b, t) BIO_ctrl(b, BIO_C_SET_SOCK_TYPE, (t), NULL)
|
||||
#define BIO_get_sock_type(b) BIO_ctrl(b, BIO_C_GET_SOCK_TYPE, 0, NULL)
|
||||
#define BIO_get0_dgram_bio(b, p) BIO_ctrl(b, BIO_C_GET_DGRAM_BIO, 0, (void *)(BIO **)(p))
|
||||
|
||||
/* BIO_s_accept() */
|
||||
#define BIO_set_accept_name(b, name) BIO_ctrl(b, BIO_C_SET_ACCEPT, 0, \
|
||||
@@ -393,6 +555,7 @@ struct bio_dgram_sctp_prinfo {
|
||||
(char *)(bio))
|
||||
#define BIO_set_accept_ip_family(b, f) BIO_int_ctrl(b, BIO_C_SET_ACCEPT, 4, f)
|
||||
#define BIO_get_accept_ip_family(b) BIO_ctrl(b, BIO_C_GET_ACCEPT, 4, NULL)
|
||||
#define BIO_set_tfo_accept(b, n) BIO_ctrl(b, BIO_C_SET_ACCEPT, 5, (n) ? (void *)"a" : NULL)
|
||||
|
||||
/* Aliases kept for backward compatibility */
|
||||
#define BIO_BIND_NORMAL 0
|
||||
@@ -400,11 +563,10 @@ struct bio_dgram_sctp_prinfo {
|
||||
#define BIO_BIND_REUSEADDR_IF_UNUSED BIO_SOCK_REUSEADDR
|
||||
#define BIO_set_bind_mode(b, mode) BIO_ctrl(b, BIO_C_SET_BIND_MODE, mode, NULL)
|
||||
#define BIO_get_bind_mode(b) BIO_ctrl(b, BIO_C_GET_BIND_MODE, 0, NULL)
|
||||
#endif /* OPENSSL_NO_SOCK */
|
||||
|
||||
/* BIO_s_accept() and BIO_s_connect() */
|
||||
#define BIO_do_connect(b) BIO_do_handshake(b)
|
||||
#define BIO_do_accept(b) BIO_do_handshake(b)
|
||||
# endif /* OPENSSL_NO_SOCK */
|
||||
|
||||
#define BIO_do_handshake(b) BIO_ctrl(b, BIO_C_DO_STATE_MACHINE, 0, NULL)
|
||||
|
||||
@@ -478,7 +640,6 @@ int BIO_read_filename(BIO *b, const char *name);
|
||||
#define BIO_dup_state(b, ret) BIO_ctrl(b, BIO_CTRL_DUP, 0, (char *)(ret))
|
||||
|
||||
#define BIO_reset(b) (int)BIO_ctrl(b, BIO_CTRL_RESET, 0, NULL)
|
||||
# define BIO_eof(b) (int)BIO_ctrl(b,BIO_CTRL_EOF,0,NULL)
|
||||
#define BIO_set_close(b, c) (int)BIO_ctrl(b, BIO_CTRL_SET_CLOSE, (c), NULL)
|
||||
#define BIO_get_close(b) (int)BIO_ctrl(b, BIO_CTRL_GET_CLOSE, 0, NULL)
|
||||
#define BIO_pending(b) (int)BIO_ctrl(b, BIO_CTRL_PENDING, 0, NULL)
|
||||
@@ -521,13 +682,42 @@ int BIO_ctrl_reset_read_request(BIO *b);
|
||||
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_GET_PEER, 0, (char *)(peer))
|
||||
#define BIO_dgram_set_peer(b, peer) \
|
||||
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_SET_PEER, 0, (char *)(peer))
|
||||
#define BIO_dgram_detect_peer_addr(b, peer) \
|
||||
(int)BIO_ctrl(b, BIO_CTRL_DGRAM_DETECT_PEER_ADDR, 0, (char *)(peer))
|
||||
#define BIO_dgram_get_mtu_overhead(b) \
|
||||
(unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU_OVERHEAD, 0, NULL)
|
||||
#define BIO_dgram_get_local_addr_cap(b) \
|
||||
(int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_LOCAL_ADDR_CAP, 0, NULL)
|
||||
#define BIO_dgram_get_local_addr_enable(b, penable) \
|
||||
(int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_LOCAL_ADDR_ENABLE, 0, (char *)(penable))
|
||||
#define BIO_dgram_set_local_addr_enable(b, enable) \
|
||||
(int)BIO_ctrl((b), BIO_CTRL_DGRAM_SET_LOCAL_ADDR_ENABLE, (enable), NULL)
|
||||
#define BIO_dgram_get_effective_caps(b) \
|
||||
(uint32_t)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_EFFECTIVE_CAPS, 0, NULL)
|
||||
#define BIO_dgram_get_caps(b) \
|
||||
(uint32_t)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_CAPS, 0, NULL)
|
||||
#define BIO_dgram_set_caps(b, caps) \
|
||||
(int)BIO_ctrl((b), BIO_CTRL_DGRAM_SET_CAPS, (long)(caps), NULL)
|
||||
#define BIO_dgram_get_no_trunc(b) \
|
||||
(unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_NO_TRUNC, 0, NULL)
|
||||
#define BIO_dgram_set_no_trunc(b, enable) \
|
||||
(int)BIO_ctrl((b), BIO_CTRL_DGRAM_SET_NO_TRUNC, (enable), NULL)
|
||||
#define BIO_dgram_get_mtu(b) \
|
||||
(unsigned int)BIO_ctrl((b), BIO_CTRL_DGRAM_GET_MTU, 0, NULL)
|
||||
#define BIO_dgram_set_mtu(b, mtu) \
|
||||
(int)BIO_ctrl((b), BIO_CTRL_DGRAM_SET_MTU, (mtu), NULL)
|
||||
#define BIO_dgram_set0_local_addr(b, addr) \
|
||||
(int)BIO_ctrl((b), BIO_CTRL_DGRAM_SET0_LOCAL_ADDR, 0, (addr))
|
||||
|
||||
/* ctrl macros for BIO_f_prefix */
|
||||
#define BIO_set_prefix(b, p) BIO_ctrl((b), BIO_CTRL_SET_PREFIX, 0, (void *)(p))
|
||||
#define BIO_set_indent(b, i) BIO_ctrl((b), BIO_CTRL_SET_INDENT, (i), NULL)
|
||||
#define BIO_get_indent(b) BIO_ctrl((b), BIO_CTRL_GET_INDENT, 0, NULL)
|
||||
|
||||
#define BIO_get_ex_new_index(l, p, newf, dupf, freef) \
|
||||
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_BIO, l, p, newf, dupf, freef)
|
||||
int BIO_set_ex_data(BIO *bio, int idx, void *data);
|
||||
void *BIO_get_ex_data(BIO *bio, int idx);
|
||||
void *BIO_get_ex_data(const BIO *bio, int idx);
|
||||
uint64_t BIO_number_read(BIO *bio);
|
||||
uint64_t BIO_number_written(BIO *bio);
|
||||
|
||||
@@ -543,9 +733,11 @@ int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix,
|
||||
|
||||
const BIO_METHOD *BIO_s_file(void);
|
||||
BIO *BIO_new_file(const char *filename, const char *mode);
|
||||
BIO *BIO_new_from_core_bio(OSSL_LIB_CTX *libctx, OSSL_CORE_BIO *corebio);
|
||||
#ifndef OPENSSL_NO_STDIO
|
||||
BIO *BIO_new_fp(FILE *stream, int close_flag);
|
||||
#endif
|
||||
BIO *BIO_new_ex(OSSL_LIB_CTX *libctx, const BIO_METHOD *method);
|
||||
BIO *BIO_new(const BIO_METHOD *type);
|
||||
int BIO_free(BIO *a);
|
||||
void BIO_set_data(BIO *a, void *ptr);
|
||||
@@ -558,12 +750,22 @@ void BIO_vfree(BIO *a);
|
||||
int BIO_up_ref(BIO *a);
|
||||
int BIO_read(BIO *b, void *data, int dlen);
|
||||
int BIO_read_ex(BIO *b, void *data, size_t dlen, size_t *readbytes);
|
||||
__owur int BIO_recvmmsg(BIO *b, BIO_MSG *msg,
|
||||
size_t stride, size_t num_msg, uint64_t flags,
|
||||
size_t *msgs_processed);
|
||||
int BIO_gets(BIO *bp, char *buf, int size);
|
||||
int BIO_get_line(BIO *bio, char *buf, int size);
|
||||
int BIO_write(BIO *b, const void *data, int dlen);
|
||||
int BIO_write_ex(BIO *b, const void *data, size_t dlen, size_t *written);
|
||||
__owur int BIO_sendmmsg(BIO *b, BIO_MSG *msg,
|
||||
size_t stride, size_t num_msg, uint64_t flags,
|
||||
size_t *msgs_processed);
|
||||
__owur int BIO_get_rpoll_descriptor(BIO *b, BIO_POLL_DESCRIPTOR *desc);
|
||||
__owur int BIO_get_wpoll_descriptor(BIO *b, BIO_POLL_DESCRIPTOR *desc);
|
||||
int BIO_puts(BIO *bp, const char *buf);
|
||||
int BIO_indent(BIO *b, int indent, int max);
|
||||
long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg);
|
||||
int BIO_eof(BIO *b);
|
||||
long BIO_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp);
|
||||
void *BIO_ptr_ctrl(BIO *bp, int cmd, long larg);
|
||||
long BIO_int_ctrl(BIO *bp, int cmd, long larg, int iarg);
|
||||
@@ -583,10 +785,10 @@ int BIO_nread(BIO *bio, char **buf, int num);
|
||||
int BIO_nwrite0(BIO *bio, char **buf);
|
||||
int BIO_nwrite(BIO *bio, char **buf, int num);
|
||||
|
||||
long BIO_debug_callback(BIO *bio, int cmd, const char *argp, int argi,
|
||||
long argl, long ret);
|
||||
|
||||
const BIO_METHOD *BIO_s_mem(void);
|
||||
#ifndef OPENSSL_NO_DGRAM
|
||||
const BIO_METHOD *BIO_s_dgram_mem(void);
|
||||
#endif
|
||||
const BIO_METHOD *BIO_s_secmem(void);
|
||||
BIO *BIO_new_mem_buf(const void *buf, int len);
|
||||
#ifndef OPENSSL_NO_SOCK
|
||||
@@ -600,9 +802,13 @@ const BIO_METHOD *BIO_s_bio(void);
|
||||
const BIO_METHOD *BIO_s_null(void);
|
||||
const BIO_METHOD *BIO_f_null(void);
|
||||
const BIO_METHOD *BIO_f_buffer(void);
|
||||
const BIO_METHOD *BIO_f_readbuffer(void);
|
||||
const BIO_METHOD *BIO_f_linebuffer(void);
|
||||
const BIO_METHOD *BIO_f_nbio_test(void);
|
||||
const BIO_METHOD *BIO_f_prefix(void);
|
||||
const BIO_METHOD *BIO_s_core(void);
|
||||
#ifndef OPENSSL_NO_DGRAM
|
||||
const BIO_METHOD *BIO_s_dgram_pair(void);
|
||||
const BIO_METHOD *BIO_s_datagram(void);
|
||||
int BIO_dgram_non_fatal_error(int error);
|
||||
BIO *BIO_new_dgram(int fd, int close_flag);
|
||||
@@ -611,9 +817,7 @@ const BIO_METHOD *BIO_s_datagram_sctp(void);
|
||||
BIO *BIO_new_dgram_sctp(int fd, int close_flag);
|
||||
int BIO_dgram_is_sctp(BIO *bio);
|
||||
int BIO_dgram_sctp_notification_cb(BIO *b,
|
||||
void (*handle_notifications) (BIO *bio,
|
||||
void *context,
|
||||
void *buf),
|
||||
BIO_dgram_sctp_notification_handler_fn handle_notifications,
|
||||
void *context);
|
||||
int BIO_dgram_sctp_wait_for_dry(BIO *b);
|
||||
int BIO_dgram_sctp_msg_waiting(BIO *b);
|
||||
@@ -623,25 +827,32 @@ int BIO_dgram_sctp_msg_waiting(BIO *b);
|
||||
#ifndef OPENSSL_NO_SOCK
|
||||
int BIO_sock_should_retry(int i);
|
||||
int BIO_sock_non_fatal_error(int error);
|
||||
int BIO_err_is_non_fatal(unsigned int errcode);
|
||||
int BIO_socket_wait(int fd, int for_read, time_t max_time);
|
||||
#endif
|
||||
long BIO_set_send_flags(BIO *b, int flags);
|
||||
int BIO_wait(BIO *bio, time_t max_time, unsigned int nap_milliseconds);
|
||||
int BIO_do_connect_retry(BIO *bio, int timeout, int nap_milliseconds);
|
||||
|
||||
int BIO_fd_should_retry(int i);
|
||||
int BIO_fd_non_fatal_error(int error);
|
||||
int BIO_dump_cb(int (*cb)(const void *data, size_t len, void *u),
|
||||
void *u, const char *s, int len);
|
||||
void *u, const void *s, int len);
|
||||
int BIO_dump_indent_cb(int (*cb)(const void *data, size_t len, void *u),
|
||||
void *u, const char *s, int len, int indent);
|
||||
int BIO_dump(BIO *b, const char *bytes, int len);
|
||||
int BIO_dump_indent(BIO *b, const char *bytes, int len, int indent);
|
||||
void *u, const void *s, int len, int indent);
|
||||
int BIO_dump(BIO *b, const void *bytes, int len);
|
||||
int BIO_dump_indent(BIO *b, const void *bytes, int len, int indent);
|
||||
#ifndef OPENSSL_NO_STDIO
|
||||
int BIO_dump_fp(FILE *fp, const char *s, int len);
|
||||
int BIO_dump_indent_fp(FILE *fp, const char *s, int len, int indent);
|
||||
int BIO_dump_fp(FILE *fp, const void *s, int len);
|
||||
int BIO_dump_indent_fp(FILE *fp, const void *s, int len, int indent);
|
||||
#endif
|
||||
int BIO_hex_string(BIO *out, int indent, int width, unsigned char *data,
|
||||
int BIO_hex_string(BIO *out, int indent, int width, const void *data,
|
||||
int datalen);
|
||||
|
||||
#ifndef OPENSSL_NO_SOCK
|
||||
BIO_ADDR *BIO_ADDR_new(void);
|
||||
int BIO_ADDR_copy(BIO_ADDR *dst, const BIO_ADDR *src);
|
||||
BIO_ADDR *BIO_ADDR_dup(const BIO_ADDR *ap);
|
||||
int BIO_ADDR_rawmake(BIO_ADDR *ap, int family,
|
||||
const void *where, size_t wherelen, unsigned short port);
|
||||
void BIO_ADDR_free(BIO_ADDR *);
|
||||
@@ -661,12 +872,14 @@ const BIO_ADDR *BIO_ADDRINFO_address(const BIO_ADDRINFO *bai);
|
||||
void BIO_ADDRINFO_free(BIO_ADDRINFO *bai);
|
||||
|
||||
enum BIO_hostserv_priorities {
|
||||
BIO_PARSE_PRIO_HOST, BIO_PARSE_PRIO_SERV
|
||||
BIO_PARSE_PRIO_HOST,
|
||||
BIO_PARSE_PRIO_SERV
|
||||
};
|
||||
int BIO_parse_hostserv(const char *hostserv, char **host, char **service,
|
||||
enum BIO_hostserv_priorities hostserv_prio);
|
||||
enum BIO_lookup_type {
|
||||
BIO_LOOKUP_CLIENT, BIO_LOOKUP_SERVER
|
||||
BIO_LOOKUP_CLIENT,
|
||||
BIO_LOOKUP_SERVER
|
||||
};
|
||||
int BIO_lookup(const char *host, const char *service,
|
||||
enum BIO_lookup_type lookup_type,
|
||||
@@ -678,16 +891,19 @@ int BIO_sock_error(int sock);
|
||||
int BIO_socket_ioctl(int fd, long type, void *arg);
|
||||
int BIO_socket_nbio(int fd, int mode);
|
||||
int BIO_sock_init(void);
|
||||
# if OPENSSL_API_COMPAT < 0x10100000L
|
||||
# define BIO_sock_cleanup() while(0) continue
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
#define BIO_sock_cleanup() \
|
||||
while (0) \
|
||||
continue
|
||||
#endif
|
||||
int BIO_set_tcp_ndelay(int sock, int turn_on);
|
||||
|
||||
DEPRECATEDIN_1_1_0(struct hostent *BIO_gethostbyname(const char *name))
|
||||
DEPRECATEDIN_1_1_0(int BIO_get_port(const char *str, unsigned short *port_ptr))
|
||||
DEPRECATEDIN_1_1_0(int BIO_get_host_ip(const char *str, unsigned char *ip))
|
||||
DEPRECATEDIN_1_1_0(int BIO_get_accept_socket(char *host_port, int mode))
|
||||
DEPRECATEDIN_1_1_0(int BIO_accept(int sock, char **ip_port))
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
OSSL_DEPRECATEDIN_1_1_0 struct hostent *BIO_gethostbyname(const char *name);
|
||||
OSSL_DEPRECATEDIN_1_1_0 int BIO_get_port(const char *str, unsigned short *port_ptr);
|
||||
OSSL_DEPRECATEDIN_1_1_0 int BIO_get_host_ip(const char *str, unsigned char *ip);
|
||||
OSSL_DEPRECATEDIN_1_1_0 int BIO_get_accept_socket(char *host_port, int mode);
|
||||
OSSL_DEPRECATEDIN_1_1_0 int BIO_accept(int sock, char **ip_port);
|
||||
#endif
|
||||
|
||||
union BIO_sock_info_u {
|
||||
BIO_ADDR *addr;
|
||||
@@ -703,6 +919,7 @@ int BIO_sock_info(int sock,
|
||||
#define BIO_SOCK_KEEPALIVE 0x04
|
||||
#define BIO_SOCK_NONBLOCK 0x08
|
||||
#define BIO_SOCK_NODELAY 0x10
|
||||
#define BIO_SOCK_TFO 0x20
|
||||
|
||||
int BIO_socket(int domain, int socktype, int protocol, int options);
|
||||
int BIO_connect(int sock, const BIO_ADDR *addr, int options);
|
||||
@@ -720,6 +937,11 @@ BIO *BIO_new_fd(int fd, int close_flag);
|
||||
|
||||
int BIO_new_bio_pair(BIO **bio1, size_t writebuf1,
|
||||
BIO **bio2, size_t writebuf2);
|
||||
#ifndef OPENSSL_NO_DGRAM
|
||||
int BIO_new_bio_dgram_pair(BIO **bio1, size_t writebuf1,
|
||||
BIO **bio2, size_t writebuf2);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If successful, returns 1 and in *bio1, *bio2 two BIO pair endpoints.
|
||||
* Otherwise returns 0 and sets *bio1 and *bio2 to NULL. Size 0 uses default
|
||||
@@ -734,6 +956,7 @@ void BIO_copy_next_retry(BIO *b);
|
||||
|
||||
#define ossl_bio__attr__(x)
|
||||
#if defined(__GNUC__) && defined(__STDC_VERSION__) \
|
||||
&& !defined(__MINGW32__) && !defined(__MINGW64__) \
|
||||
&& !defined(__APPLE__)
|
||||
/*
|
||||
* Because we support the 'z' modifier, which made its appearance in C99,
|
||||
@@ -760,41 +983,56 @@ ossl_bio__attr__((__format__(ossl_bio__printf__, 3, 0)));
|
||||
#undef ossl_bio__attr__
|
||||
#undef ossl_bio__printf__
|
||||
|
||||
|
||||
BIO_METHOD *BIO_meth_new(int type, const char *name);
|
||||
void BIO_meth_free(BIO_METHOD *biom);
|
||||
int (*BIO_meth_get_write(const BIO_METHOD *biom)) (BIO *, const char *, int);
|
||||
int (*BIO_meth_get_write_ex(const BIO_METHOD *biom)) (BIO *, const char *, size_t,
|
||||
size_t *);
|
||||
int BIO_meth_set_write(BIO_METHOD *biom,
|
||||
int (*write)(BIO *, const char *, int));
|
||||
int BIO_meth_set_write_ex(BIO_METHOD *biom,
|
||||
int (*bwrite)(BIO *, const char *, size_t, size_t *));
|
||||
int (*BIO_meth_get_read(const BIO_METHOD *biom)) (BIO *, char *, int);
|
||||
int (*BIO_meth_get_read_ex(const BIO_METHOD *biom)) (BIO *, char *, size_t, size_t *);
|
||||
int BIO_meth_set_sendmmsg(BIO_METHOD *biom,
|
||||
int (*f)(BIO *, BIO_MSG *, size_t, size_t,
|
||||
uint64_t, size_t *));
|
||||
int BIO_meth_set_read(BIO_METHOD *biom,
|
||||
int (*read)(BIO *, char *, int));
|
||||
int BIO_meth_set_read_ex(BIO_METHOD *biom,
|
||||
int (*bread)(BIO *, char *, size_t, size_t *));
|
||||
int (*BIO_meth_get_puts(const BIO_METHOD *biom)) (BIO *, const char *);
|
||||
int BIO_meth_set_recvmmsg(BIO_METHOD *biom,
|
||||
int (*f)(BIO *, BIO_MSG *, size_t, size_t,
|
||||
uint64_t, size_t *));
|
||||
int BIO_meth_set_puts(BIO_METHOD *biom,
|
||||
int (*puts)(BIO *, const char *));
|
||||
int (*BIO_meth_get_gets(const BIO_METHOD *biom)) (BIO *, char *, int);
|
||||
int BIO_meth_set_gets(BIO_METHOD *biom,
|
||||
int (*gets) (BIO *, char *, int));
|
||||
long (*BIO_meth_get_ctrl(const BIO_METHOD *biom)) (BIO *, int, long, void *);
|
||||
int (*ossl_gets)(BIO *, char *, int));
|
||||
int BIO_meth_set_ctrl(BIO_METHOD *biom,
|
||||
long (*ctrl)(BIO *, int, long, void *));
|
||||
int (*BIO_meth_get_create(const BIO_METHOD *bion)) (BIO *);
|
||||
int BIO_meth_set_create(BIO_METHOD *biom, int (*create)(BIO *));
|
||||
int (*BIO_meth_get_destroy(const BIO_METHOD *biom)) (BIO *);
|
||||
int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *));
|
||||
long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))
|
||||
(BIO *, int, BIO_info_cb *);
|
||||
int BIO_meth_set_callback_ctrl(BIO_METHOD *biom,
|
||||
long (*callback_ctrl)(BIO *, int,
|
||||
BIO_info_cb *));
|
||||
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_5
|
||||
OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_write(const BIO_METHOD *biom))(BIO *, const char *,
|
||||
int);
|
||||
OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_write_ex(const BIO_METHOD *biom))(BIO *, const char *,
|
||||
size_t, size_t *);
|
||||
OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_sendmmsg(const BIO_METHOD *biom))(BIO *, BIO_MSG *,
|
||||
size_t, size_t,
|
||||
uint64_t, size_t *);
|
||||
OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_read(const BIO_METHOD *biom))(BIO *, char *, int);
|
||||
OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_read_ex(const BIO_METHOD *biom))(BIO *, char *,
|
||||
size_t, size_t *);
|
||||
OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_recvmmsg(const BIO_METHOD *biom))(BIO *, BIO_MSG *,
|
||||
size_t, size_t,
|
||||
uint64_t, size_t *);
|
||||
OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_puts(const BIO_METHOD *biom))(BIO *, const char *);
|
||||
OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_gets(const BIO_METHOD *biom))(BIO *, char *, int);
|
||||
OSSL_DEPRECATEDIN_3_5 long (*BIO_meth_get_ctrl(const BIO_METHOD *biom))(BIO *, int,
|
||||
long, void *);
|
||||
OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_create(const BIO_METHOD *bion))(BIO *);
|
||||
OSSL_DEPRECATEDIN_3_5 int (*BIO_meth_get_destroy(const BIO_METHOD *biom))(BIO *);
|
||||
OSSL_DEPRECATEDIN_3_5 long (*BIO_meth_get_callback_ctrl(const BIO_METHOD *biom))(BIO *, int,
|
||||
BIO_info_cb *);
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,84 +1,20 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_BIOERR_H
|
||||
# define HEADER_BIOERR_H
|
||||
#ifndef OPENSSL_BIOERR_H
|
||||
#define OPENSSL_BIOERR_H
|
||||
#pragma once
|
||||
|
||||
# ifndef HEADER_SYMHACKS_H
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/symhacks.h>
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
int ERR_load_BIO_strings(void);
|
||||
|
||||
/*
|
||||
* BIO function codes.
|
||||
*/
|
||||
# define BIO_F_ACPT_STATE 100
|
||||
# define BIO_F_ADDRINFO_WRAP 148
|
||||
# define BIO_F_ADDR_STRINGS 134
|
||||
# define BIO_F_BIO_ACCEPT 101
|
||||
# define BIO_F_BIO_ACCEPT_EX 137
|
||||
# define BIO_F_BIO_ACCEPT_NEW 152
|
||||
# define BIO_F_BIO_ADDR_NEW 144
|
||||
# define BIO_F_BIO_BIND 147
|
||||
# define BIO_F_BIO_CALLBACK_CTRL 131
|
||||
# define BIO_F_BIO_CONNECT 138
|
||||
# define BIO_F_BIO_CONNECT_NEW 153
|
||||
# define BIO_F_BIO_CTRL 103
|
||||
# define BIO_F_BIO_GETS 104
|
||||
# define BIO_F_BIO_GET_HOST_IP 106
|
||||
# define BIO_F_BIO_GET_NEW_INDEX 102
|
||||
# define BIO_F_BIO_GET_PORT 107
|
||||
# define BIO_F_BIO_LISTEN 139
|
||||
# define BIO_F_BIO_LOOKUP 135
|
||||
# define BIO_F_BIO_LOOKUP_EX 143
|
||||
# define BIO_F_BIO_MAKE_PAIR 121
|
||||
# define BIO_F_BIO_METH_NEW 146
|
||||
# define BIO_F_BIO_NEW 108
|
||||
# define BIO_F_BIO_NEW_DGRAM_SCTP 145
|
||||
# define BIO_F_BIO_NEW_FILE 109
|
||||
# define BIO_F_BIO_NEW_MEM_BUF 126
|
||||
# define BIO_F_BIO_NREAD 123
|
||||
# define BIO_F_BIO_NREAD0 124
|
||||
# define BIO_F_BIO_NWRITE 125
|
||||
# define BIO_F_BIO_NWRITE0 122
|
||||
# define BIO_F_BIO_PARSE_HOSTSERV 136
|
||||
# define BIO_F_BIO_PUTS 110
|
||||
# define BIO_F_BIO_READ 111
|
||||
# define BIO_F_BIO_READ_EX 105
|
||||
# define BIO_F_BIO_READ_INTERN 120
|
||||
# define BIO_F_BIO_SOCKET 140
|
||||
# define BIO_F_BIO_SOCKET_NBIO 142
|
||||
# define BIO_F_BIO_SOCK_INFO 141
|
||||
# define BIO_F_BIO_SOCK_INIT 112
|
||||
# define BIO_F_BIO_WRITE 113
|
||||
# define BIO_F_BIO_WRITE_EX 119
|
||||
# define BIO_F_BIO_WRITE_INTERN 128
|
||||
# define BIO_F_BUFFER_CTRL 114
|
||||
# define BIO_F_CONN_CTRL 127
|
||||
# define BIO_F_CONN_STATE 115
|
||||
# define BIO_F_DGRAM_SCTP_NEW 149
|
||||
# define BIO_F_DGRAM_SCTP_READ 132
|
||||
# define BIO_F_DGRAM_SCTP_WRITE 133
|
||||
# define BIO_F_DOAPR_OUTCH 150
|
||||
# define BIO_F_FILE_CTRL 116
|
||||
# define BIO_F_FILE_READ 130
|
||||
# define BIO_F_LINEBUFFER_CTRL 129
|
||||
# define BIO_F_LINEBUFFER_NEW 151
|
||||
# define BIO_F_MEM_WRITE 117
|
||||
# define BIO_F_NBIOF_NEW 154
|
||||
# define BIO_F_SLG_WRITE 155
|
||||
# define BIO_F_SSL_NEW 118
|
||||
#include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
/*
|
||||
* BIO reason codes.
|
||||
@@ -89,6 +25,7 @@ int ERR_load_BIO_strings(void);
|
||||
#define BIO_R_BAD_FOPEN_MODE 101
|
||||
#define BIO_R_BROKEN_PIPE 124
|
||||
#define BIO_R_CONNECT_ERROR 103
|
||||
#define BIO_R_CONNECT_TIMEOUT 147
|
||||
#define BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET 107
|
||||
#define BIO_R_GETSOCKNAME_ERROR 132
|
||||
#define BIO_R_GETSOCKNAME_TRUNCATED_ADDRESS 133
|
||||
@@ -98,20 +35,27 @@ int ERR_load_BIO_strings(void);
|
||||
#define BIO_R_IN_USE 123
|
||||
#define BIO_R_LENGTH_TOO_LONG 102
|
||||
#define BIO_R_LISTEN_V6_ONLY 136
|
||||
#define BIO_R_LOCAL_ADDR_NOT_AVAILABLE 111
|
||||
#define BIO_R_LOOKUP_RETURNED_NOTHING 142
|
||||
#define BIO_R_MALFORMED_HOST_OR_SERVICE 130
|
||||
#define BIO_R_NBIO_CONNECT_ERROR 110
|
||||
#define BIO_R_NON_FATAL 112
|
||||
#define BIO_R_NO_ACCEPT_ADDR_OR_SERVICE_SPECIFIED 143
|
||||
#define BIO_R_NO_HOSTNAME_OR_SERVICE_SPECIFIED 144
|
||||
#define BIO_R_NO_PORT_DEFINED 113
|
||||
#define BIO_R_NO_SUCH_FILE 128
|
||||
# define BIO_R_NULL_PARAMETER 115
|
||||
#define BIO_R_NULL_PARAMETER 115 /* unused */
|
||||
#define BIO_R_TFO_DISABLED 106
|
||||
#define BIO_R_TFO_NO_KERNEL_SUPPORT 108
|
||||
#define BIO_R_TRANSFER_ERROR 104
|
||||
#define BIO_R_TRANSFER_TIMEOUT 105
|
||||
#define BIO_R_UNABLE_TO_BIND_SOCKET 117
|
||||
#define BIO_R_UNABLE_TO_CREATE_SOCKET 118
|
||||
#define BIO_R_UNABLE_TO_KEEPALIVE 137
|
||||
#define BIO_R_UNABLE_TO_LISTEN_SOCKET 119
|
||||
#define BIO_R_UNABLE_TO_NODELAY 138
|
||||
#define BIO_R_UNABLE_TO_REUSEADDR 139
|
||||
#define BIO_R_UNABLE_TO_TFO 109
|
||||
#define BIO_R_UNAVAILABLE_IP_FAMILY 145
|
||||
#define BIO_R_UNINITIALIZED 120
|
||||
#define BIO_R_UNKNOWN_INFO_TYPE 140
|
||||
@@ -120,5 +64,7 @@ int ERR_load_BIO_strings(void);
|
||||
#define BIO_R_UNSUPPORTED_PROTOCOL_FAMILY 131
|
||||
#define BIO_R_WRITE_TO_READ_ONLY_BIO 126
|
||||
#define BIO_R_WSASTARTUP 122
|
||||
#define BIO_R_PORT_MISMATCH 150
|
||||
#define BIO_R_PEER_ADDR_NOT_AVAILABLE 151
|
||||
|
||||
#endif
|
||||
@@ -1,14 +1,20 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_BLOWFISH_H
|
||||
#ifndef OPENSSL_BLOWFISH_H
|
||||
#define OPENSSL_BLOWFISH_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_BLOWFISH_H
|
||||
#endif
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
|
||||
@@ -18,6 +24,10 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define BF_BLOCK 8
|
||||
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
|
||||
#define BF_ENCRYPT 1
|
||||
#define BF_DECRYPT 0
|
||||
|
||||
@@ -26,32 +36,39 @@ extern "C" {
|
||||
* ! BF_LONG has to be at least 32 bits wide. !
|
||||
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
*/
|
||||
# define BF_LONG unsigned int
|
||||
typedef unsigned int BF_LONG;
|
||||
|
||||
#define BF_ROUNDS 16
|
||||
# define BF_BLOCK 8
|
||||
|
||||
typedef struct bf_key_st {
|
||||
BF_LONG P[BF_ROUNDS + 2];
|
||||
BF_LONG S[4 * 256];
|
||||
} BF_KEY;
|
||||
|
||||
void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
|
||||
|
||||
void BF_encrypt(BF_LONG *data, const BF_KEY *key);
|
||||
void BF_decrypt(BF_LONG *data, const BF_KEY *key);
|
||||
|
||||
void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const BF_KEY *key, int enc);
|
||||
void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, long length,
|
||||
const BF_KEY *schedule, unsigned char *ivec, int enc);
|
||||
void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out,
|
||||
#endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 void BF_set_key(BF_KEY *key, int len,
|
||||
const unsigned char *data);
|
||||
OSSL_DEPRECATEDIN_3_0 void BF_encrypt(BF_LONG *data, const BF_KEY *key);
|
||||
OSSL_DEPRECATEDIN_3_0 void BF_decrypt(BF_LONG *data, const BF_KEY *key);
|
||||
OSSL_DEPRECATEDIN_3_0 void BF_ecb_encrypt(const unsigned char *in,
|
||||
unsigned char *out, const BF_KEY *key,
|
||||
int enc);
|
||||
OSSL_DEPRECATEDIN_3_0 void BF_cbc_encrypt(const unsigned char *in,
|
||||
unsigned char *out, long length,
|
||||
const BF_KEY *schedule,
|
||||
unsigned char *ivec, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0 void BF_cfb64_encrypt(const unsigned char *in,
|
||||
unsigned char *out,
|
||||
long length, const BF_KEY *schedule,
|
||||
unsigned char *ivec, int *num, int enc);
|
||||
void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out,
|
||||
unsigned char *ivec, int *num,
|
||||
int enc);
|
||||
OSSL_DEPRECATEDIN_3_0 void BF_ofb64_encrypt(const unsigned char *in,
|
||||
unsigned char *out,
|
||||
long length, const BF_KEY *schedule,
|
||||
unsigned char *ivec, int *num);
|
||||
const char *BF_options(void);
|
||||
OSSL_DEPRECATEDIN_3_0 const char *BF_options(void);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,22 +1,28 @@
|
||||
/*
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_BN_H
|
||||
#ifndef OPENSSL_BN_H
|
||||
#define OPENSSL_BN_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_BN_H
|
||||
#endif
|
||||
|
||||
#include <openssl/e_os2.h>
|
||||
#ifndef OPENSSL_NO_STDIO
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
#include <openssl/opensslconf.h>
|
||||
# include <openssl/ossl_typ.h>
|
||||
#include <openssl/types.h>
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/bnerr.h>
|
||||
|
||||
@@ -28,7 +34,7 @@ extern "C" {
|
||||
* 64-bit processor with LP64 ABI
|
||||
*/
|
||||
#ifdef SIXTY_FOUR_BIT_LONG
|
||||
# define BN_ULONG unsigned long
|
||||
typedef unsigned long BN_ULONG;
|
||||
#define BN_BYTES 8
|
||||
#endif
|
||||
|
||||
@@ -36,12 +42,12 @@ extern "C" {
|
||||
* 64-bit processor other than LP64 ABI
|
||||
*/
|
||||
#ifdef SIXTY_FOUR_BIT
|
||||
# define BN_ULONG unsigned long long
|
||||
typedef unsigned long long BN_ULONG;
|
||||
#define BN_BYTES 8
|
||||
#endif
|
||||
|
||||
#ifdef THIRTY_TWO_BIT
|
||||
# define BN_ULONG unsigned int
|
||||
typedef unsigned int BN_ULONG;
|
||||
#define BN_BYTES 4
|
||||
#endif
|
||||
|
||||
@@ -61,7 +67,7 @@ extern "C" {
|
||||
#define BN_FLG_CONSTTIME 0x04
|
||||
#define BN_FLG_SECURE 0x08
|
||||
|
||||
# if OPENSSL_API_COMPAT < 0x00908000L
|
||||
#ifndef OPENSSL_NO_DEPRECATED_0_9_8
|
||||
/* deprecated name for the flag */
|
||||
#define BN_FLG_EXP_CONSTTIME BN_FLG_CONSTTIME
|
||||
#define BN_FLG_FREE 0x8000 /* used for debugging */
|
||||
@@ -103,7 +109,8 @@ void BN_GENCB_set(BN_GENCB *gencb, int (*callback) (int, int, BN_GENCB *),
|
||||
|
||||
void *BN_GENCB_get_arg(BN_GENCB *cb);
|
||||
|
||||
# define BN_prime_checks 0 /* default: select number of iterations based
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define BN_prime_checks 0 /* default: select number of iterations based \
|
||||
* on the size of the number */
|
||||
|
||||
/*
|
||||
@@ -169,14 +176,14 @@ void *BN_GENCB_get_arg(BN_GENCB *cb);
|
||||
* (b) >= 6 | >= 12 | 34 | 64 bit
|
||||
*/
|
||||
|
||||
# define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : \
|
||||
(b) >= 1345 ? 4 : \
|
||||
(b) >= 476 ? 5 : \
|
||||
(b) >= 400 ? 6 : \
|
||||
(b) >= 347 ? 7 : \
|
||||
(b) >= 308 ? 8 : \
|
||||
(b) >= 55 ? 27 : \
|
||||
/* b >= 6 */ 34)
|
||||
#define BN_prime_checks_for_size(b) ((b) >= 3747 ? 3 : (b) >= 1345 ? 4 \
|
||||
: (b) >= 476 ? 5 \
|
||||
: (b) >= 400 ? 6 \
|
||||
: (b) >= 347 ? 7 \
|
||||
: (b) >= 308 ? 8 \
|
||||
: (b) >= 55 ? 27 \
|
||||
: /* b >= 6 */ 34)
|
||||
#endif
|
||||
|
||||
#define BN_num_bytes(a) ((BN_num_bits(a) + 7) / 8)
|
||||
|
||||
@@ -190,7 +197,7 @@ int BN_is_odd(const BIGNUM *a);
|
||||
|
||||
void BN_zero_ex(BIGNUM *a);
|
||||
|
||||
# if OPENSSL_API_COMPAT >= 0x00908000L
|
||||
#if OPENSSL_API_LEVEL > 908
|
||||
#define BN_zero(a) BN_zero_ex(a)
|
||||
#else
|
||||
#define BN_zero(a) (BN_set_word((a), 0))
|
||||
@@ -198,18 +205,32 @@ void BN_zero_ex(BIGNUM *a);
|
||||
|
||||
const BIGNUM *BN_value_one(void);
|
||||
char *BN_options(void);
|
||||
BN_CTX *BN_CTX_new_ex(OSSL_LIB_CTX *ctx);
|
||||
BN_CTX *BN_CTX_new(void);
|
||||
BN_CTX *BN_CTX_secure_new_ex(OSSL_LIB_CTX *ctx);
|
||||
BN_CTX *BN_CTX_secure_new(void);
|
||||
void BN_CTX_free(BN_CTX *c);
|
||||
void BN_CTX_start(BN_CTX *ctx);
|
||||
BIGNUM *BN_CTX_get(BN_CTX *ctx);
|
||||
void BN_CTX_end(BN_CTX *ctx);
|
||||
int BN_rand_ex(BIGNUM *rnd, int bits, int top, int bottom,
|
||||
unsigned int strength, BN_CTX *ctx);
|
||||
int BN_rand(BIGNUM *rnd, int bits, int top, int bottom);
|
||||
int BN_priv_rand_ex(BIGNUM *rnd, int bits, int top, int bottom,
|
||||
unsigned int strength, BN_CTX *ctx);
|
||||
int BN_priv_rand(BIGNUM *rnd, int bits, int top, int bottom);
|
||||
int BN_rand_range_ex(BIGNUM *r, const BIGNUM *range, unsigned int strength,
|
||||
BN_CTX *ctx);
|
||||
int BN_rand_range(BIGNUM *rnd, const BIGNUM *range);
|
||||
int BN_priv_rand_range_ex(BIGNUM *r, const BIGNUM *range,
|
||||
unsigned int strength, BN_CTX *ctx);
|
||||
int BN_priv_rand_range(BIGNUM *rnd, const BIGNUM *range);
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int BN_pseudo_rand(BIGNUM *rnd, int bits, int top, int bottom);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int BN_pseudo_rand_range(BIGNUM *rnd, const BIGNUM *range);
|
||||
#endif
|
||||
int BN_num_bits(const BIGNUM *a);
|
||||
int BN_num_bits_word(BN_ULONG l);
|
||||
int BN_security_bits(int L, int N);
|
||||
@@ -219,10 +240,18 @@ void BN_clear_free(BIGNUM *a);
|
||||
BIGNUM *BN_copy(BIGNUM *a, const BIGNUM *b);
|
||||
void BN_swap(BIGNUM *a, BIGNUM *b);
|
||||
BIGNUM *BN_bin2bn(const unsigned char *s, int len, BIGNUM *ret);
|
||||
BIGNUM *BN_signed_bin2bn(const unsigned char *s, int len, BIGNUM *ret);
|
||||
int BN_bn2bin(const BIGNUM *a, unsigned char *to);
|
||||
int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen);
|
||||
int BN_signed_bn2bin(const BIGNUM *a, unsigned char *to, int tolen);
|
||||
BIGNUM *BN_lebin2bn(const unsigned char *s, int len, BIGNUM *ret);
|
||||
BIGNUM *BN_signed_lebin2bn(const unsigned char *s, int len, BIGNUM *ret);
|
||||
int BN_bn2lebinpad(const BIGNUM *a, unsigned char *to, int tolen);
|
||||
int BN_signed_bn2lebin(const BIGNUM *a, unsigned char *to, int tolen);
|
||||
BIGNUM *BN_native2bn(const unsigned char *s, int len, BIGNUM *ret);
|
||||
BIGNUM *BN_signed_native2bn(const unsigned char *s, int len, BIGNUM *ret);
|
||||
int BN_bn2nativepad(const BIGNUM *a, unsigned char *to, int tolen);
|
||||
int BN_signed_bn2native(const BIGNUM *a, unsigned char *to, int tolen);
|
||||
BIGNUM *BN_mpi2bn(const unsigned char *s, int len, BIGNUM *ret);
|
||||
int BN_bn2mpi(const BIGNUM *a, unsigned char *to);
|
||||
int BN_sub(BIGNUM *r, const BIGNUM *a, const BIGNUM *b);
|
||||
@@ -244,8 +273,8 @@ int BN_is_negative(const BIGNUM *b);
|
||||
|
||||
int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d,
|
||||
BN_CTX *ctx);
|
||||
# define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
|
||||
int BN_nnmod(BIGNUM *r, const BIGNUM *m, const BIGNUM *d, BN_CTX *ctx);
|
||||
#define BN_mod(rem, a, m, ctx) BN_div(NULL, (rem), (a), (m), (ctx))
|
||||
int BN_nnmod(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx);
|
||||
int BN_mod_add(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, const BIGNUM *m,
|
||||
BN_CTX *ctx);
|
||||
int BN_mod_add_quick(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
@@ -292,6 +321,11 @@ int BN_mod_exp2_mont(BIGNUM *r, const BIGNUM *a1, const BIGNUM *p1,
|
||||
BN_CTX *ctx, BN_MONT_CTX *m_ctx);
|
||||
int BN_mod_exp_simple(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
|
||||
const BIGNUM *m, BN_CTX *ctx);
|
||||
int BN_mod_exp_mont_consttime_x2(BIGNUM *rr1, const BIGNUM *a1, const BIGNUM *p1,
|
||||
const BIGNUM *m1, BN_MONT_CTX *in_mont1,
|
||||
BIGNUM *rr2, const BIGNUM *a2, const BIGNUM *p2,
|
||||
const BIGNUM *m2, BN_MONT_CTX *in_mont2,
|
||||
BN_CTX *ctx);
|
||||
|
||||
int BN_mask_bits(BIGNUM *a, int n);
|
||||
#ifndef OPENSSL_NO_STDIO
|
||||
@@ -315,6 +349,7 @@ int BN_gcd(BIGNUM *r, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
|
||||
int BN_kronecker(const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); /* returns
|
||||
* -2 for
|
||||
* error */
|
||||
int BN_are_coprime(BIGNUM *a, const BIGNUM *b, BN_CTX *ctx);
|
||||
BIGNUM *BN_mod_inverse(BIGNUM *ret,
|
||||
const BIGNUM *a, const BIGNUM *n, BN_CTX *ctx);
|
||||
BIGNUM *BN_mod_sqrt(BIGNUM *ret,
|
||||
@@ -323,38 +358,51 @@ BIGNUM *BN_mod_sqrt(BIGNUM *ret,
|
||||
void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
|
||||
|
||||
/* Deprecated versions */
|
||||
DEPRECATEDIN_0_9_8(BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
|
||||
const BIGNUM *add,
|
||||
const BIGNUM *rem,
|
||||
void (*callback) (int, int,
|
||||
void *),
|
||||
void *cb_arg))
|
||||
DEPRECATEDIN_0_9_8(int
|
||||
BN_is_prime(const BIGNUM *p, int nchecks,
|
||||
#ifndef OPENSSL_NO_DEPRECATED_0_9_8
|
||||
OSSL_DEPRECATEDIN_0_9_8
|
||||
BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
|
||||
const BIGNUM *add, const BIGNUM *rem,
|
||||
void (*callback)(int, int, void *),
|
||||
BN_CTX *ctx, void *cb_arg))
|
||||
DEPRECATEDIN_0_9_8(int
|
||||
BN_is_prime_fasttest(const BIGNUM *p, int nchecks,
|
||||
void *cb_arg);
|
||||
OSSL_DEPRECATEDIN_0_9_8
|
||||
int BN_is_prime(const BIGNUM *p, int nchecks,
|
||||
void (*callback)(int, int, void *),
|
||||
BN_CTX *ctx, void *cb_arg);
|
||||
OSSL_DEPRECATEDIN_0_9_8
|
||||
int BN_is_prime_fasttest(const BIGNUM *p, int nchecks,
|
||||
void (*callback)(int, int, void *),
|
||||
BN_CTX *ctx, void *cb_arg,
|
||||
int do_trial_division))
|
||||
|
||||
/* Newer versions */
|
||||
int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add,
|
||||
const BIGNUM *rem, BN_GENCB *cb);
|
||||
int do_trial_division);
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx,
|
||||
int do_trial_division, BN_GENCB *cb);
|
||||
#endif
|
||||
/* Newer versions */
|
||||
int BN_generate_prime_ex2(BIGNUM *ret, int bits, int safe,
|
||||
const BIGNUM *add, const BIGNUM *rem, BN_GENCB *cb,
|
||||
BN_CTX *ctx);
|
||||
int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add,
|
||||
const BIGNUM *rem, BN_GENCB *cb);
|
||||
int BN_check_prime(const BIGNUM *p, BN_CTX *ctx, BN_GENCB *cb);
|
||||
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int BN_X931_generate_Xpq(BIGNUM *Xp, BIGNUM *Xq, int nbits, BN_CTX *ctx);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int BN_X931_derive_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2,
|
||||
const BIGNUM *Xp, const BIGNUM *Xp1,
|
||||
const BIGNUM *Xp2, const BIGNUM *e, BN_CTX *ctx,
|
||||
BN_GENCB *cb);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int BN_X931_generate_prime_ex(BIGNUM *p, BIGNUM *p1, BIGNUM *p2, BIGNUM *Xp1,
|
||||
BIGNUM *Xp2, const BIGNUM *Xp, const BIGNUM *e,
|
||||
BN_CTX *ctx, BN_GENCB *cb);
|
||||
#endif
|
||||
|
||||
BN_MONT_CTX *BN_MONT_CTX_new(void);
|
||||
int BN_mod_mul_montgomery(BIGNUM *r, const BIGNUM *a, const BIGNUM *b,
|
||||
@@ -398,10 +446,12 @@ BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
|
||||
BN_CTX *ctx,
|
||||
BN_MONT_CTX *m_ctx),
|
||||
BN_MONT_CTX *m_ctx);
|
||||
|
||||
DEPRECATEDIN_0_9_8(void BN_set_params(int mul, int high, int low, int mont))
|
||||
DEPRECATEDIN_0_9_8(int BN_get_params(int which)) /* 0, mul, 1 high, 2 low, 3
|
||||
* mont */
|
||||
#ifndef OPENSSL_NO_DEPRECATED_0_9_8
|
||||
OSSL_DEPRECATEDIN_0_9_8
|
||||
void BN_set_params(int mul, int high, int low, int mont);
|
||||
OSSL_DEPRECATEDIN_0_9_8
|
||||
int BN_get_params(int which); /* 0, mul, 1 high, 2 low, 3 mont */
|
||||
#endif
|
||||
|
||||
BN_RECP_CTX *BN_RECP_CTX_new(void);
|
||||
void BN_RECP_CTX_free(BN_RECP_CTX *recp);
|
||||
@@ -519,7 +569,7 @@ BIGNUM *BN_get_rfc3526_prime_4096(BIGNUM *bn);
|
||||
BIGNUM *BN_get_rfc3526_prime_6144(BIGNUM *bn);
|
||||
BIGNUM *BN_get_rfc3526_prime_8192(BIGNUM *bn);
|
||||
|
||||
# if OPENSSL_API_COMPAT < 0x10100000L
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
#define get_rfc2409_prime_768 BN_get_rfc2409_prime_768
|
||||
#define get_rfc2409_prime_1024 BN_get_rfc2409_prime_1024
|
||||
#define get_rfc3526_prime_1536 BN_get_rfc3526_prime_1536
|
||||
@@ -532,7 +582,6 @@ BIGNUM *BN_get_rfc3526_prime_8192(BIGNUM *bn);
|
||||
|
||||
int BN_bntest_rand(BIGNUM *rnd, int bits, int top, int bottom);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,77 +1,20 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_BNERR_H
|
||||
# define HEADER_BNERR_H
|
||||
#ifndef OPENSSL_BNERR_H
|
||||
#define OPENSSL_BNERR_H
|
||||
#pragma once
|
||||
|
||||
# ifndef HEADER_SYMHACKS_H
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/symhacks.h>
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
int ERR_load_BN_strings(void);
|
||||
|
||||
/*
|
||||
* BN function codes.
|
||||
*/
|
||||
# define BN_F_BNRAND 127
|
||||
# define BN_F_BNRAND_RANGE 138
|
||||
# define BN_F_BN_BLINDING_CONVERT_EX 100
|
||||
# define BN_F_BN_BLINDING_CREATE_PARAM 128
|
||||
# define BN_F_BN_BLINDING_INVERT_EX 101
|
||||
# define BN_F_BN_BLINDING_NEW 102
|
||||
# define BN_F_BN_BLINDING_UPDATE 103
|
||||
# define BN_F_BN_BN2DEC 104
|
||||
# define BN_F_BN_BN2HEX 105
|
||||
# define BN_F_BN_COMPUTE_WNAF 142
|
||||
# define BN_F_BN_CTX_GET 116
|
||||
# define BN_F_BN_CTX_NEW 106
|
||||
# define BN_F_BN_CTX_START 129
|
||||
# define BN_F_BN_DIV 107
|
||||
# define BN_F_BN_DIV_RECP 130
|
||||
# define BN_F_BN_EXP 123
|
||||
# define BN_F_BN_EXPAND_INTERNAL 120
|
||||
# define BN_F_BN_GENCB_NEW 143
|
||||
# define BN_F_BN_GENERATE_DSA_NONCE 140
|
||||
# define BN_F_BN_GENERATE_PRIME_EX 141
|
||||
# define BN_F_BN_GF2M_MOD 131
|
||||
# define BN_F_BN_GF2M_MOD_EXP 132
|
||||
# define BN_F_BN_GF2M_MOD_MUL 133
|
||||
# define BN_F_BN_GF2M_MOD_SOLVE_QUAD 134
|
||||
# define BN_F_BN_GF2M_MOD_SOLVE_QUAD_ARR 135
|
||||
# define BN_F_BN_GF2M_MOD_SQR 136
|
||||
# define BN_F_BN_GF2M_MOD_SQRT 137
|
||||
# define BN_F_BN_LSHIFT 145
|
||||
# define BN_F_BN_MOD_EXP2_MONT 118
|
||||
# define BN_F_BN_MOD_EXP_MONT 109
|
||||
# define BN_F_BN_MOD_EXP_MONT_CONSTTIME 124
|
||||
# define BN_F_BN_MOD_EXP_MONT_WORD 117
|
||||
# define BN_F_BN_MOD_EXP_RECP 125
|
||||
# define BN_F_BN_MOD_EXP_SIMPLE 126
|
||||
# define BN_F_BN_MOD_INVERSE 110
|
||||
# define BN_F_BN_MOD_INVERSE_NO_BRANCH 139
|
||||
# define BN_F_BN_MOD_LSHIFT_QUICK 119
|
||||
# define BN_F_BN_MOD_SQRT 121
|
||||
# define BN_F_BN_MONT_CTX_NEW 149
|
||||
# define BN_F_BN_MPI2BN 112
|
||||
# define BN_F_BN_NEW 113
|
||||
# define BN_F_BN_POOL_GET 147
|
||||
# define BN_F_BN_RAND 114
|
||||
# define BN_F_BN_RAND_RANGE 122
|
||||
# define BN_F_BN_RECP_CTX_NEW 150
|
||||
# define BN_F_BN_RSHIFT 146
|
||||
# define BN_F_BN_SET_WORDS 144
|
||||
# define BN_F_BN_STACK_PUSH 148
|
||||
# define BN_F_BN_USUB 115
|
||||
#include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
/*
|
||||
* BN reason codes.
|
||||
@@ -91,7 +34,9 @@ int ERR_load_BN_strings(void);
|
||||
#define BN_R_NOT_A_SQUARE 111
|
||||
#define BN_R_NOT_INITIALIZED 107
|
||||
#define BN_R_NO_INVERSE 108
|
||||
#define BN_R_NO_PRIME_CANDIDATE 121
|
||||
#define BN_R_NO_SOLUTION 116
|
||||
#define BN_R_NO_SUITABLE_DIGEST 120
|
||||
#define BN_R_PRIVATE_KEY_TOO_LARGE 117
|
||||
#define BN_R_P_IS_NOT_PRIME 112
|
||||
#define BN_R_TOO_MANY_ITERATIONS 113
|
||||
|
||||
@@ -1,22 +1,27 @@
|
||||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_BUFFER_H
|
||||
# define HEADER_BUFFER_H
|
||||
#ifndef OPENSSL_BUFFER_H
|
||||
#define OPENSSL_BUFFER_H
|
||||
#pragma once
|
||||
|
||||
# include <openssl/ossl_typ.h>
|
||||
# ifndef HEADER_CRYPTO_H
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_BUFFER_H
|
||||
#endif
|
||||
|
||||
#include <openssl/types.h>
|
||||
#ifndef OPENSSL_CRYPTO_H
|
||||
#include <openssl/crypto.h>
|
||||
#endif
|
||||
#include <openssl/buffererr.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -24,16 +29,14 @@ extern "C" {
|
||||
#include <stddef.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
/*
|
||||
* These names are outdated as of OpenSSL 1.1; a future release
|
||||
* will move them to be deprecated.
|
||||
*/
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define BUF_strdup(s) OPENSSL_strdup(s)
|
||||
#define BUF_strndup(s, size) OPENSSL_strndup(s, size)
|
||||
#define BUF_memdup(data, size) OPENSSL_memdup(data, size)
|
||||
#define BUF_strlcpy(dst, src, size) OPENSSL_strlcpy(dst, src, size)
|
||||
#define BUF_strlcat(dst, src, size) OPENSSL_strlcat(dst, src, size)
|
||||
#define BUF_strnlen(str, maxlen) OPENSSL_strnlen(str, maxlen)
|
||||
#endif
|
||||
|
||||
struct buf_mem_st {
|
||||
size_t length; /* current number of bytes */
|
||||
@@ -51,7 +54,6 @@ size_t BUF_MEM_grow(BUF_MEM *str, size_t len);
|
||||
size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len);
|
||||
void BUF_reverse(unsigned char *out, const unsigned char *in, size_t siz);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,31 +1,20 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_BUFERR_H
|
||||
# define HEADER_BUFERR_H
|
||||
#ifndef OPENSSL_BUFFERERR_H
|
||||
#define OPENSSL_BUFFERERR_H
|
||||
#pragma once
|
||||
|
||||
# ifndef HEADER_SYMHACKS_H
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/symhacks.h>
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
int ERR_load_BUF_strings(void);
|
||||
|
||||
/*
|
||||
* BUF function codes.
|
||||
*/
|
||||
# define BUF_F_BUF_MEM_GROW 100
|
||||
# define BUF_F_BUF_MEM_GROW_CLEAN 105
|
||||
# define BUF_F_BUF_MEM_NEW 101
|
||||
#include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
/*
|
||||
* BUF reason codes.
|
||||
|
||||
@@ -0,0 +1,339 @@
|
||||
/*
|
||||
* Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef OPENSSL_BYTEORDER_H
|
||||
#define OPENSSL_BYTEORDER_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/e_os2.h>
|
||||
#include <string.h>
|
||||
|
||||
/*
|
||||
* "Modern" compilers do a decent job of optimising these functions to just a
|
||||
* couple of instruction ([swap +] store, or load [+ swap]) when either no
|
||||
* swapping is required, or a suitable swap instruction is available.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1300
|
||||
#include <stdlib.h>
|
||||
#pragma intrinsic(_byteswap_ushort)
|
||||
#pragma intrinsic(_byteswap_ulong)
|
||||
#pragma intrinsic(_byteswap_uint64)
|
||||
#define OSSL_HTOBE16(x) _byteswap_ushort(x)
|
||||
#define OSSL_HTOBE32(x) _byteswap_ulong(x)
|
||||
#define OSSL_HTOBE64(x) _byteswap_uint64(x)
|
||||
#define OSSL_BE16TOH(x) _byteswap_ushort(x)
|
||||
#define OSSL_BE32TOH(x) _byteswap_ulong(x)
|
||||
#define OSSL_BE64TOH(x) _byteswap_uint64(x)
|
||||
#define OSSL_HTOLE16(x) (x)
|
||||
#define OSSL_HTOLE32(x) (x)
|
||||
#define OSSL_HTOLE64(x) (x)
|
||||
#define OSSL_LE16TOH(x) (x)
|
||||
#define OSSL_LE32TOH(x) (x)
|
||||
#define OSSL_LE64TOH(x) (x)
|
||||
|
||||
#elif defined(__GLIBC__) && defined(__GLIBC_PREREQ)
|
||||
#if (__GLIBC_PREREQ(2, 19)) && defined(_DEFAULT_SOURCE)
|
||||
#include <endian.h>
|
||||
#define OSSL_HTOBE16(x) htobe16(x)
|
||||
#define OSSL_HTOBE32(x) htobe32(x)
|
||||
#define OSSL_HTOBE64(x) htobe64(x)
|
||||
#define OSSL_BE16TOH(x) be16toh(x)
|
||||
#define OSSL_BE32TOH(x) be32toh(x)
|
||||
#define OSSL_BE64TOH(x) be64toh(x)
|
||||
#define OSSL_HTOLE16(x) htole16(x)
|
||||
#define OSSL_HTOLE32(x) htole32(x)
|
||||
#define OSSL_HTOLE64(x) htole64(x)
|
||||
#define OSSL_LE16TOH(x) le16toh(x)
|
||||
#define OSSL_LE32TOH(x) le32toh(x)
|
||||
#define OSSL_LE64TOH(x) le64toh(x)
|
||||
#endif
|
||||
|
||||
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
|
||||
#if defined(__OpenBSD__)
|
||||
#include <sys/types.h>
|
||||
#else
|
||||
#include <sys/endian.h>
|
||||
#endif
|
||||
#define OSSL_HTOBE16(x) htobe16(x)
|
||||
#define OSSL_HTOBE32(x) htobe32(x)
|
||||
#define OSSL_HTOBE64(x) htobe64(x)
|
||||
#define OSSL_BE16TOH(x) be16toh(x)
|
||||
#define OSSL_BE32TOH(x) be32toh(x)
|
||||
#define OSSL_BE64TOH(x) be64toh(x)
|
||||
#define OSSL_HTOLE16(x) htole16(x)
|
||||
#define OSSL_HTOLE32(x) htole32(x)
|
||||
#define OSSL_HTOLE64(x) htole64(x)
|
||||
#define OSSL_LE16TOH(x) le16toh(x)
|
||||
#define OSSL_LE32TOH(x) le32toh(x)
|
||||
#define OSSL_LE64TOH(x) le64toh(x)
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
#include <libkern/OSByteOrder.h>
|
||||
#define OSSL_HTOBE16(x) OSSwapHostToBigInt16(x)
|
||||
#define OSSL_HTOBE32(x) OSSwapHostToBigInt32(x)
|
||||
#define OSSL_HTOBE64(x) OSSwapHostToBigInt64(x)
|
||||
#define OSSL_BE16TOH(x) OSSwapBigToHostInt16(x)
|
||||
#define OSSL_BE32TOH(x) OSSwapBigToHostInt32(x)
|
||||
#define OSSL_BE64TOH(x) OSSwapBigToHostInt64(x)
|
||||
#define OSSL_HTOLE16(x) OSSwapHostToLittleInt16(x)
|
||||
#define OSSL_HTOLE32(x) OSSwapHostToLittleInt32(x)
|
||||
#define OSSL_HTOLE64(x) OSSwapHostToLittleInt64(x)
|
||||
#define OSSL_LE16TOH(x) OSSwapLittleToHostInt16(x)
|
||||
#define OSSL_LE32TOH(x) OSSwapLittleToHostInt32(x)
|
||||
#define OSSL_LE64TOH(x) OSSwapLittleToHostInt64(x)
|
||||
|
||||
#endif
|
||||
|
||||
static ossl_inline ossl_unused unsigned char *
|
||||
OPENSSL_store_u16_le(unsigned char *out, uint16_t val)
|
||||
{
|
||||
#ifdef OSSL_HTOLE16
|
||||
uint16_t t = OSSL_HTOLE16(val);
|
||||
|
||||
memcpy(out, (unsigned char *)&t, 2);
|
||||
return out + 2;
|
||||
#else
|
||||
*out++ = (val & 0xff);
|
||||
*out++ = (val >> 8) & 0xff;
|
||||
return out;
|
||||
#endif
|
||||
}
|
||||
|
||||
static ossl_inline ossl_unused unsigned char *
|
||||
OPENSSL_store_u16_be(unsigned char *out, uint16_t val)
|
||||
{
|
||||
#ifdef OSSL_HTOBE16
|
||||
uint16_t t = OSSL_HTOBE16(val);
|
||||
|
||||
memcpy(out, (unsigned char *)&t, 2);
|
||||
return out + 2;
|
||||
#else
|
||||
*out++ = (val >> 8) & 0xff;
|
||||
*out++ = (val & 0xff);
|
||||
return out;
|
||||
#endif
|
||||
}
|
||||
|
||||
static ossl_inline ossl_unused unsigned char *
|
||||
OPENSSL_store_u32_le(unsigned char *out, uint32_t val)
|
||||
{
|
||||
#ifdef OSSL_HTOLE32
|
||||
uint32_t t = OSSL_HTOLE32(val);
|
||||
|
||||
memcpy(out, (unsigned char *)&t, 4);
|
||||
return out + 4;
|
||||
#else
|
||||
*out++ = (val & 0xff);
|
||||
*out++ = (val >> 8) & 0xff;
|
||||
*out++ = (val >> 16) & 0xff;
|
||||
*out++ = (val >> 24) & 0xff;
|
||||
return out;
|
||||
#endif
|
||||
}
|
||||
|
||||
static ossl_inline ossl_unused unsigned char *
|
||||
OPENSSL_store_u32_be(unsigned char *out, uint32_t val)
|
||||
{
|
||||
#ifdef OSSL_HTOBE32
|
||||
uint32_t t = OSSL_HTOBE32(val);
|
||||
|
||||
memcpy(out, (unsigned char *)&t, 4);
|
||||
return out + 4;
|
||||
#else
|
||||
*out++ = (val >> 24) & 0xff;
|
||||
*out++ = (val >> 16) & 0xff;
|
||||
*out++ = (val >> 8) & 0xff;
|
||||
*out++ = (val & 0xff);
|
||||
return out;
|
||||
#endif
|
||||
}
|
||||
|
||||
static ossl_inline ossl_unused unsigned char *
|
||||
OPENSSL_store_u64_le(unsigned char *out, uint64_t val)
|
||||
{
|
||||
#ifdef OSSL_HTOLE64
|
||||
uint64_t t = OSSL_HTOLE64(val);
|
||||
|
||||
memcpy(out, (unsigned char *)&t, 8);
|
||||
return out + 8;
|
||||
#else
|
||||
*out++ = (val & 0xff);
|
||||
*out++ = (val >> 8) & 0xff;
|
||||
*out++ = (val >> 16) & 0xff;
|
||||
*out++ = (val >> 24) & 0xff;
|
||||
*out++ = (val >> 32) & 0xff;
|
||||
*out++ = (val >> 40) & 0xff;
|
||||
*out++ = (val >> 48) & 0xff;
|
||||
*out++ = (val >> 56) & 0xff;
|
||||
return out;
|
||||
#endif
|
||||
}
|
||||
|
||||
static ossl_inline ossl_unused unsigned char *
|
||||
OPENSSL_store_u64_be(unsigned char *out, uint64_t val)
|
||||
{
|
||||
#ifdef OSSL_HTOLE64
|
||||
uint64_t t = OSSL_HTOBE64(val);
|
||||
|
||||
memcpy(out, (unsigned char *)&t, 8);
|
||||
return out + 8;
|
||||
#else
|
||||
*out++ = (val >> 56) & 0xff;
|
||||
*out++ = (val >> 48) & 0xff;
|
||||
*out++ = (val >> 40) & 0xff;
|
||||
*out++ = (val >> 32) & 0xff;
|
||||
*out++ = (val >> 24) & 0xff;
|
||||
*out++ = (val >> 16) & 0xff;
|
||||
*out++ = (val >> 8) & 0xff;
|
||||
*out++ = (val & 0xff);
|
||||
return out;
|
||||
#endif
|
||||
}
|
||||
|
||||
static ossl_inline ossl_unused const unsigned char *
|
||||
OPENSSL_load_u16_le(uint16_t *val, const unsigned char *in)
|
||||
{
|
||||
#ifdef OSSL_LE16TOH
|
||||
uint16_t t;
|
||||
|
||||
memcpy((unsigned char *)&t, in, 2);
|
||||
*val = OSSL_LE16TOH(t);
|
||||
return in + 2;
|
||||
#else
|
||||
uint16_t b0 = *in++;
|
||||
uint16_t b1 = *in++;
|
||||
|
||||
*val = b0 | (b1 << 8);
|
||||
return in;
|
||||
#endif
|
||||
}
|
||||
|
||||
static ossl_inline ossl_unused const unsigned char *
|
||||
OPENSSL_load_u16_be(uint16_t *val, const unsigned char *in)
|
||||
{
|
||||
#ifdef OSSL_LE16TOH
|
||||
uint16_t t;
|
||||
|
||||
memcpy((unsigned char *)&t, in, 2);
|
||||
*val = OSSL_BE16TOH(t);
|
||||
return in + 2;
|
||||
#else
|
||||
uint16_t b1 = *in++;
|
||||
uint16_t b0 = *in++;
|
||||
|
||||
*val = b0 | (b1 << 8);
|
||||
return in;
|
||||
#endif
|
||||
}
|
||||
|
||||
static ossl_inline ossl_unused const unsigned char *
|
||||
OPENSSL_load_u32_le(uint32_t *val, const unsigned char *in)
|
||||
{
|
||||
#ifdef OSSL_LE32TOH
|
||||
uint32_t t;
|
||||
|
||||
memcpy((unsigned char *)&t, in, 4);
|
||||
*val = OSSL_LE32TOH(t);
|
||||
return in + 4;
|
||||
#else
|
||||
uint32_t b0 = *in++;
|
||||
uint32_t b1 = *in++;
|
||||
uint32_t b2 = *in++;
|
||||
uint32_t b3 = *in++;
|
||||
|
||||
*val = b0 | (b1 << 8) | (b2 << 16) | (b3 << 24);
|
||||
return in;
|
||||
#endif
|
||||
}
|
||||
|
||||
static ossl_inline ossl_unused const unsigned char *
|
||||
OPENSSL_load_u32_be(uint32_t *val, const unsigned char *in)
|
||||
{
|
||||
#ifdef OSSL_LE32TOH
|
||||
uint32_t t;
|
||||
|
||||
memcpy((unsigned char *)&t, in, 4);
|
||||
*val = OSSL_BE32TOH(t);
|
||||
return in + 4;
|
||||
#else
|
||||
uint32_t b3 = *in++;
|
||||
uint32_t b2 = *in++;
|
||||
uint32_t b1 = *in++;
|
||||
uint32_t b0 = *in++;
|
||||
|
||||
*val = b0 | (b1 << 8) | (b2 << 16) | (b3 << 24);
|
||||
return in;
|
||||
#endif
|
||||
}
|
||||
|
||||
static ossl_inline ossl_unused const unsigned char *
|
||||
OPENSSL_load_u64_le(uint64_t *val, const unsigned char *in)
|
||||
{
|
||||
#ifdef OSSL_LE64TOH
|
||||
uint64_t t;
|
||||
|
||||
memcpy((unsigned char *)&t, in, 8);
|
||||
*val = OSSL_LE64TOH(t);
|
||||
return in + 8;
|
||||
#else
|
||||
uint64_t b0 = *in++;
|
||||
uint64_t b1 = *in++;
|
||||
uint64_t b2 = *in++;
|
||||
uint64_t b3 = *in++;
|
||||
uint64_t b4 = *in++;
|
||||
uint64_t b5 = *in++;
|
||||
uint64_t b6 = *in++;
|
||||
uint64_t b7 = *in++;
|
||||
|
||||
*val = b0 | (b1 << 8) | (b2 << 16) | (b3 << 24)
|
||||
| (b4 << 32) | (b5 << 40) | (b6 << 48) | (b7 << 56);
|
||||
return in;
|
||||
#endif
|
||||
}
|
||||
|
||||
static ossl_inline ossl_unused const unsigned char *
|
||||
OPENSSL_load_u64_be(uint64_t *val, const unsigned char *in)
|
||||
{
|
||||
#ifdef OSSL_LE64TOH
|
||||
uint64_t t;
|
||||
|
||||
memcpy((unsigned char *)&t, in, 8);
|
||||
*val = OSSL_BE64TOH(t);
|
||||
return in + 8;
|
||||
#else
|
||||
uint64_t b7 = *in++;
|
||||
uint64_t b6 = *in++;
|
||||
uint64_t b5 = *in++;
|
||||
uint64_t b4 = *in++;
|
||||
uint64_t b3 = *in++;
|
||||
uint64_t b2 = *in++;
|
||||
uint64_t b1 = *in++;
|
||||
uint64_t b0 = *in++;
|
||||
|
||||
*val = b0 | (b1 << 8) | (b2 << 16) | (b3 << 24)
|
||||
| (b4 << 32) | (b5 << 40) | (b6 << 48) | (b7 << 56);
|
||||
return in;
|
||||
#endif
|
||||
}
|
||||
|
||||
#undef OSSL_HTOBE16
|
||||
#undef OSSL_HTOBE32
|
||||
#undef OSSL_HTOBE64
|
||||
#undef OSSL_BE16TOH
|
||||
#undef OSSL_BE32TOH
|
||||
#undef OSSL_BE64TOH
|
||||
#undef OSSL_HTOLE16
|
||||
#undef OSSL_HTOLE32
|
||||
#undef OSSL_HTOLE64
|
||||
#undef OSSL_LE16TOH
|
||||
#undef OSSL_LE32TOH
|
||||
#undef OSSL_LE64TOH
|
||||
|
||||
#endif
|
||||
@@ -1,14 +1,20 @@
|
||||
/*
|
||||
* Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2006-2026 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CAMELLIA_H
|
||||
#ifndef OPENSSL_CAMELLIA_H
|
||||
#define OPENSSL_CAMELLIA_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_CAMELLIA_H
|
||||
#endif
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
|
||||
@@ -18,6 +24,10 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define CAMELLIA_BLOCK_SIZE 16
|
||||
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
|
||||
#define CAMELLIA_ENCRYPT 1
|
||||
#define CAMELLIA_DECRYPT 0
|
||||
|
||||
@@ -28,7 +38,6 @@ extern "C" {
|
||||
|
||||
/* This should be a hidden type, but EVP requires that the size be known */
|
||||
|
||||
# define CAMELLIA_BLOCK_SIZE 16
|
||||
#define CAMELLIA_TABLE_BYTE_LEN 272
|
||||
#define CAMELLIA_TABLE_WORD_LEN (CAMELLIA_TABLE_BYTE_LEN / 4)
|
||||
|
||||
@@ -44,36 +53,61 @@ struct camellia_key_st {
|
||||
};
|
||||
typedef struct camellia_key_st CAMELLIA_KEY;
|
||||
|
||||
int Camellia_set_key(const unsigned char *userKey, const int bits,
|
||||
#endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int Camellia_set_key(const unsigned char *userKey,
|
||||
int bits,
|
||||
CAMELLIA_KEY *key);
|
||||
|
||||
void Camellia_encrypt(const unsigned char *in, unsigned char *out,
|
||||
OSSL_DEPRECATEDIN_3_0 void Camellia_encrypt(const unsigned char *in,
|
||||
unsigned char *out,
|
||||
const CAMELLIA_KEY *key);
|
||||
void Camellia_decrypt(const unsigned char *in, unsigned char *out,
|
||||
OSSL_DEPRECATEDIN_3_0 void Camellia_decrypt(const unsigned char *in,
|
||||
unsigned char *out,
|
||||
const CAMELLIA_KEY *key);
|
||||
|
||||
void Camellia_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const CAMELLIA_KEY *key, const int enc);
|
||||
void Camellia_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const CAMELLIA_KEY *key,
|
||||
unsigned char *ivec, const int enc);
|
||||
void Camellia_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const CAMELLIA_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
void Camellia_cfb1_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const CAMELLIA_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
void Camellia_cfb8_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const CAMELLIA_KEY *key,
|
||||
unsigned char *ivec, int *num, const int enc);
|
||||
void Camellia_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const CAMELLIA_KEY *key,
|
||||
unsigned char *ivec, int *num);
|
||||
OSSL_DEPRECATEDIN_3_0 void Camellia_ecb_encrypt(const unsigned char *in,
|
||||
unsigned char *out,
|
||||
const CAMELLIA_KEY *key,
|
||||
int enc);
|
||||
OSSL_DEPRECATEDIN_3_0 void Camellia_cbc_encrypt(const unsigned char *in,
|
||||
unsigned char *out,
|
||||
size_t length,
|
||||
const CAMELLIA_KEY *key,
|
||||
unsigned char *ivec,
|
||||
int enc);
|
||||
OSSL_DEPRECATEDIN_3_0 void Camellia_cfb128_encrypt(const unsigned char *in,
|
||||
unsigned char *out,
|
||||
size_t length,
|
||||
const CAMELLIA_KEY *key,
|
||||
unsigned char *ivec,
|
||||
int *num,
|
||||
int enc);
|
||||
OSSL_DEPRECATEDIN_3_0 void Camellia_cfb1_encrypt(const unsigned char *in,
|
||||
unsigned char *out,
|
||||
size_t length,
|
||||
const CAMELLIA_KEY *key,
|
||||
unsigned char *ivec,
|
||||
int *num,
|
||||
int enc);
|
||||
OSSL_DEPRECATEDIN_3_0 void Camellia_cfb8_encrypt(const unsigned char *in,
|
||||
unsigned char *out,
|
||||
size_t length,
|
||||
const CAMELLIA_KEY *key,
|
||||
unsigned char *ivec,
|
||||
int *num,
|
||||
int enc);
|
||||
OSSL_DEPRECATEDIN_3_0 void Camellia_ofb128_encrypt(const unsigned char *in,
|
||||
unsigned char *out,
|
||||
size_t length,
|
||||
const CAMELLIA_KEY *key,
|
||||
unsigned char *ivec,
|
||||
int *num);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void Camellia_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
||||
size_t length, const CAMELLIA_KEY *key,
|
||||
unsigned char ivec[CAMELLIA_BLOCK_SIZE],
|
||||
unsigned char ecount_buf[CAMELLIA_BLOCK_SIZE],
|
||||
unsigned int *num);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CAST_H
|
||||
#ifndef OPENSSL_CAST_H
|
||||
#define OPENSSL_CAST_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_CAST_H
|
||||
#endif
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
|
||||
@@ -17,33 +23,45 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define CAST_BLOCK 8
|
||||
#define CAST_KEY_LENGTH 16
|
||||
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
|
||||
#define CAST_ENCRYPT 1
|
||||
#define CAST_DECRYPT 0
|
||||
|
||||
# define CAST_LONG unsigned int
|
||||
|
||||
# define CAST_BLOCK 8
|
||||
# define CAST_KEY_LENGTH 16
|
||||
typedef unsigned int CAST_LONG;
|
||||
|
||||
typedef struct cast_key_st {
|
||||
CAST_LONG data[32];
|
||||
int short_key; /* Use reduced rounds for short key */
|
||||
} CAST_KEY;
|
||||
|
||||
#endif /* OPENSSL_NO_DEPRECATED_3_0 */
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void CAST_set_key(CAST_KEY *key, int len, const unsigned char *data);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void CAST_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
||||
const CAST_KEY *key, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void CAST_encrypt(CAST_LONG *data, const CAST_KEY *key);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void CAST_decrypt(CAST_LONG *data, const CAST_KEY *key);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void CAST_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
||||
long length, const CAST_KEY *ks, unsigned char *iv,
|
||||
int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void CAST_cfb64_encrypt(const unsigned char *in, unsigned char *out,
|
||||
long length, const CAST_KEY *schedule,
|
||||
unsigned char *ivec, int *num, int enc);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
void CAST_ofb64_encrypt(const unsigned char *in, unsigned char *out,
|
||||
long length, const CAST_KEY *schedule,
|
||||
unsigned char *ivec, int *num);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
/*
|
||||
* Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2010-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CMAC_H
|
||||
#ifndef OPENSSL_CMAC_H
|
||||
#define OPENSSL_CMAC_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_CMAC_H
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_CMAC
|
||||
|
||||
@@ -18,20 +24,26 @@ extern "C" {
|
||||
|
||||
#include <openssl/evp.h>
|
||||
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
/* Opaque */
|
||||
typedef struct CMAC_CTX_st CMAC_CTX;
|
||||
|
||||
CMAC_CTX *CMAC_CTX_new(void);
|
||||
void CMAC_CTX_cleanup(CMAC_CTX *ctx);
|
||||
void CMAC_CTX_free(CMAC_CTX *ctx);
|
||||
EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx);
|
||||
int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in);
|
||||
|
||||
int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
|
||||
const EVP_CIPHER *cipher, ENGINE *impl);
|
||||
int CMAC_Update(CMAC_CTX *ctx, const void *data, size_t dlen);
|
||||
int CMAC_Final(CMAC_CTX *ctx, unsigned char *out, size_t *poutlen);
|
||||
int CMAC_resume(CMAC_CTX *ctx);
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 CMAC_CTX *CMAC_CTX_new(void);
|
||||
OSSL_DEPRECATEDIN_3_0 void CMAC_CTX_cleanup(CMAC_CTX *ctx);
|
||||
OSSL_DEPRECATEDIN_3_0 void CMAC_CTX_free(CMAC_CTX *ctx);
|
||||
OSSL_DEPRECATEDIN_3_0 EVP_CIPHER_CTX *CMAC_CTX_get0_cipher_ctx(CMAC_CTX *ctx);
|
||||
OSSL_DEPRECATEDIN_3_0 int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in);
|
||||
OSSL_DEPRECATEDIN_3_0 int CMAC_Init(CMAC_CTX *ctx,
|
||||
const void *key, size_t keylen,
|
||||
const EVP_CIPHER *cipher,
|
||||
ENGINE *impl /* must be NULL */);
|
||||
OSSL_DEPRECATEDIN_3_0 int CMAC_Update(CMAC_CTX *ctx,
|
||||
const void *data, size_t dlen);
|
||||
OSSL_DEPRECATEDIN_3_0 int CMAC_Final(CMAC_CTX *ctx,
|
||||
unsigned char *out, size_t *poutlen);
|
||||
OSSL_DEPRECATEDIN_3_0 int CMAC_resume(CMAC_CTX *ctx);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/cmp.h.in
|
||||
*
|
||||
* Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright Nokia 2007-2019
|
||||
* Copyright Siemens AG 2015-2019
|
||||
*
|
||||
@@ -12,7 +12,9 @@
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#ifndef OPENSSL_CMP_H
|
||||
#define OPENSSL_CMP_H
|
||||
@@ -35,7 +37,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# define OSSL_CMP_PVNO 2
|
||||
#define OSSL_CMP_PVNO_2 2
|
||||
#define OSSL_CMP_PVNO_3 3
|
||||
#define OSSL_CMP_PVNO OSSL_CMP_PVNO_2 /* v2 is the default */
|
||||
|
||||
/*-
|
||||
* PKIFailureInfo ::= BIT STRING {
|
||||
@@ -137,7 +141,6 @@ extern "C" {
|
||||
#if OSSL_CMP_PKIFAILUREINFO_MAX_BIT_PATTERN > INT_MAX
|
||||
#error CMP_PKIFAILUREINFO_MAX bit pattern does not fit in type int
|
||||
#endif
|
||||
|
||||
typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO;
|
||||
|
||||
#define OSSL_CMP_CTX_FAILINFO_badAlg (1 << 0)
|
||||
@@ -193,6 +196,11 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO;
|
||||
* -- CertReqMsg
|
||||
* }
|
||||
*/
|
||||
#define OSSL_CMP_PKISTATUS_rejected_by_client -5
|
||||
#define OSSL_CMP_PKISTATUS_checking_response -4
|
||||
#define OSSL_CMP_PKISTATUS_request -3
|
||||
#define OSSL_CMP_PKISTATUS_trans -2
|
||||
#define OSSL_CMP_PKISTATUS_unspecified -1
|
||||
#define OSSL_CMP_PKISTATUS_accepted 0
|
||||
#define OSSL_CMP_PKISTATUS_grantedWithMods 1
|
||||
#define OSSL_CMP_PKISTATUS_rejection 2
|
||||
@@ -200,8 +208,8 @@ typedef ASN1_BIT_STRING OSSL_CMP_PKIFAILUREINFO;
|
||||
#define OSSL_CMP_PKISTATUS_revocationWarning 4
|
||||
#define OSSL_CMP_PKISTATUS_revocationNotification 5
|
||||
#define OSSL_CMP_PKISTATUS_keyUpdateWarning 6
|
||||
|
||||
typedef ASN1_INTEGER OSSL_CMP_PKISTATUS;
|
||||
|
||||
DECLARE_ASN1_ITEM(OSSL_CMP_PKISTATUS)
|
||||
|
||||
#define OSSL_CMP_CERTORENCCERT_CERTIFICATE 0
|
||||
@@ -215,12 +223,13 @@ typedef struct ossl_cmp_msg_st OSSL_CMP_MSG;
|
||||
DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_MSG)
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS(OSSL_CMP_MSG, OSSL_CMP_MSG, OSSL_CMP_MSG)
|
||||
typedef struct ossl_cmp_certstatus_st OSSL_CMP_CERTSTATUS;
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_CERTSTATUS, OSSL_CMP_CERTSTATUS, OSSL_CMP_CERTSTATUS)
|
||||
#define sk_OSSL_CMP_CERTSTATUS_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type(sk))
|
||||
#define sk_OSSL_CMP_CERTSTATUS_value(sk, idx) ((OSSL_CMP_CERTSTATUS *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type(sk), (idx)))
|
||||
#define sk_OSSL_CMP_CERTSTATUS_new(cmp) ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_CERTSTATUS_compfunc_type(cmp)))
|
||||
#define sk_OSSL_CMP_CERTSTATUS_new_null() ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_new_null())
|
||||
#define sk_OSSL_CMP_CERTSTATUS_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_CERTSTATUS_compfunc_type(cmp), (n)))
|
||||
#define sk_OSSL_CMP_CERTSTATUS_new(cmp) ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_OSSL_CMP_CERTSTATUS_compfunc_type(cmp)), sk_OSSL_CMP_CERTSTATUS_cmpfunc_thunk))
|
||||
#define sk_OSSL_CMP_CERTSTATUS_new_null() ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_OSSL_CMP_CERTSTATUS_freefunc_thunk))
|
||||
#define sk_OSSL_CMP_CERTSTATUS_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_CERTSTATUS_compfunc_type(cmp), (n)), sk_OSSL_CMP_CERTSTATUS_cmpfunc_thunk))
|
||||
#define sk_OSSL_CMP_CERTSTATUS_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), (n))
|
||||
#define sk_OSSL_CMP_CERTSTATUS_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk))
|
||||
#define sk_OSSL_CMP_CERTSTATUS_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk))
|
||||
@@ -242,14 +251,16 @@ SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_CERTSTATUS, OSSL_CMP_CERTSTATUS, OSSL_CMP_
|
||||
#define sk_OSSL_CMP_CERTSTATUS_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_CERTSTATUS) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_CERTSTATUS_freefunc_type(freefunc)))
|
||||
#define sk_OSSL_CMP_CERTSTATUS_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_CERTSTATUS_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_CERTSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CERTSTATUS_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
typedef struct ossl_cmp_itav_st OSSL_CMP_ITAV;
|
||||
DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_ITAV)
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_ITAV, OSSL_CMP_ITAV, OSSL_CMP_ITAV)
|
||||
#define sk_OSSL_CMP_ITAV_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_ITAV_sk_type(sk))
|
||||
#define sk_OSSL_CMP_ITAV_value(sk, idx) ((OSSL_CMP_ITAV *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_ITAV_sk_type(sk), (idx)))
|
||||
#define sk_OSSL_CMP_ITAV_new(cmp) ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_ITAV_compfunc_type(cmp)))
|
||||
#define sk_OSSL_CMP_ITAV_new_null() ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_new_null())
|
||||
#define sk_OSSL_CMP_ITAV_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_ITAV_compfunc_type(cmp), (n)))
|
||||
#define sk_OSSL_CMP_ITAV_new(cmp) ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_OSSL_CMP_ITAV_compfunc_type(cmp)), sk_OSSL_CMP_ITAV_cmpfunc_thunk))
|
||||
#define sk_OSSL_CMP_ITAV_new_null() ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_OSSL_CMP_ITAV_freefunc_thunk))
|
||||
#define sk_OSSL_CMP_ITAV_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_ITAV_compfunc_type(cmp), (n)), sk_OSSL_CMP_ITAV_cmpfunc_thunk))
|
||||
#define sk_OSSL_CMP_ITAV_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_ITAV_sk_type(sk), (n))
|
||||
#define sk_OSSL_CMP_ITAV_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_ITAV_sk_type(sk))
|
||||
#define sk_OSSL_CMP_ITAV_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_ITAV_sk_type(sk))
|
||||
@@ -271,16 +282,60 @@ SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_ITAV, OSSL_CMP_ITAV, OSSL_CMP_ITAV)
|
||||
#define sk_OSSL_CMP_ITAV_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_ITAV) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_ITAV_freefunc_type(freefunc)))
|
||||
#define sk_OSSL_CMP_ITAV_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_ITAV_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_ITAV_sk_type(sk), ossl_check_OSSL_CMP_ITAV_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
typedef struct ossl_cmp_crlstatus_st OSSL_CMP_CRLSTATUS;
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_CRLSTATUS, OSSL_CMP_CRLSTATUS, OSSL_CMP_CRLSTATUS)
|
||||
#define sk_OSSL_CMP_CRLSTATUS_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_CRLSTATUS_sk_type(sk))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_value(sk, idx) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_CRLSTATUS_sk_type(sk), (idx)))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_new(cmp) ((STACK_OF(OSSL_CMP_CRLSTATUS) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_OSSL_CMP_CRLSTATUS_compfunc_type(cmp)), sk_OSSL_CMP_CRLSTATUS_cmpfunc_thunk))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_new_null() ((STACK_OF(OSSL_CMP_CRLSTATUS) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_OSSL_CMP_CRLSTATUS_freefunc_thunk))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_CRLSTATUS) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_CRLSTATUS_compfunc_type(cmp), (n)), sk_OSSL_CMP_CRLSTATUS_cmpfunc_thunk))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), (n))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_delete(sk, i) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_delete(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), (i)))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_delete_ptr(sk, ptr) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr)))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_pop(sk) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_pop(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk)))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_shift(sk) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_shift(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk)))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_freefunc_type(freefunc))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr), (idx))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_set(sk, idx, ptr) ((OSSL_CMP_CRLSTATUS *)OPENSSL_sk_set(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), (idx), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr)))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_type(ptr), pnum)
|
||||
#define sk_OSSL_CMP_CRLSTATUS_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CMP_CRLSTATUS_sk_type(sk))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_dup(sk) ((STACK_OF(OSSL_CMP_CRLSTATUS) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CMP_CRLSTATUS_sk_type(sk)))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_CRLSTATUS) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_CRLSTATUS_freefunc_type(freefunc)))
|
||||
#define sk_OSSL_CMP_CRLSTATUS_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_CRLSTATUS_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_CRLSTATUS_sk_type(sk), ossl_check_OSSL_CMP_CRLSTATUS_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
typedef OSSL_CRMF_ATTRIBUTETYPEANDVALUE OSSL_CMP_ATAV;
|
||||
#define OSSL_CMP_ATAV_free OSSL_CRMF_ATTRIBUTETYPEANDVALUE_free
|
||||
typedef STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) OSSL_CMP_ATAVS;
|
||||
DECLARE_ASN1_FUNCTIONS(OSSL_CMP_ATAVS)
|
||||
#define stack_st_OSSL_CMP_ATAV stack_st_OSSL_CRMF_ATTRIBUTETYPEANDVALUE
|
||||
#define sk_OSSL_CMP_ATAV_num sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_num
|
||||
#define sk_OSSL_CMP_ATAV_value sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_value
|
||||
#define sk_OSSL_CMP_ATAV_push sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_push
|
||||
#define sk_OSSL_CMP_ATAV_pop_free sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_pop_free
|
||||
|
||||
typedef struct ossl_cmp_revrepcontent_st OSSL_CMP_REVREPCONTENT;
|
||||
typedef struct ossl_cmp_pkisi_st OSSL_CMP_PKISI;
|
||||
DECLARE_ASN1_FUNCTIONS(OSSL_CMP_PKISI)
|
||||
DECLARE_ASN1_DUP_FUNCTION(OSSL_CMP_PKISI)
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_PKISI, OSSL_CMP_PKISI, OSSL_CMP_PKISI)
|
||||
#define sk_OSSL_CMP_PKISI_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_PKISI_sk_type(sk))
|
||||
#define sk_OSSL_CMP_PKISI_value(sk, idx) ((OSSL_CMP_PKISI *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_PKISI_sk_type(sk), (idx)))
|
||||
#define sk_OSSL_CMP_PKISI_new(cmp) ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_PKISI_compfunc_type(cmp)))
|
||||
#define sk_OSSL_CMP_PKISI_new_null() ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_new_null())
|
||||
#define sk_OSSL_CMP_PKISI_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_PKISI_compfunc_type(cmp), (n)))
|
||||
#define sk_OSSL_CMP_PKISI_new(cmp) ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_OSSL_CMP_PKISI_compfunc_type(cmp)), sk_OSSL_CMP_PKISI_cmpfunc_thunk))
|
||||
#define sk_OSSL_CMP_PKISI_new_null() ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_OSSL_CMP_PKISI_freefunc_thunk))
|
||||
#define sk_OSSL_CMP_PKISI_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_PKISI_compfunc_type(cmp), (n)), sk_OSSL_CMP_PKISI_cmpfunc_thunk))
|
||||
#define sk_OSSL_CMP_PKISI_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_PKISI_sk_type(sk), (n))
|
||||
#define sk_OSSL_CMP_PKISI_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_PKISI_sk_type(sk))
|
||||
#define sk_OSSL_CMP_PKISI_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_PKISI_sk_type(sk))
|
||||
@@ -302,13 +357,15 @@ SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_PKISI, OSSL_CMP_PKISI, OSSL_CMP_PKISI)
|
||||
#define sk_OSSL_CMP_PKISI_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_PKISI) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_PKISI_freefunc_type(freefunc)))
|
||||
#define sk_OSSL_CMP_PKISI_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_PKISI_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_PKISI_sk_type(sk), ossl_check_OSSL_CMP_PKISI_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
typedef struct ossl_cmp_certrepmessage_st OSSL_CMP_CERTREPMESSAGE;
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_CERTREPMESSAGE, OSSL_CMP_CERTREPMESSAGE, OSSL_CMP_CERTREPMESSAGE)
|
||||
#define sk_OSSL_CMP_CERTREPMESSAGE_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_CERTREPMESSAGE_sk_type(sk))
|
||||
#define sk_OSSL_CMP_CERTREPMESSAGE_value(sk, idx) ((OSSL_CMP_CERTREPMESSAGE *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), (idx)))
|
||||
#define sk_OSSL_CMP_CERTREPMESSAGE_new(cmp) ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_CERTREPMESSAGE_compfunc_type(cmp)))
|
||||
#define sk_OSSL_CMP_CERTREPMESSAGE_new_null() ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_new_null())
|
||||
#define sk_OSSL_CMP_CERTREPMESSAGE_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_CERTREPMESSAGE_compfunc_type(cmp), (n)))
|
||||
#define sk_OSSL_CMP_CERTREPMESSAGE_new(cmp) ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_OSSL_CMP_CERTREPMESSAGE_compfunc_type(cmp)), sk_OSSL_CMP_CERTREPMESSAGE_cmpfunc_thunk))
|
||||
#define sk_OSSL_CMP_CERTREPMESSAGE_new_null() ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_OSSL_CMP_CERTREPMESSAGE_freefunc_thunk))
|
||||
#define sk_OSSL_CMP_CERTREPMESSAGE_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_CERTREPMESSAGE_compfunc_type(cmp), (n)), sk_OSSL_CMP_CERTREPMESSAGE_cmpfunc_thunk))
|
||||
#define sk_OSSL_CMP_CERTREPMESSAGE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), (n))
|
||||
#define sk_OSSL_CMP_CERTREPMESSAGE_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk))
|
||||
#define sk_OSSL_CMP_CERTREPMESSAGE_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk))
|
||||
@@ -330,15 +387,17 @@ SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_CERTREPMESSAGE, OSSL_CMP_CERTREPMESSAGE, O
|
||||
#define sk_OSSL_CMP_CERTREPMESSAGE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_CERTREPMESSAGE) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_CERTREPMESSAGE_freefunc_type(freefunc)))
|
||||
#define sk_OSSL_CMP_CERTREPMESSAGE_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_CERTREPMESSAGE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_CERTREPMESSAGE_sk_type(sk), ossl_check_OSSL_CMP_CERTREPMESSAGE_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
typedef struct ossl_cmp_pollrep_st OSSL_CMP_POLLREP;
|
||||
typedef STACK_OF(OSSL_CMP_POLLREP) OSSL_CMP_POLLREPCONTENT;
|
||||
typedef struct ossl_cmp_certresponse_st OSSL_CMP_CERTRESPONSE;
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_CERTRESPONSE, OSSL_CMP_CERTRESPONSE, OSSL_CMP_CERTRESPONSE)
|
||||
#define sk_OSSL_CMP_CERTRESPONSE_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CMP_CERTRESPONSE_sk_type(sk))
|
||||
#define sk_OSSL_CMP_CERTRESPONSE_value(sk, idx) ((OSSL_CMP_CERTRESPONSE *)OPENSSL_sk_value(ossl_check_const_OSSL_CMP_CERTRESPONSE_sk_type(sk), (idx)))
|
||||
#define sk_OSSL_CMP_CERTRESPONSE_new(cmp) ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_new(ossl_check_OSSL_CMP_CERTRESPONSE_compfunc_type(cmp)))
|
||||
#define sk_OSSL_CMP_CERTRESPONSE_new_null() ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_new_null())
|
||||
#define sk_OSSL_CMP_CERTRESPONSE_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_CERTRESPONSE_compfunc_type(cmp), (n)))
|
||||
#define sk_OSSL_CMP_CERTRESPONSE_new(cmp) ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_OSSL_CMP_CERTRESPONSE_compfunc_type(cmp)), sk_OSSL_CMP_CERTRESPONSE_cmpfunc_thunk))
|
||||
#define sk_OSSL_CMP_CERTRESPONSE_new_null() ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_OSSL_CMP_CERTRESPONSE_freefunc_thunk))
|
||||
#define sk_OSSL_CMP_CERTRESPONSE_new_reserve(cmp, n) ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_OSSL_CMP_CERTRESPONSE_compfunc_type(cmp), (n)), sk_OSSL_CMP_CERTRESPONSE_cmpfunc_thunk))
|
||||
#define sk_OSSL_CMP_CERTRESPONSE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), (n))
|
||||
#define sk_OSSL_CMP_CERTRESPONSE_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk))
|
||||
#define sk_OSSL_CMP_CERTRESPONSE_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk))
|
||||
@@ -360,6 +419,7 @@ SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CMP_CERTRESPONSE, OSSL_CMP_CERTRESPONSE, OSSL_
|
||||
#define sk_OSSL_CMP_CERTRESPONSE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CMP_CERTRESPONSE) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_copyfunc_type(copyfunc), ossl_check_OSSL_CMP_CERTRESPONSE_freefunc_type(freefunc)))
|
||||
#define sk_OSSL_CMP_CERTRESPONSE_set_cmp_func(sk, cmp) ((sk_OSSL_CMP_CERTRESPONSE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CMP_CERTRESPONSE_sk_type(sk), ossl_check_OSSL_CMP_CERTRESPONSE_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
typedef STACK_OF(ASN1_UTF8STRING) OSSL_CMP_PKIFREETEXT;
|
||||
|
||||
/*
|
||||
@@ -372,21 +432,75 @@ void OSSL_CMP_ITAV_set0(OSSL_CMP_ITAV *itav, ASN1_OBJECT *type,
|
||||
ASN1_TYPE *value);
|
||||
ASN1_OBJECT *OSSL_CMP_ITAV_get0_type(const OSSL_CMP_ITAV *itav);
|
||||
ASN1_TYPE *OSSL_CMP_ITAV_get0_value(const OSSL_CMP_ITAV *itav);
|
||||
int OSSL_CMP_ITAV_push0_stack_item(STACK_OF(OSSL_CMP_ITAV) **itav_sk_p,
|
||||
int OSSL_CMP_ITAV_push0_stack_item(STACK_OF(OSSL_CMP_ITAV) **sk_p,
|
||||
OSSL_CMP_ITAV *itav);
|
||||
void OSSL_CMP_ITAV_free(OSSL_CMP_ITAV *itav);
|
||||
|
||||
OSSL_CMP_ITAV *OSSL_CMP_ITAV_new0_certProfile(STACK_OF(ASN1_UTF8STRING)
|
||||
*certProfile);
|
||||
int OSSL_CMP_ITAV_get0_certProfile(const OSSL_CMP_ITAV *itav,
|
||||
STACK_OF(ASN1_UTF8STRING) **out);
|
||||
OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_caCerts(const STACK_OF(X509) *caCerts);
|
||||
int OSSL_CMP_ITAV_get0_caCerts(const OSSL_CMP_ITAV *itav, STACK_OF(X509) **out);
|
||||
|
||||
OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_rootCaCert(const X509 *rootCaCert);
|
||||
int OSSL_CMP_ITAV_get0_rootCaCert(const OSSL_CMP_ITAV *itav, X509 **out);
|
||||
OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_rootCaKeyUpdate(const X509 *newWithNew,
|
||||
const X509 *newWithOld,
|
||||
const X509 *oldWithNew);
|
||||
int OSSL_CMP_ITAV_get0_rootCaKeyUpdate(const OSSL_CMP_ITAV *itav,
|
||||
X509 **newWithNew,
|
||||
X509 **newWithOld,
|
||||
X509 **oldWithNew);
|
||||
|
||||
OSSL_CMP_CRLSTATUS *OSSL_CMP_CRLSTATUS_create(const X509_CRL *crl,
|
||||
const X509 *cert, int only_DN);
|
||||
OSSL_CMP_CRLSTATUS *OSSL_CMP_CRLSTATUS_new1(const DIST_POINT_NAME *dpn,
|
||||
const GENERAL_NAMES *issuer,
|
||||
const ASN1_TIME *thisUpdate);
|
||||
int OSSL_CMP_CRLSTATUS_get0(const OSSL_CMP_CRLSTATUS *crlstatus,
|
||||
DIST_POINT_NAME **dpn, GENERAL_NAMES **issuer,
|
||||
ASN1_TIME **thisUpdate);
|
||||
void OSSL_CMP_CRLSTATUS_free(OSSL_CMP_CRLSTATUS *crlstatus);
|
||||
OSSL_CMP_ITAV
|
||||
*OSSL_CMP_ITAV_new0_crlStatusList(STACK_OF(OSSL_CMP_CRLSTATUS) *crlStatusList);
|
||||
int OSSL_CMP_ITAV_get0_crlStatusList(const OSSL_CMP_ITAV *itav,
|
||||
STACK_OF(OSSL_CMP_CRLSTATUS) **out);
|
||||
OSSL_CMP_ITAV *OSSL_CMP_ITAV_new_crls(const X509_CRL *crls);
|
||||
int OSSL_CMP_ITAV_get0_crls(const OSSL_CMP_ITAV *it, STACK_OF(X509_CRL) **out);
|
||||
OSSL_CMP_ITAV
|
||||
*OSSL_CMP_ITAV_new0_certReqTemplate(OSSL_CRMF_CERTTEMPLATE *certTemplate,
|
||||
OSSL_CMP_ATAVS *keySpec);
|
||||
int OSSL_CMP_ITAV_get1_certReqTemplate(const OSSL_CMP_ITAV *itav,
|
||||
OSSL_CRMF_CERTTEMPLATE **certTemplate,
|
||||
OSSL_CMP_ATAVS **keySpec);
|
||||
|
||||
OSSL_CMP_ATAV *OSSL_CMP_ATAV_create(ASN1_OBJECT *type, ASN1_TYPE *value);
|
||||
void OSSL_CMP_ATAV_set0(OSSL_CMP_ATAV *itav, ASN1_OBJECT *type,
|
||||
ASN1_TYPE *value);
|
||||
ASN1_OBJECT *OSSL_CMP_ATAV_get0_type(const OSSL_CMP_ATAV *itav);
|
||||
ASN1_TYPE *OSSL_CMP_ATAV_get0_value(const OSSL_CMP_ATAV *itav);
|
||||
OSSL_CMP_ATAV *OSSL_CMP_ATAV_new_algId(const X509_ALGOR *alg);
|
||||
X509_ALGOR *OSSL_CMP_ATAV_get0_algId(const OSSL_CMP_ATAV *atav);
|
||||
OSSL_CMP_ATAV *OSSL_CMP_ATAV_new_rsaKeyLen(int len);
|
||||
int OSSL_CMP_ATAV_get_rsaKeyLen(const OSSL_CMP_ATAV *atav);
|
||||
int OSSL_CMP_ATAV_push1(OSSL_CMP_ATAVS **sk_p, const OSSL_CMP_ATAV *atav);
|
||||
|
||||
void OSSL_CMP_MSG_free(OSSL_CMP_MSG *msg);
|
||||
|
||||
/* from cmp_ctx.c */
|
||||
OSSL_CMP_CTX *OSSL_CMP_CTX_new(OSSL_LIB_CTX *libctx, const char *propq);
|
||||
void OSSL_CMP_CTX_free(OSSL_CMP_CTX *ctx);
|
||||
int OSSL_CMP_CTX_reinit(OSSL_CMP_CTX *ctx);
|
||||
OSSL_LIB_CTX *OSSL_CMP_CTX_get0_libctx(const OSSL_CMP_CTX *ctx);
|
||||
const char *OSSL_CMP_CTX_get0_propq(const OSSL_CMP_CTX *ctx);
|
||||
/* CMP general options: */
|
||||
#define OSSL_CMP_OPT_LOG_VERBOSITY 0
|
||||
/* CMP transfer options: */
|
||||
#define OSSL_CMP_OPT_KEEP_ALIVE 10
|
||||
#define OSSL_CMP_OPT_MSG_TIMEOUT 11
|
||||
#define OSSL_CMP_OPT_TOTAL_TIMEOUT 12
|
||||
#define OSSL_CMP_OPT_USE_TLS 13
|
||||
/* CMP request options: */
|
||||
#define OSSL_CMP_OPT_VALIDITY_DAYS 20
|
||||
#define OSSL_CMP_OPT_SUBJECTALTNAME_NODEFAULT 21
|
||||
@@ -404,6 +518,7 @@ int OSSL_CMP_CTX_reinit(OSSL_CMP_CTX *ctx);
|
||||
#define OSSL_CMP_OPT_DIGEST_ALGNID 34
|
||||
#define OSSL_CMP_OPT_IGNORE_KEYUSAGE 35
|
||||
#define OSSL_CMP_OPT_PERMIT_TA_IN_EXTRACERTS_FOR_IR 36
|
||||
#define OSSL_CMP_OPT_NO_CACHE_EXTRACERTS 37
|
||||
int OSSL_CMP_CTX_set_option(OSSL_CMP_CTX *ctx, int opt, int val);
|
||||
int OSSL_CMP_CTX_get_option(const OSSL_CMP_CTX *ctx, int opt);
|
||||
/* CMP-specific callback for logging and outputting the error queue: */
|
||||
@@ -417,9 +532,11 @@ int OSSL_CMP_CTX_set1_server(OSSL_CMP_CTX *ctx, const char *address);
|
||||
int OSSL_CMP_CTX_set_serverPort(OSSL_CMP_CTX *ctx, int port);
|
||||
int OSSL_CMP_CTX_set1_proxy(OSSL_CMP_CTX *ctx, const char *name);
|
||||
int OSSL_CMP_CTX_set1_no_proxy(OSSL_CMP_CTX *ctx, const char *names);
|
||||
#ifndef OPENSSL_NO_HTTP
|
||||
int OSSL_CMP_CTX_set_http_cb(OSSL_CMP_CTX *ctx, OSSL_HTTP_bio_cb_t cb);
|
||||
int OSSL_CMP_CTX_set_http_cb_arg(OSSL_CMP_CTX *ctx, void *arg);
|
||||
void *OSSL_CMP_CTX_get_http_cb_arg(const OSSL_CMP_CTX *ctx);
|
||||
#endif
|
||||
typedef OSSL_CMP_MSG *(*OSSL_CMP_transfer_cb_t)(OSSL_CMP_CTX *ctx,
|
||||
const OSSL_CMP_MSG *req);
|
||||
int OSSL_CMP_CTX_set_transfer_cb(OSSL_CMP_CTX *ctx, OSSL_CMP_transfer_cb_t cb);
|
||||
@@ -429,7 +546,9 @@ void *OSSL_CMP_CTX_get_transfer_cb_arg(const OSSL_CMP_CTX *ctx);
|
||||
int OSSL_CMP_CTX_set1_srvCert(OSSL_CMP_CTX *ctx, X509 *cert);
|
||||
int OSSL_CMP_CTX_set1_expected_sender(OSSL_CMP_CTX *ctx, const X509_NAME *name);
|
||||
int OSSL_CMP_CTX_set0_trustedStore(OSSL_CMP_CTX *ctx, X509_STORE *store);
|
||||
#define OSSL_CMP_CTX_set0_trusted OSSL_CMP_CTX_set0_trustedStore
|
||||
X509_STORE *OSSL_CMP_CTX_get0_trustedStore(const OSSL_CMP_CTX *ctx);
|
||||
#define OSSL_CMP_CTX_get0_trusted OSSL_CMP_CTX_get0_trustedStore
|
||||
int OSSL_CMP_CTX_set1_untrusted(OSSL_CMP_CTX *ctx, STACK_OF(X509) *certs);
|
||||
STACK_OF(X509) *OSSL_CMP_CTX_get0_untrusted(const OSSL_CMP_CTX *ctx);
|
||||
/* client authentication: */
|
||||
@@ -439,17 +558,21 @@ int OSSL_CMP_CTX_build_cert_chain(OSSL_CMP_CTX *ctx, X509_STORE *own_trusted,
|
||||
int OSSL_CMP_CTX_set1_pkey(OSSL_CMP_CTX *ctx, EVP_PKEY *pkey);
|
||||
int OSSL_CMP_CTX_set1_referenceValue(OSSL_CMP_CTX *ctx,
|
||||
const unsigned char *ref, int len);
|
||||
int OSSL_CMP_CTX_set1_secretValue(OSSL_CMP_CTX *ctx, const unsigned char *sec,
|
||||
const int len);
|
||||
int OSSL_CMP_CTX_set1_secretValue(OSSL_CMP_CTX *ctx,
|
||||
const unsigned char *sec, int len);
|
||||
/* CMP message header and extra certificates: */
|
||||
int OSSL_CMP_CTX_set1_recipient(OSSL_CMP_CTX *ctx, const X509_NAME *name);
|
||||
int OSSL_CMP_CTX_push0_geninfo_ITAV(OSSL_CMP_CTX *ctx, OSSL_CMP_ITAV *itav);
|
||||
int OSSL_CMP_CTX_reset_geninfo_ITAVs(OSSL_CMP_CTX *ctx);
|
||||
STACK_OF(OSSL_CMP_ITAV)
|
||||
*OSSL_CMP_CTX_get0_geninfo_ITAVs(const OSSL_CMP_CTX *ctx);
|
||||
int OSSL_CMP_CTX_set1_extraCertsOut(OSSL_CMP_CTX *ctx,
|
||||
STACK_OF(X509) *extraCertsOut);
|
||||
/* certificate template: */
|
||||
int OSSL_CMP_CTX_set0_newPkey(OSSL_CMP_CTX *ctx, int priv, EVP_PKEY *pkey);
|
||||
EVP_PKEY *OSSL_CMP_CTX_get0_newPkey(const OSSL_CMP_CTX *ctx, int priv);
|
||||
int OSSL_CMP_CTX_set1_issuer(OSSL_CMP_CTX *ctx, const X509_NAME *name);
|
||||
int OSSL_CMP_CTX_set1_serialNumber(OSSL_CMP_CTX *ctx, const ASN1_INTEGER *sn);
|
||||
int OSSL_CMP_CTX_set1_subjectName(OSSL_CMP_CTX *ctx, const X509_NAME *name);
|
||||
int OSSL_CMP_CTX_push1_subjectAltName(OSSL_CMP_CTX *ctx,
|
||||
const GENERAL_NAME *name);
|
||||
@@ -473,6 +596,7 @@ int OSSL_CMP_CTX_get_status(const OSSL_CMP_CTX *ctx);
|
||||
OSSL_CMP_PKIFREETEXT *OSSL_CMP_CTX_get0_statusString(const OSSL_CMP_CTX *ctx);
|
||||
int OSSL_CMP_CTX_get_failInfoCode(const OSSL_CMP_CTX *ctx);
|
||||
#define OSSL_CMP_PKISI_BUFLEN 1024
|
||||
X509 *OSSL_CMP_CTX_get0_validatedSrvCert(const OSSL_CMP_CTX *ctx);
|
||||
X509 *OSSL_CMP_CTX_get0_newCert(const OSSL_CMP_CTX *ctx);
|
||||
STACK_OF(X509) *OSSL_CMP_CTX_get1_newChain(const OSSL_CMP_CTX *ctx);
|
||||
STACK_OF(X509) *OSSL_CMP_CTX_get1_caPubs(const OSSL_CMP_CTX *ctx);
|
||||
@@ -491,14 +615,17 @@ OSSL_CMP_PKISI *
|
||||
OSSL_CMP_STATUSINFO_new(int status, int fail_info, const char *text);
|
||||
|
||||
/* from cmp_hdr.c */
|
||||
ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_transactionID(const
|
||||
OSSL_CMP_PKIHEADER *hdr);
|
||||
ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_transactionID(const OSSL_CMP_PKIHEADER *hdr);
|
||||
ASN1_OCTET_STRING *OSSL_CMP_HDR_get0_recipNonce(const OSSL_CMP_PKIHEADER *hdr);
|
||||
STACK_OF(OSSL_CMP_ITAV)
|
||||
*OSSL_CMP_HDR_get0_geninfo_ITAVs(const OSSL_CMP_PKIHEADER *hdr);
|
||||
|
||||
/* from cmp_msg.c */
|
||||
OSSL_CMP_PKIHEADER *OSSL_CMP_MSG_get0_header(const OSSL_CMP_MSG *msg);
|
||||
int OSSL_CMP_MSG_get_bodytype(const OSSL_CMP_MSG *msg);
|
||||
X509_PUBKEY *OSSL_CMP_MSG_get0_certreq_publickey(const OSSL_CMP_MSG *msg);
|
||||
int OSSL_CMP_MSG_update_transactionID(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg);
|
||||
int OSSL_CMP_MSG_update_recipNonce(OSSL_CMP_CTX *ctx, OSSL_CMP_MSG *msg);
|
||||
OSSL_CRMF_MSG *OSSL_CMP_CTX_setup_CRM(OSSL_CMP_CTX *ctx, int for_KUR, int rid);
|
||||
OSSL_CMP_MSG *OSSL_CMP_MSG_read(const char *file, OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
@@ -512,8 +639,10 @@ int OSSL_CMP_validate_cert_path(const OSSL_CMP_CTX *ctx,
|
||||
X509_STORE *trusted_store, X509 *cert);
|
||||
|
||||
/* from cmp_http.c */
|
||||
#ifndef OPENSSL_NO_HTTP
|
||||
OSSL_CMP_MSG *OSSL_CMP_MSG_http_perform(OSSL_CMP_CTX *ctx,
|
||||
const OSSL_CMP_MSG *req);
|
||||
#endif
|
||||
|
||||
/* from cmp_server.c */
|
||||
typedef struct ossl_cmp_srv_ctx_st OSSL_CMP_SRV_CTX;
|
||||
@@ -523,9 +652,9 @@ OSSL_CMP_MSG * OSSL_CMP_CTX_server_perform(OSSL_CMP_CTX *client_ctx,
|
||||
const OSSL_CMP_MSG *req);
|
||||
OSSL_CMP_SRV_CTX *OSSL_CMP_SRV_CTX_new(OSSL_LIB_CTX *libctx, const char *propq);
|
||||
void OSSL_CMP_SRV_CTX_free(OSSL_CMP_SRV_CTX *srv_ctx);
|
||||
typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_cert_request_cb_t)
|
||||
(OSSL_CMP_SRV_CTX *srv_ctx, const OSSL_CMP_MSG *req, int certReqId,
|
||||
const OSSL_CRMF_MSG *crm, const X509_REQ *p10cr,
|
||||
typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_cert_request_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
|
||||
const OSSL_CMP_MSG *req, int certReqId,
|
||||
const OSSL_CRMF_MSG *crm, const X509_REQ *p10,
|
||||
X509 **certOut, STACK_OF(X509) **chainOut, STACK_OF(X509) **caPubs);
|
||||
typedef OSSL_CMP_PKISI *(*OSSL_CMP_SRV_rr_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
|
||||
const OSSL_CMP_MSG *req,
|
||||
@@ -556,6 +685,13 @@ int OSSL_CMP_SRV_CTX_init(OSSL_CMP_SRV_CTX *srv_ctx, void *custom_ctx,
|
||||
OSSL_CMP_SRV_error_cb_t process_error,
|
||||
OSSL_CMP_SRV_certConf_cb_t process_certConf,
|
||||
OSSL_CMP_SRV_pollReq_cb_t process_pollReq);
|
||||
typedef int (*OSSL_CMP_SRV_delayed_delivery_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
|
||||
const OSSL_CMP_MSG *req);
|
||||
typedef int (*OSSL_CMP_SRV_clean_transaction_cb_t)(OSSL_CMP_SRV_CTX *srv_ctx,
|
||||
const ASN1_OCTET_STRING *id);
|
||||
int OSSL_CMP_SRV_CTX_init_trans(OSSL_CMP_SRV_CTX *srv_ctx,
|
||||
OSSL_CMP_SRV_delayed_delivery_cb_t delay,
|
||||
OSSL_CMP_SRV_clean_transaction_cb_t clean);
|
||||
OSSL_CMP_CTX *OSSL_CMP_SRV_CTX_get0_cmp_ctx(const OSSL_CMP_SRV_CTX *srv_ctx);
|
||||
void *OSSL_CMP_SRV_CTX_get0_custom_ctx(const OSSL_CMP_SRV_CTX *srv_ctx);
|
||||
int OSSL_CMP_SRV_CTX_set_send_unprotected_errors(OSSL_CMP_SRV_CTX *srv_ctx,
|
||||
@@ -572,6 +708,8 @@ X509 *OSSL_CMP_exec_certreq(OSSL_CMP_CTX *ctx, int req_type,
|
||||
#define OSSL_CMP_CR 2
|
||||
#define OSSL_CMP_P10CR 4
|
||||
#define OSSL_CMP_KUR 7
|
||||
#define OSSL_CMP_GENM 21
|
||||
#define OSSL_CMP_ERROR 23
|
||||
#define OSSL_CMP_exec_IR_ses(ctx) \
|
||||
OSSL_CMP_exec_certreq(ctx, OSSL_CMP_IR, NULL)
|
||||
#define OSSL_CMP_exec_CR_ses(ctx) \
|
||||
@@ -585,6 +723,18 @@ int OSSL_CMP_try_certreq(OSSL_CMP_CTX *ctx, int req_type,
|
||||
int OSSL_CMP_exec_RR_ses(OSSL_CMP_CTX *ctx);
|
||||
STACK_OF(OSSL_CMP_ITAV) *OSSL_CMP_exec_GENM_ses(OSSL_CMP_CTX *ctx);
|
||||
|
||||
/* from cmp_genm.c */
|
||||
int OSSL_CMP_get1_caCerts(OSSL_CMP_CTX *ctx, STACK_OF(X509) **out);
|
||||
int OSSL_CMP_get1_rootCaKeyUpdate(OSSL_CMP_CTX *ctx,
|
||||
const X509 *oldWithOld, X509 **newWithNew,
|
||||
X509 **newWithOld, X509 **oldWithNew);
|
||||
int OSSL_CMP_get1_crlUpdate(OSSL_CMP_CTX *ctx, const X509 *crlcert,
|
||||
const X509_CRL *last_crl,
|
||||
X509_CRL **crl);
|
||||
int OSSL_CMP_get1_certReqTemplate(OSSL_CMP_CTX *ctx,
|
||||
OSSL_CRMF_CERTTEMPLATE **certTemplate,
|
||||
OSSL_CMP_ATAVS **keySpec);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright Nokia 2007-2019
|
||||
* Copyright Siemens AG 2015-2019
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef OPENSSL_CMP_UTIL_H
|
||||
#define OPENSSL_CMP_UTIL_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
#ifndef OPENSSL_NO_CMP
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#include <openssl/trace.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int OSSL_CMP_log_open(void);
|
||||
void OSSL_CMP_log_close(void);
|
||||
#define OSSL_CMP_LOG_PREFIX "CMP "
|
||||
|
||||
/*
|
||||
* generalized logging/error callback mirroring the severity levels of syslog.h
|
||||
*/
|
||||
typedef int OSSL_CMP_severity;
|
||||
#define OSSL_CMP_LOG_EMERG 0
|
||||
#define OSSL_CMP_LOG_ALERT 1
|
||||
#define OSSL_CMP_LOG_CRIT 2
|
||||
#define OSSL_CMP_LOG_ERR 3
|
||||
#define OSSL_CMP_LOG_WARNING 4
|
||||
#define OSSL_CMP_LOG_NOTICE 5
|
||||
#define OSSL_CMP_LOG_INFO 6
|
||||
#define OSSL_CMP_LOG_DEBUG 7
|
||||
#define OSSL_CMP_LOG_TRACE 8
|
||||
#define OSSL_CMP_LOG_MAX OSSL_CMP_LOG_TRACE
|
||||
typedef int (*OSSL_CMP_log_cb_t)(const char *func, const char *file, int line,
|
||||
OSSL_CMP_severity level, const char *msg);
|
||||
|
||||
int OSSL_CMP_print_to_bio(BIO *bio, const char *component, const char *file,
|
||||
int line, OSSL_CMP_severity level, const char *msg);
|
||||
/* use of the logging callback for outputting error queue */
|
||||
void OSSL_CMP_print_errors_cb(OSSL_CMP_log_cb_t log_fn);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* !defined(OPENSSL_NO_CMP) */
|
||||
#endif /* !defined(OPENSSL_CMP_UTIL_H) */
|
||||
@@ -0,0 +1,132 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef OPENSSL_CMPERR_H
|
||||
#define OPENSSL_CMPERR_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/symhacks.h>
|
||||
#include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
#ifndef OPENSSL_NO_CMP
|
||||
|
||||
/*
|
||||
* CMP reason codes.
|
||||
*/
|
||||
#define CMP_R_ALGORITHM_NOT_SUPPORTED 139
|
||||
#define CMP_R_BAD_CHECKAFTER_IN_POLLREP 167
|
||||
#define CMP_R_BAD_REQUEST_ID 108
|
||||
#define CMP_R_CERTHASH_UNMATCHED 156
|
||||
#define CMP_R_CERTID_NOT_FOUND 109
|
||||
#define CMP_R_CERTIFICATE_NOT_ACCEPTED 169
|
||||
#define CMP_R_CERTIFICATE_NOT_FOUND 112
|
||||
#define CMP_R_CERTREQMSG_NOT_FOUND 157
|
||||
#define CMP_R_CERTRESPONSE_NOT_FOUND 113
|
||||
#define CMP_R_CERT_AND_KEY_DO_NOT_MATCH 114
|
||||
#define CMP_R_CHECKAFTER_OUT_OF_RANGE 181
|
||||
#define CMP_R_ENCOUNTERED_KEYUPDATEWARNING 176
|
||||
#define CMP_R_ENCOUNTERED_WAITING 162
|
||||
#define CMP_R_ERROR_CALCULATING_PROTECTION 115
|
||||
#define CMP_R_ERROR_CREATING_CERTCONF 116
|
||||
#define CMP_R_ERROR_CREATING_CERTREP 117
|
||||
#define CMP_R_ERROR_CREATING_CERTREQ 163
|
||||
#define CMP_R_ERROR_CREATING_ERROR 118
|
||||
#define CMP_R_ERROR_CREATING_GENM 119
|
||||
#define CMP_R_ERROR_CREATING_GENP 120
|
||||
#define CMP_R_ERROR_CREATING_PKICONF 122
|
||||
#define CMP_R_ERROR_CREATING_POLLREP 123
|
||||
#define CMP_R_ERROR_CREATING_POLLREQ 124
|
||||
#define CMP_R_ERROR_CREATING_RP 125
|
||||
#define CMP_R_ERROR_CREATING_RR 126
|
||||
#define CMP_R_ERROR_PARSING_PKISTATUS 107
|
||||
#define CMP_R_ERROR_PROCESSING_MESSAGE 158
|
||||
#define CMP_R_ERROR_PROTECTING_MESSAGE 127
|
||||
#define CMP_R_ERROR_SETTING_CERTHASH 128
|
||||
#define CMP_R_ERROR_UNEXPECTED_CERTCONF 160
|
||||
#define CMP_R_ERROR_VALIDATING_PROTECTION 140
|
||||
#define CMP_R_ERROR_VALIDATING_SIGNATURE 171
|
||||
#define CMP_R_EXPECTED_POLLREQ 104
|
||||
#define CMP_R_FAILED_BUILDING_OWN_CHAIN 164
|
||||
#define CMP_R_FAILED_EXTRACTING_CENTRAL_GEN_KEY 203
|
||||
#define CMP_R_FAILED_EXTRACTING_PUBKEY 141
|
||||
#define CMP_R_FAILURE_OBTAINING_RANDOM 110
|
||||
#define CMP_R_FAIL_INFO_OUT_OF_RANGE 129
|
||||
#define CMP_R_GENERATE_CERTREQTEMPLATE 197
|
||||
#define CMP_R_GENERATE_CRLSTATUS 198
|
||||
#define CMP_R_GETTING_GENP 192
|
||||
#define CMP_R_GET_ITAV 199
|
||||
#define CMP_R_INVALID_ARGS 100
|
||||
#define CMP_R_INVALID_GENP 193
|
||||
#define CMP_R_INVALID_KEYSPEC 202
|
||||
#define CMP_R_INVALID_OPTION 174
|
||||
#define CMP_R_INVALID_ROOTCAKEYUPDATE 195
|
||||
#define CMP_R_MISSING_CENTRAL_GEN_KEY 204
|
||||
#define CMP_R_MISSING_CERTID 165
|
||||
#define CMP_R_MISSING_KEY_INPUT_FOR_CREATING_PROTECTION 130
|
||||
#define CMP_R_MISSING_KEY_USAGE_DIGITALSIGNATURE 142
|
||||
#define CMP_R_MISSING_P10CSR 121
|
||||
#define CMP_R_MISSING_PBM_SECRET 166
|
||||
#define CMP_R_MISSING_PRIVATE_KEY 131
|
||||
#define CMP_R_MISSING_PRIVATE_KEY_FOR_POPO 190
|
||||
#define CMP_R_MISSING_PROTECTION 143
|
||||
#define CMP_R_MISSING_PUBLIC_KEY 183
|
||||
#define CMP_R_MISSING_REFERENCE_CERT 168
|
||||
#define CMP_R_MISSING_SECRET 178
|
||||
#define CMP_R_MISSING_SENDER_IDENTIFICATION 111
|
||||
#define CMP_R_MISSING_TRUST_ANCHOR 179
|
||||
#define CMP_R_MISSING_TRUST_STORE 144
|
||||
#define CMP_R_MULTIPLE_REQUESTS_NOT_SUPPORTED 161
|
||||
#define CMP_R_MULTIPLE_RESPONSES_NOT_SUPPORTED 170
|
||||
#define CMP_R_MULTIPLE_SAN_SOURCES 102
|
||||
#define CMP_R_NO_STDIO 194
|
||||
#define CMP_R_NO_SUITABLE_SENDER_CERT 145
|
||||
#define CMP_R_NULL_ARGUMENT 103
|
||||
#define CMP_R_PKIBODY_ERROR 146
|
||||
#define CMP_R_PKISTATUSINFO_NOT_FOUND 132
|
||||
#define CMP_R_POLLING_FAILED 172
|
||||
#define CMP_R_POTENTIALLY_INVALID_CERTIFICATE 147
|
||||
#define CMP_R_RECEIVED_ERROR 180
|
||||
#define CMP_R_RECIPNONCE_UNMATCHED 148
|
||||
#define CMP_R_REQUEST_NOT_ACCEPTED 149
|
||||
#define CMP_R_REQUEST_REJECTED_BY_SERVER 182
|
||||
#define CMP_R_SENDER_GENERALNAME_TYPE_NOT_SUPPORTED 150
|
||||
#define CMP_R_SRVCERT_DOES_NOT_VALIDATE_MSG 151
|
||||
#define CMP_R_TOTAL_TIMEOUT 184
|
||||
#define CMP_R_TRANSACTIONID_UNMATCHED 152
|
||||
#define CMP_R_TRANSFER_ERROR 159
|
||||
#define CMP_R_UNCLEAN_CTX 191
|
||||
#define CMP_R_UNEXPECTED_CENTRAL_GEN_KEY 205
|
||||
#define CMP_R_UNEXPECTED_CERTPROFILE 196
|
||||
#define CMP_R_UNEXPECTED_CRLSTATUSLIST 201
|
||||
#define CMP_R_UNEXPECTED_PKIBODY 133
|
||||
#define CMP_R_UNEXPECTED_PKISTATUS 185
|
||||
#define CMP_R_UNEXPECTED_POLLREQ 105
|
||||
#define CMP_R_UNEXPECTED_PVNO 153
|
||||
#define CMP_R_UNEXPECTED_SENDER 106
|
||||
#define CMP_R_UNKNOWN_ALGORITHM_ID 134
|
||||
#define CMP_R_UNKNOWN_CERT_TYPE 135
|
||||
#define CMP_R_UNKNOWN_CRL_ISSUER 200
|
||||
#define CMP_R_UNKNOWN_PKISTATUS 186
|
||||
#define CMP_R_UNSUPPORTED_ALGORITHM 136
|
||||
#define CMP_R_UNSUPPORTED_KEY_TYPE 137
|
||||
#define CMP_R_UNSUPPORTED_PKIBODY 101
|
||||
#define CMP_R_UNSUPPORTED_PROTECTION_ALG_DHBASEDMAC 154
|
||||
#define CMP_R_VALUE_TOO_LARGE 175
|
||||
#define CMP_R_VALUE_TOO_SMALL 177
|
||||
#define CMP_R_WRONG_ALGORITHM_OID 138
|
||||
#define CMP_R_WRONG_CERTID 189
|
||||
#define CMP_R_WRONG_CERTID_IN_RP 187
|
||||
#define CMP_R_WRONG_PBM_VALUE 155
|
||||
#define CMP_R_WRONG_RP_COMPONENT_COUNT 188
|
||||
#define CMP_R_WRONG_SERIAL_IN_RP 173
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,14 +1,27 @@
|
||||
/*
|
||||
* Copyright 2008-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/cms.h.in
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Copyright 2008-2026 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CMS_H
|
||||
/* clang-format off */
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#ifndef OPENSSL_CMS_H
|
||||
#define OPENSSL_CMS_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_CMS_H
|
||||
#endif
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
|
||||
@@ -20,8 +33,10 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct CMS_EnvelopedData_st CMS_EnvelopedData;
|
||||
typedef struct CMS_ContentInfo_st CMS_ContentInfo;
|
||||
typedef struct CMS_SignerInfo_st CMS_SignerInfo;
|
||||
typedef struct CMS_SignedData_st CMS_SignedData;
|
||||
typedef struct CMS_CertificateChoices CMS_CertificateChoices;
|
||||
typedef struct CMS_RevocationInfoChoice_st CMS_RevocationInfoChoice;
|
||||
typedef struct CMS_RecipientInfo_st CMS_RecipientInfo;
|
||||
@@ -30,14 +45,124 @@ typedef struct CMS_Receipt_st CMS_Receipt;
|
||||
typedef struct CMS_RecipientEncryptedKey_st CMS_RecipientEncryptedKey;
|
||||
typedef struct CMS_OtherKeyAttribute_st CMS_OtherKeyAttribute;
|
||||
|
||||
DEFINE_STACK_OF(CMS_SignerInfo)
|
||||
DEFINE_STACK_OF(CMS_RecipientEncryptedKey)
|
||||
DEFINE_STACK_OF(CMS_RecipientInfo)
|
||||
DEFINE_STACK_OF(CMS_RevocationInfoChoice)
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(CMS_SignerInfo, CMS_SignerInfo, CMS_SignerInfo)
|
||||
#define sk_CMS_SignerInfo_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_SignerInfo_sk_type(sk))
|
||||
#define sk_CMS_SignerInfo_value(sk, idx) ((CMS_SignerInfo *)OPENSSL_sk_value(ossl_check_const_CMS_SignerInfo_sk_type(sk), (idx)))
|
||||
#define sk_CMS_SignerInfo_new(cmp) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_CMS_SignerInfo_compfunc_type(cmp)), sk_CMS_SignerInfo_cmpfunc_thunk))
|
||||
#define sk_CMS_SignerInfo_new_null() ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_CMS_SignerInfo_freefunc_thunk))
|
||||
#define sk_CMS_SignerInfo_new_reserve(cmp, n) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_CMS_SignerInfo_compfunc_type(cmp), (n)), sk_CMS_SignerInfo_cmpfunc_thunk))
|
||||
#define sk_CMS_SignerInfo_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_SignerInfo_sk_type(sk), (n))
|
||||
#define sk_CMS_SignerInfo_free(sk) OPENSSL_sk_free(ossl_check_CMS_SignerInfo_sk_type(sk))
|
||||
#define sk_CMS_SignerInfo_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_SignerInfo_sk_type(sk))
|
||||
#define sk_CMS_SignerInfo_delete(sk, i) ((CMS_SignerInfo *)OPENSSL_sk_delete(ossl_check_CMS_SignerInfo_sk_type(sk), (i)))
|
||||
#define sk_CMS_SignerInfo_delete_ptr(sk, ptr) ((CMS_SignerInfo *)OPENSSL_sk_delete_ptr(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr)))
|
||||
#define sk_CMS_SignerInfo_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
|
||||
#define sk_CMS_SignerInfo_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
|
||||
#define sk_CMS_SignerInfo_pop(sk) ((CMS_SignerInfo *)OPENSSL_sk_pop(ossl_check_CMS_SignerInfo_sk_type(sk)))
|
||||
#define sk_CMS_SignerInfo_shift(sk) ((CMS_SignerInfo *)OPENSSL_sk_shift(ossl_check_CMS_SignerInfo_sk_type(sk)))
|
||||
#define sk_CMS_SignerInfo_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_freefunc_type(freefunc))
|
||||
#define sk_CMS_SignerInfo_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr), (idx))
|
||||
#define sk_CMS_SignerInfo_set(sk, idx, ptr) ((CMS_SignerInfo *)OPENSSL_sk_set(ossl_check_CMS_SignerInfo_sk_type(sk), (idx), ossl_check_CMS_SignerInfo_type(ptr)))
|
||||
#define sk_CMS_SignerInfo_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
|
||||
#define sk_CMS_SignerInfo_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr))
|
||||
#define sk_CMS_SignerInfo_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_type(ptr), pnum)
|
||||
#define sk_CMS_SignerInfo_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_SignerInfo_sk_type(sk))
|
||||
#define sk_CMS_SignerInfo_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_SignerInfo_sk_type(sk))
|
||||
#define sk_CMS_SignerInfo_dup(sk) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_dup(ossl_check_const_CMS_SignerInfo_sk_type(sk)))
|
||||
#define sk_CMS_SignerInfo_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_SignerInfo) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_copyfunc_type(copyfunc), ossl_check_CMS_SignerInfo_freefunc_type(freefunc)))
|
||||
#define sk_CMS_SignerInfo_set_cmp_func(sk, cmp) ((sk_CMS_SignerInfo_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_SignerInfo_sk_type(sk), ossl_check_CMS_SignerInfo_compfunc_type(cmp)))
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(CMS_RecipientEncryptedKey, CMS_RecipientEncryptedKey, CMS_RecipientEncryptedKey)
|
||||
#define sk_CMS_RecipientEncryptedKey_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk))
|
||||
#define sk_CMS_RecipientEncryptedKey_value(sk, idx) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_value(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk), (idx)))
|
||||
#define sk_CMS_RecipientEncryptedKey_new(cmp) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_CMS_RecipientEncryptedKey_compfunc_type(cmp)), sk_CMS_RecipientEncryptedKey_cmpfunc_thunk))
|
||||
#define sk_CMS_RecipientEncryptedKey_new_null() ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_CMS_RecipientEncryptedKey_freefunc_thunk))
|
||||
#define sk_CMS_RecipientEncryptedKey_new_reserve(cmp, n) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_CMS_RecipientEncryptedKey_compfunc_type(cmp), (n)), sk_CMS_RecipientEncryptedKey_cmpfunc_thunk))
|
||||
#define sk_CMS_RecipientEncryptedKey_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), (n))
|
||||
#define sk_CMS_RecipientEncryptedKey_free(sk) OPENSSL_sk_free(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk))
|
||||
#define sk_CMS_RecipientEncryptedKey_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk))
|
||||
#define sk_CMS_RecipientEncryptedKey_delete(sk, i) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_delete(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), (i)))
|
||||
#define sk_CMS_RecipientEncryptedKey_delete_ptr(sk, ptr) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_delete_ptr(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr)))
|
||||
#define sk_CMS_RecipientEncryptedKey_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
|
||||
#define sk_CMS_RecipientEncryptedKey_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
|
||||
#define sk_CMS_RecipientEncryptedKey_pop(sk) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_pop(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk)))
|
||||
#define sk_CMS_RecipientEncryptedKey_shift(sk) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_shift(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk)))
|
||||
#define sk_CMS_RecipientEncryptedKey_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_freefunc_type(freefunc))
|
||||
#define sk_CMS_RecipientEncryptedKey_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr), (idx))
|
||||
#define sk_CMS_RecipientEncryptedKey_set(sk, idx, ptr) ((CMS_RecipientEncryptedKey *)OPENSSL_sk_set(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), (idx), ossl_check_CMS_RecipientEncryptedKey_type(ptr)))
|
||||
#define sk_CMS_RecipientEncryptedKey_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
|
||||
#define sk_CMS_RecipientEncryptedKey_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr))
|
||||
#define sk_CMS_RecipientEncryptedKey_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_type(ptr), pnum)
|
||||
#define sk_CMS_RecipientEncryptedKey_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk))
|
||||
#define sk_CMS_RecipientEncryptedKey_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk))
|
||||
#define sk_CMS_RecipientEncryptedKey_dup(sk) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_dup(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk)))
|
||||
#define sk_CMS_RecipientEncryptedKey_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_RecipientEncryptedKey) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_copyfunc_type(copyfunc), ossl_check_CMS_RecipientEncryptedKey_freefunc_type(freefunc)))
|
||||
#define sk_CMS_RecipientEncryptedKey_set_cmp_func(sk, cmp) ((sk_CMS_RecipientEncryptedKey_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_RecipientEncryptedKey_sk_type(sk), ossl_check_CMS_RecipientEncryptedKey_compfunc_type(cmp)))
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(CMS_RecipientInfo, CMS_RecipientInfo, CMS_RecipientInfo)
|
||||
#define sk_CMS_RecipientInfo_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RecipientInfo_sk_type(sk))
|
||||
#define sk_CMS_RecipientInfo_value(sk, idx) ((CMS_RecipientInfo *)OPENSSL_sk_value(ossl_check_const_CMS_RecipientInfo_sk_type(sk), (idx)))
|
||||
#define sk_CMS_RecipientInfo_new(cmp) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_CMS_RecipientInfo_compfunc_type(cmp)), sk_CMS_RecipientInfo_cmpfunc_thunk))
|
||||
#define sk_CMS_RecipientInfo_new_null() ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_CMS_RecipientInfo_freefunc_thunk))
|
||||
#define sk_CMS_RecipientInfo_new_reserve(cmp, n) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_CMS_RecipientInfo_compfunc_type(cmp), (n)), sk_CMS_RecipientInfo_cmpfunc_thunk))
|
||||
#define sk_CMS_RecipientInfo_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_RecipientInfo_sk_type(sk), (n))
|
||||
#define sk_CMS_RecipientInfo_free(sk) OPENSSL_sk_free(ossl_check_CMS_RecipientInfo_sk_type(sk))
|
||||
#define sk_CMS_RecipientInfo_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_RecipientInfo_sk_type(sk))
|
||||
#define sk_CMS_RecipientInfo_delete(sk, i) ((CMS_RecipientInfo *)OPENSSL_sk_delete(ossl_check_CMS_RecipientInfo_sk_type(sk), (i)))
|
||||
#define sk_CMS_RecipientInfo_delete_ptr(sk, ptr) ((CMS_RecipientInfo *)OPENSSL_sk_delete_ptr(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr)))
|
||||
#define sk_CMS_RecipientInfo_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
|
||||
#define sk_CMS_RecipientInfo_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
|
||||
#define sk_CMS_RecipientInfo_pop(sk) ((CMS_RecipientInfo *)OPENSSL_sk_pop(ossl_check_CMS_RecipientInfo_sk_type(sk)))
|
||||
#define sk_CMS_RecipientInfo_shift(sk) ((CMS_RecipientInfo *)OPENSSL_sk_shift(ossl_check_CMS_RecipientInfo_sk_type(sk)))
|
||||
#define sk_CMS_RecipientInfo_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_freefunc_type(freefunc))
|
||||
#define sk_CMS_RecipientInfo_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr), (idx))
|
||||
#define sk_CMS_RecipientInfo_set(sk, idx, ptr) ((CMS_RecipientInfo *)OPENSSL_sk_set(ossl_check_CMS_RecipientInfo_sk_type(sk), (idx), ossl_check_CMS_RecipientInfo_type(ptr)))
|
||||
#define sk_CMS_RecipientInfo_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
|
||||
#define sk_CMS_RecipientInfo_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr))
|
||||
#define sk_CMS_RecipientInfo_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_type(ptr), pnum)
|
||||
#define sk_CMS_RecipientInfo_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_RecipientInfo_sk_type(sk))
|
||||
#define sk_CMS_RecipientInfo_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_RecipientInfo_sk_type(sk))
|
||||
#define sk_CMS_RecipientInfo_dup(sk) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_dup(ossl_check_const_CMS_RecipientInfo_sk_type(sk)))
|
||||
#define sk_CMS_RecipientInfo_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_RecipientInfo) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_copyfunc_type(copyfunc), ossl_check_CMS_RecipientInfo_freefunc_type(freefunc)))
|
||||
#define sk_CMS_RecipientInfo_set_cmp_func(sk, cmp) ((sk_CMS_RecipientInfo_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_RecipientInfo_sk_type(sk), ossl_check_CMS_RecipientInfo_compfunc_type(cmp)))
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(CMS_RevocationInfoChoice, CMS_RevocationInfoChoice, CMS_RevocationInfoChoice)
|
||||
#define sk_CMS_RevocationInfoChoice_num(sk) OPENSSL_sk_num(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk))
|
||||
#define sk_CMS_RevocationInfoChoice_value(sk, idx) ((CMS_RevocationInfoChoice *)OPENSSL_sk_value(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk), (idx)))
|
||||
#define sk_CMS_RevocationInfoChoice_new(cmp) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_CMS_RevocationInfoChoice_compfunc_type(cmp)), sk_CMS_RevocationInfoChoice_cmpfunc_thunk))
|
||||
#define sk_CMS_RevocationInfoChoice_new_null() ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_CMS_RevocationInfoChoice_freefunc_thunk))
|
||||
#define sk_CMS_RevocationInfoChoice_new_reserve(cmp, n) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_CMS_RevocationInfoChoice_compfunc_type(cmp), (n)), sk_CMS_RevocationInfoChoice_cmpfunc_thunk))
|
||||
#define sk_CMS_RevocationInfoChoice_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), (n))
|
||||
#define sk_CMS_RevocationInfoChoice_free(sk) OPENSSL_sk_free(ossl_check_CMS_RevocationInfoChoice_sk_type(sk))
|
||||
#define sk_CMS_RevocationInfoChoice_zero(sk) OPENSSL_sk_zero(ossl_check_CMS_RevocationInfoChoice_sk_type(sk))
|
||||
#define sk_CMS_RevocationInfoChoice_delete(sk, i) ((CMS_RevocationInfoChoice *)OPENSSL_sk_delete(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), (i)))
|
||||
#define sk_CMS_RevocationInfoChoice_delete_ptr(sk, ptr) ((CMS_RevocationInfoChoice *)OPENSSL_sk_delete_ptr(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr)))
|
||||
#define sk_CMS_RevocationInfoChoice_push(sk, ptr) OPENSSL_sk_push(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
|
||||
#define sk_CMS_RevocationInfoChoice_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
|
||||
#define sk_CMS_RevocationInfoChoice_pop(sk) ((CMS_RevocationInfoChoice *)OPENSSL_sk_pop(ossl_check_CMS_RevocationInfoChoice_sk_type(sk)))
|
||||
#define sk_CMS_RevocationInfoChoice_shift(sk) ((CMS_RevocationInfoChoice *)OPENSSL_sk_shift(ossl_check_CMS_RevocationInfoChoice_sk_type(sk)))
|
||||
#define sk_CMS_RevocationInfoChoice_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_freefunc_type(freefunc))
|
||||
#define sk_CMS_RevocationInfoChoice_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr), (idx))
|
||||
#define sk_CMS_RevocationInfoChoice_set(sk, idx, ptr) ((CMS_RevocationInfoChoice *)OPENSSL_sk_set(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), (idx), ossl_check_CMS_RevocationInfoChoice_type(ptr)))
|
||||
#define sk_CMS_RevocationInfoChoice_find(sk, ptr) OPENSSL_sk_find(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
|
||||
#define sk_CMS_RevocationInfoChoice_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr))
|
||||
#define sk_CMS_RevocationInfoChoice_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_type(ptr), pnum)
|
||||
#define sk_CMS_RevocationInfoChoice_sort(sk) OPENSSL_sk_sort(ossl_check_CMS_RevocationInfoChoice_sk_type(sk))
|
||||
#define sk_CMS_RevocationInfoChoice_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk))
|
||||
#define sk_CMS_RevocationInfoChoice_dup(sk) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_dup(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk)))
|
||||
#define sk_CMS_RevocationInfoChoice_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CMS_RevocationInfoChoice) *)OPENSSL_sk_deep_copy(ossl_check_const_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_copyfunc_type(copyfunc), ossl_check_CMS_RevocationInfoChoice_freefunc_type(freefunc)))
|
||||
#define sk_CMS_RevocationInfoChoice_set_cmp_func(sk, cmp) ((sk_CMS_RevocationInfoChoice_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CMS_RevocationInfoChoice_sk_type(sk), ossl_check_CMS_RevocationInfoChoice_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
DECLARE_ASN1_ITEM(CMS_EnvelopedData)
|
||||
DECLARE_ASN1_ALLOC_FUNCTIONS(CMS_SignedData)
|
||||
DECLARE_ASN1_FUNCTIONS(CMS_ContentInfo)
|
||||
DECLARE_ASN1_FUNCTIONS(CMS_ReceiptRequest)
|
||||
DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
|
||||
|
||||
DECLARE_ASN1_DUP_FUNCTION(CMS_EnvelopedData)
|
||||
|
||||
CMS_ContentInfo *CMS_ContentInfo_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
#define CMS_SIGNERINFO_ISSUER_SERIAL 0
|
||||
#define CMS_SIGNERINFO_KEYIDENTIFIER 1
|
||||
|
||||
@@ -47,6 +172,7 @@ DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
|
||||
#define CMS_RECIPINFO_KEK 2
|
||||
#define CMS_RECIPINFO_PASS 3
|
||||
#define CMS_RECIPINFO_OTHER 4
|
||||
#define CMS_RECIPINFO_KEM 5
|
||||
|
||||
/* S/MIME related flags */
|
||||
|
||||
@@ -73,18 +199,22 @@ DECLARE_ASN1_PRINT_FUNCTION(CMS_ContentInfo)
|
||||
#define CMS_DEBUG_DECRYPT 0x20000
|
||||
#define CMS_KEY_PARAM 0x40000
|
||||
#define CMS_ASCIICRLF 0x80000
|
||||
#define CMS_CADES 0x100000
|
||||
#define CMS_USE_ORIGINATOR_KEYID 0x200000
|
||||
#define CMS_NO_SIGNING_TIME 0x400000
|
||||
|
||||
const ASN1_OBJECT *CMS_get0_type(const CMS_ContentInfo *cms);
|
||||
|
||||
BIO *CMS_dataInit(CMS_ContentInfo *cms, BIO *icont);
|
||||
int CMS_dataFinal(CMS_ContentInfo *cms, BIO *bio);
|
||||
int CMS_dataFinal_ex(CMS_ContentInfo *cms, BIO *bio, BIO *data);
|
||||
|
||||
ASN1_OCTET_STRING **CMS_get0_content(CMS_ContentInfo *cms);
|
||||
int CMS_is_detached(CMS_ContentInfo *cms);
|
||||
int CMS_set_detached(CMS_ContentInfo *cms, int detached);
|
||||
|
||||
# ifdef HEADER_PEM_H
|
||||
DECLARE_PEM_rw_const(CMS, CMS_ContentInfo)
|
||||
#ifdef OPENSSL_PEM_H
|
||||
DECLARE_PEM_rw(CMS, CMS_ContentInfo)
|
||||
#endif
|
||||
int CMS_stream(unsigned char ***boundary, CMS_ContentInfo *cms);
|
||||
CMS_ContentInfo *d2i_CMS_bio(BIO *bp, CMS_ContentInfo **cms);
|
||||
@@ -95,54 +225,72 @@ int i2d_CMS_bio_stream(BIO *out, CMS_ContentInfo *cms, BIO *in, int flags);
|
||||
int PEM_write_bio_CMS_stream(BIO *out, CMS_ContentInfo *cms, BIO *in,
|
||||
int flags);
|
||||
CMS_ContentInfo *SMIME_read_CMS(BIO *bio, BIO **bcont);
|
||||
CMS_ContentInfo *SMIME_read_CMS_ex(BIO *bio, int flags, BIO **bcont, CMS_ContentInfo **ci);
|
||||
int SMIME_write_CMS(BIO *bio, CMS_ContentInfo *cms, BIO *data, int flags);
|
||||
|
||||
int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont,
|
||||
unsigned int flags);
|
||||
|
||||
CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey,
|
||||
STACK_OF(X509) *certs, BIO *data,
|
||||
int CMS_final_digest(CMS_ContentInfo *cms,
|
||||
const unsigned char *md, unsigned int mdlen, BIO *dcont,
|
||||
unsigned int flags);
|
||||
|
||||
CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si,
|
||||
X509 *signcert, EVP_PKEY *pkey,
|
||||
STACK_OF(X509) *certs, unsigned int flags);
|
||||
CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey,
|
||||
const STACK_OF(X509) *certs, BIO *data, unsigned int flags);
|
||||
CMS_ContentInfo *CMS_sign_ex(X509 *signcert, EVP_PKEY *pkey,
|
||||
const STACK_OF(X509) *certs, BIO *data,
|
||||
unsigned int flags, OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, X509 *signcert,
|
||||
EVP_PKEY *pkey, const STACK_OF(X509) *certs, unsigned int flags);
|
||||
|
||||
int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags);
|
||||
CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags);
|
||||
CMS_ContentInfo *CMS_data_create_ex(BIO *in, unsigned int flags,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
|
||||
unsigned int flags);
|
||||
CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md,
|
||||
unsigned int flags);
|
||||
CMS_ContentInfo *CMS_digest_create_ex(BIO *in, const EVP_MD *md,
|
||||
unsigned int flags, OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
|
||||
int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms,
|
||||
const unsigned char *key, size_t keylen,
|
||||
BIO *dcont, BIO *out, unsigned int flags);
|
||||
|
||||
CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher,
|
||||
const unsigned char *key,
|
||||
size_t keylen, unsigned int flags);
|
||||
CMS_ContentInfo *CMS_EncryptedData_encrypt_ex(BIO *in, const EVP_CIPHER *cipher,
|
||||
const unsigned char *key,
|
||||
size_t keylen, unsigned int flags,
|
||||
OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
|
||||
int CMS_EncryptedData_set1_key(CMS_ContentInfo *cms, const EVP_CIPHER *ciph,
|
||||
const unsigned char *key, size_t keylen);
|
||||
|
||||
int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
|
||||
int CMS_verify(CMS_ContentInfo *cms, const STACK_OF(X509) *certs,
|
||||
X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags);
|
||||
|
||||
int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms,
|
||||
STACK_OF(X509) *certs,
|
||||
X509_STORE *store, unsigned int flags);
|
||||
const STACK_OF(X509) *certs, X509_STORE *store, unsigned int flags);
|
||||
|
||||
STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms);
|
||||
|
||||
CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in,
|
||||
CMS_ContentInfo *CMS_encrypt(const STACK_OF(X509) *certs, BIO *in,
|
||||
const EVP_CIPHER *cipher, unsigned int flags);
|
||||
CMS_ContentInfo *CMS_encrypt_ex(const STACK_OF(X509) *certs, BIO *in,
|
||||
const EVP_CIPHER *cipher, unsigned int flags,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert,
|
||||
BIO *dcont, BIO *out, unsigned int flags);
|
||||
|
||||
int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert);
|
||||
int CMS_decrypt_set1_pkey_and_peer(CMS_ContentInfo *cms, EVP_PKEY *pk,
|
||||
X509 *cert, X509 *peer);
|
||||
int CMS_decrypt_set1_key(CMS_ContentInfo *cms,
|
||||
unsigned char *key, size_t keylen,
|
||||
const unsigned char *id, size_t idlen);
|
||||
@@ -152,9 +300,23 @@ int CMS_decrypt_set1_password(CMS_ContentInfo *cms,
|
||||
STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms);
|
||||
int CMS_RecipientInfo_type(CMS_RecipientInfo *ri);
|
||||
EVP_PKEY_CTX *CMS_RecipientInfo_get0_pkey_ctx(CMS_RecipientInfo *ri);
|
||||
CMS_ContentInfo *CMS_AuthEnvelopedData_create(const EVP_CIPHER *cipher);
|
||||
CMS_ContentInfo *
|
||||
CMS_AuthEnvelopedData_create_ex(const EVP_CIPHER *cipher, OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
CMS_ContentInfo *CMS_EnvelopedData_create(const EVP_CIPHER *cipher);
|
||||
CMS_ContentInfo *CMS_EnvelopedData_create_ex(const EVP_CIPHER *cipher,
|
||||
OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
BIO *CMS_EnvelopedData_decrypt(CMS_EnvelopedData *env, BIO *detached_data,
|
||||
EVP_PKEY *pkey, X509 *cert,
|
||||
ASN1_OCTET_STRING *secret, unsigned int flags,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms,
|
||||
X509 *recip, unsigned int flags);
|
||||
CMS_RecipientInfo *CMS_add1_recipient(CMS_ContentInfo *cms, X509 *recip,
|
||||
EVP_PKEY *originatorPrivKey, X509 *originator, unsigned int flags);
|
||||
int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey);
|
||||
int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
|
||||
int CMS_RecipientInfo_ktri_get0_algs(CMS_RecipientInfo *ri,
|
||||
@@ -197,7 +359,7 @@ CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms,
|
||||
const EVP_CIPHER *kekciph);
|
||||
|
||||
int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
|
||||
int CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
|
||||
int CMS_RecipientInfo_encrypt(const CMS_ContentInfo *cms, CMS_RecipientInfo *ri);
|
||||
|
||||
int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out,
|
||||
unsigned int flags);
|
||||
@@ -229,7 +391,7 @@ int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si,
|
||||
ASN1_OCTET_STRING **keyid,
|
||||
X509_NAME **issuer, ASN1_INTEGER **sno);
|
||||
int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert);
|
||||
int CMS_set1_signers_certs(CMS_ContentInfo *cms, STACK_OF(X509) *certs,
|
||||
int CMS_set1_signers_certs(CMS_ContentInfo *cms, const STACK_OF(X509) *certs,
|
||||
unsigned int flags);
|
||||
void CMS_SignerInfo_get0_algs(CMS_SignerInfo *si, EVP_PKEY **pk,
|
||||
X509 **signer, X509_ALGOR **pdig,
|
||||
@@ -238,6 +400,12 @@ ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si);
|
||||
int CMS_SignerInfo_sign(CMS_SignerInfo *si);
|
||||
int CMS_SignerInfo_verify(CMS_SignerInfo *si);
|
||||
int CMS_SignerInfo_verify_content(CMS_SignerInfo *si, BIO *chain);
|
||||
int CMS_SignerInfo_verify_ex(CMS_SignerInfo *si, BIO *chain, BIO *data);
|
||||
BIO *CMS_SignedData_verify(CMS_SignedData *sd, BIO *detached_data,
|
||||
const STACK_OF(X509) *scerts, X509_STORE *store,
|
||||
const STACK_OF(X509) *extra, const STACK_OF(X509_CRL) *crls,
|
||||
unsigned int flags,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
int CMS_add_smimecap(CMS_SignerInfo *si, STACK_OF(X509_ALGOR) *algs);
|
||||
int CMS_add_simple_smimecap(STACK_OF(X509_ALGOR) **algs,
|
||||
@@ -261,7 +429,8 @@ int CMS_signed_add1_attr_by_NID(CMS_SignerInfo *si,
|
||||
int CMS_signed_add1_attr_by_txt(CMS_SignerInfo *si,
|
||||
const char *attrname, int type,
|
||||
const void *bytes, int len);
|
||||
void *CMS_signed_get0_data_by_OBJ(CMS_SignerInfo *si, const ASN1_OBJECT *oid,
|
||||
const void *CMS_signed_get0_data_by_OBJ(const CMS_SignerInfo *si,
|
||||
const ASN1_OBJECT *oid,
|
||||
int lastpos, int type);
|
||||
|
||||
int CMS_unsigned_get_attr_count(const CMS_SignerInfo *si);
|
||||
@@ -281,15 +450,20 @@ int CMS_unsigned_add1_attr_by_NID(CMS_SignerInfo *si,
|
||||
int CMS_unsigned_add1_attr_by_txt(CMS_SignerInfo *si,
|
||||
const char *attrname, int type,
|
||||
const void *bytes, int len);
|
||||
void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
|
||||
const void *CMS_unsigned_get0_data_by_OBJ(CMS_SignerInfo *si, ASN1_OBJECT *oid,
|
||||
int lastpos, int type);
|
||||
|
||||
int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr);
|
||||
CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen,
|
||||
int allorfirst,
|
||||
STACK_OF(GENERAL_NAMES)
|
||||
*receiptList, STACK_OF(GENERAL_NAMES)
|
||||
*receiptsTo);
|
||||
CMS_ReceiptRequest *CMS_ReceiptRequest_create0(
|
||||
unsigned char *id, int idlen, int allorfirst,
|
||||
STACK_OF(GENERAL_NAMES) *receiptList,
|
||||
STACK_OF(GENERAL_NAMES) *receiptsTo);
|
||||
CMS_ReceiptRequest *CMS_ReceiptRequest_create0_ex(
|
||||
unsigned char *id, int idlen, int allorfirst,
|
||||
STACK_OF(GENERAL_NAMES) *receiptList,
|
||||
STACK_OF(GENERAL_NAMES) *receiptsTo,
|
||||
OSSL_LIB_CTX *libctx);
|
||||
|
||||
int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr);
|
||||
void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr,
|
||||
ASN1_STRING **pcid,
|
||||
@@ -319,6 +493,7 @@ int CMS_RecipientEncryptedKey_get0_id(CMS_RecipientEncryptedKey *rek,
|
||||
int CMS_RecipientEncryptedKey_cert_cmp(CMS_RecipientEncryptedKey *rek,
|
||||
X509 *cert);
|
||||
int CMS_RecipientInfo_kari_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
|
||||
int CMS_RecipientInfo_kari_set0_pkey_and_peer(CMS_RecipientInfo *ri, EVP_PKEY *pk, X509 *peer);
|
||||
EVP_CIPHER_CTX *CMS_RecipientInfo_kari_get0_ctx(CMS_RecipientInfo *ri);
|
||||
int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms,
|
||||
CMS_RecipientInfo *ri,
|
||||
@@ -327,6 +502,14 @@ int CMS_RecipientInfo_kari_decrypt(CMS_ContentInfo *cms,
|
||||
int CMS_SharedInfo_encode(unsigned char **pder, X509_ALGOR *kekalg,
|
||||
ASN1_OCTET_STRING *ukm, int keylen);
|
||||
|
||||
int CMS_RecipientInfo_kemri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert);
|
||||
int CMS_RecipientInfo_kemri_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pk);
|
||||
EVP_CIPHER_CTX *CMS_RecipientInfo_kemri_get0_ctx(CMS_RecipientInfo *ri);
|
||||
X509_ALGOR *CMS_RecipientInfo_kemri_get0_kdf_alg(CMS_RecipientInfo *ri);
|
||||
int CMS_RecipientInfo_kemri_set_ukm(CMS_RecipientInfo *ri,
|
||||
const unsigned char *ukm,
|
||||
int ukmLength);
|
||||
|
||||
/* Backward compatibility for spelling errors. */
|
||||
#define CMS_R_UNKNOWN_DIGEST_ALGORITM CMS_R_UNKNOWN_DIGEST_ALGORITHM
|
||||
#define CMS_R_UNSUPPORTED_RECPIENTINFO_TYPE \
|
||||
|
||||
@@ -1,116 +1,23 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CMSERR_H
|
||||
# define HEADER_CMSERR_H
|
||||
|
||||
# ifndef HEADER_SYMHACKS_H
|
||||
# include <openssl/symhacks.h>
|
||||
# endif
|
||||
#ifndef OPENSSL_CMSERR_H
|
||||
#define OPENSSL_CMSERR_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/symhacks.h>
|
||||
#include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
#ifndef OPENSSL_NO_CMS
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
int ERR_load_CMS_strings(void);
|
||||
|
||||
/*
|
||||
* CMS function codes.
|
||||
*/
|
||||
# define CMS_F_CHECK_CONTENT 99
|
||||
# define CMS_F_CMS_ADD0_CERT 164
|
||||
# define CMS_F_CMS_ADD0_RECIPIENT_KEY 100
|
||||
# define CMS_F_CMS_ADD0_RECIPIENT_PASSWORD 165
|
||||
# define CMS_F_CMS_ADD1_RECEIPTREQUEST 158
|
||||
# define CMS_F_CMS_ADD1_RECIPIENT_CERT 101
|
||||
# define CMS_F_CMS_ADD1_SIGNER 102
|
||||
# define CMS_F_CMS_ADD1_SIGNINGTIME 103
|
||||
# define CMS_F_CMS_COMPRESS 104
|
||||
# define CMS_F_CMS_COMPRESSEDDATA_CREATE 105
|
||||
# define CMS_F_CMS_COMPRESSEDDATA_INIT_BIO 106
|
||||
# define CMS_F_CMS_COPY_CONTENT 107
|
||||
# define CMS_F_CMS_COPY_MESSAGEDIGEST 108
|
||||
# define CMS_F_CMS_DATA 109
|
||||
# define CMS_F_CMS_DATAFINAL 110
|
||||
# define CMS_F_CMS_DATAINIT 111
|
||||
# define CMS_F_CMS_DECRYPT 112
|
||||
# define CMS_F_CMS_DECRYPT_SET1_KEY 113
|
||||
# define CMS_F_CMS_DECRYPT_SET1_PASSWORD 166
|
||||
# define CMS_F_CMS_DECRYPT_SET1_PKEY 114
|
||||
# define CMS_F_CMS_DIGESTALGORITHM_FIND_CTX 115
|
||||
# define CMS_F_CMS_DIGESTALGORITHM_INIT_BIO 116
|
||||
# define CMS_F_CMS_DIGESTEDDATA_DO_FINAL 117
|
||||
# define CMS_F_CMS_DIGEST_VERIFY 118
|
||||
# define CMS_F_CMS_ENCODE_RECEIPT 161
|
||||
# define CMS_F_CMS_ENCRYPT 119
|
||||
# define CMS_F_CMS_ENCRYPTEDCONTENT_INIT 179
|
||||
# define CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO 120
|
||||
# define CMS_F_CMS_ENCRYPTEDDATA_DECRYPT 121
|
||||
# define CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT 122
|
||||
# define CMS_F_CMS_ENCRYPTEDDATA_SET1_KEY 123
|
||||
# define CMS_F_CMS_ENVELOPEDDATA_CREATE 124
|
||||
# define CMS_F_CMS_ENVELOPEDDATA_INIT_BIO 125
|
||||
# define CMS_F_CMS_ENVELOPED_DATA_INIT 126
|
||||
# define CMS_F_CMS_ENV_ASN1_CTRL 171
|
||||
# define CMS_F_CMS_FINAL 127
|
||||
# define CMS_F_CMS_GET0_CERTIFICATE_CHOICES 128
|
||||
# define CMS_F_CMS_GET0_CONTENT 129
|
||||
# define CMS_F_CMS_GET0_ECONTENT_TYPE 130
|
||||
# define CMS_F_CMS_GET0_ENVELOPED 131
|
||||
# define CMS_F_CMS_GET0_REVOCATION_CHOICES 132
|
||||
# define CMS_F_CMS_GET0_SIGNED 133
|
||||
# define CMS_F_CMS_MSGSIGDIGEST_ADD1 162
|
||||
# define CMS_F_CMS_RECEIPTREQUEST_CREATE0 159
|
||||
# define CMS_F_CMS_RECEIPT_VERIFY 160
|
||||
# define CMS_F_CMS_RECIPIENTINFO_DECRYPT 134
|
||||
# define CMS_F_CMS_RECIPIENTINFO_ENCRYPT 169
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KARI_ENCRYPT 178
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ALG 175
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_ORIG_ID 173
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KARI_GET0_REKS 172
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KARI_ORIG_ID_CMP 174
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_DECRYPT 135
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ENCRYPT 136
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_GET0_ID 137
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KEKRI_ID_CMP 138
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KTRI_CERT_CMP 139
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KTRI_DECRYPT 140
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KTRI_ENCRYPT 141
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_ALGS 142
|
||||
# define CMS_F_CMS_RECIPIENTINFO_KTRI_GET0_SIGNER_ID 143
|
||||
# define CMS_F_CMS_RECIPIENTINFO_PWRI_CRYPT 167
|
||||
# define CMS_F_CMS_RECIPIENTINFO_SET0_KEY 144
|
||||
# define CMS_F_CMS_RECIPIENTINFO_SET0_PASSWORD 168
|
||||
# define CMS_F_CMS_RECIPIENTINFO_SET0_PKEY 145
|
||||
# define CMS_F_CMS_SD_ASN1_CTRL 170
|
||||
# define CMS_F_CMS_SET1_IAS 176
|
||||
# define CMS_F_CMS_SET1_KEYID 177
|
||||
# define CMS_F_CMS_SET1_SIGNERIDENTIFIER 146
|
||||
# define CMS_F_CMS_SET_DETACHED 147
|
||||
# define CMS_F_CMS_SIGN 148
|
||||
# define CMS_F_CMS_SIGNED_DATA_INIT 149
|
||||
# define CMS_F_CMS_SIGNERINFO_CONTENT_SIGN 150
|
||||
# define CMS_F_CMS_SIGNERINFO_SIGN 151
|
||||
# define CMS_F_CMS_SIGNERINFO_VERIFY 152
|
||||
# define CMS_F_CMS_SIGNERINFO_VERIFY_CERT 153
|
||||
# define CMS_F_CMS_SIGNERINFO_VERIFY_CONTENT 154
|
||||
# define CMS_F_CMS_SIGN_RECEIPT 163
|
||||
# define CMS_F_CMS_SI_CHECK_ATTRIBUTES 183
|
||||
# define CMS_F_CMS_STREAM 155
|
||||
# define CMS_F_CMS_UNCOMPRESS 156
|
||||
# define CMS_F_CMS_VERIFY 157
|
||||
# define CMS_F_KEK_UNWRAP_KEY 180
|
||||
|
||||
/*
|
||||
* CMS reason codes.
|
||||
*/
|
||||
@@ -119,6 +26,9 @@ int ERR_load_CMS_strings(void);
|
||||
#define CMS_R_CERTIFICATE_ALREADY_PRESENT 175
|
||||
#define CMS_R_CERTIFICATE_HAS_NO_KEYID 160
|
||||
#define CMS_R_CERTIFICATE_VERIFY_ERROR 100
|
||||
#define CMS_R_CIPHER_AEAD_IN_ENVELOPED_DATA 200
|
||||
#define CMS_R_CIPHER_AEAD_SET_TAG_ERROR 184
|
||||
#define CMS_R_CIPHER_GET_TAG 185
|
||||
#define CMS_R_CIPHER_INITIALISATION_ERROR 101
|
||||
#define CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR 102
|
||||
#define CMS_R_CMS_DATAFINAL_ERROR 103
|
||||
@@ -132,14 +42,20 @@ int ERR_load_CMS_strings(void);
|
||||
#define CMS_R_CONTENT_VERIFY_ERROR 109
|
||||
#define CMS_R_CTRL_ERROR 110
|
||||
#define CMS_R_CTRL_FAILURE 111
|
||||
#define CMS_R_DECODE_ERROR 187
|
||||
#define CMS_R_DECRYPT_ERROR 112
|
||||
#define CMS_R_ERROR_GETTING_PUBLIC_KEY 113
|
||||
#define CMS_R_ERROR_READING_MESSAGEDIGEST_ATTRIBUTE 114
|
||||
#define CMS_R_ERROR_SETTING_KEY 115
|
||||
#define CMS_R_ERROR_SETTING_RECIPIENTINFO 116
|
||||
#define CMS_R_ERROR_UNSUPPORTED_STATIC_KEY_AGREEMENT 196
|
||||
#define CMS_R_ESS_SIGNING_CERTID_MISMATCH_ERROR 183
|
||||
#define CMS_R_INVALID_ENCRYPTED_KEY_LENGTH 117
|
||||
#define CMS_R_INVALID_KEY_ENCRYPTION_PARAMETER 176
|
||||
#define CMS_R_INVALID_KEY_LENGTH 118
|
||||
#define CMS_R_INVALID_LABEL 190
|
||||
#define CMS_R_INVALID_OAEP_PARAMETERS 191
|
||||
#define CMS_R_KDF_PARAMETER_ERROR 186
|
||||
#define CMS_R_MD_BIO_INIT_ERROR 119
|
||||
#define CMS_R_MESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTH 120
|
||||
#define CMS_R_MESSAGEDIGEST_WRONG_LENGTH 121
|
||||
@@ -150,6 +66,7 @@ int ERR_load_CMS_strings(void);
|
||||
#define CMS_R_NOT_A_SIGNED_RECEIPT 165
|
||||
#define CMS_R_NOT_ENCRYPTED_DATA 122
|
||||
#define CMS_R_NOT_KEK 123
|
||||
#define CMS_R_NOT_KEM 197
|
||||
#define CMS_R_NOT_KEY_AGREEMENT 181
|
||||
#define CMS_R_NOT_KEY_TRANSPORT 124
|
||||
#define CMS_R_NOT_PWRI 177
|
||||
@@ -170,9 +87,12 @@ int ERR_load_CMS_strings(void);
|
||||
#define CMS_R_NO_PUBLIC_KEY 134
|
||||
#define CMS_R_NO_RECEIPT_REQUEST 168
|
||||
#define CMS_R_NO_SIGNERS 135
|
||||
#define CMS_R_OPERATION_UNSUPPORTED 182
|
||||
#define CMS_R_PEER_KEY_ERROR 188
|
||||
#define CMS_R_PRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATE 136
|
||||
#define CMS_R_RECEIPT_DECODE_ERROR 169
|
||||
#define CMS_R_RECIPIENT_ERROR 137
|
||||
#define CMS_R_SHARED_INFO_ERROR 189
|
||||
#define CMS_R_SIGNER_CERTIFICATE_NOT_FOUND 138
|
||||
#define CMS_R_SIGNFINAL_ERROR 139
|
||||
#define CMS_R_SMIME_TEXT_ERROR 140
|
||||
@@ -186,12 +106,18 @@ int ERR_load_CMS_strings(void);
|
||||
#define CMS_R_UNKNOWN_CIPHER 148
|
||||
#define CMS_R_UNKNOWN_DIGEST_ALGORITHM 149
|
||||
#define CMS_R_UNKNOWN_ID 150
|
||||
#define CMS_R_UNKNOWN_KDF_ALGORITHM 198
|
||||
#define CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM 151
|
||||
#define CMS_R_UNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHM 194
|
||||
#define CMS_R_UNSUPPORTED_CONTENT_TYPE 152
|
||||
#define CMS_R_UNSUPPORTED_ENCRYPTION_TYPE 192
|
||||
#define CMS_R_UNSUPPORTED_KDF_ALGORITHM 199
|
||||
#define CMS_R_UNSUPPORTED_KEK_ALGORITHM 153
|
||||
#define CMS_R_UNSUPPORTED_KEY_ENCRYPTION_ALGORITHM 179
|
||||
#define CMS_R_UNSUPPORTED_LABEL_SOURCE 193
|
||||
#define CMS_R_UNSUPPORTED_RECIPIENTINFO_TYPE 155
|
||||
#define CMS_R_UNSUPPORTED_RECIPIENT_TYPE 154
|
||||
#define CMS_R_UNSUPPORTED_SIGNATURE_ALGORITHM 195
|
||||
#define CMS_R_UNSUPPORTED_TYPE 156
|
||||
#define CMS_R_UNWRAP_ERROR 157
|
||||
#define CMS_R_UNWRAP_FAILURE 180
|
||||
|
||||
@@ -1,25 +1,34 @@
|
||||
/*
|
||||
* Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2015-2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_COMP_H
|
||||
/* clang-format off */
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#ifndef OPENSSL_COMP_H
|
||||
#define OPENSSL_COMP_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_COMP_H
|
||||
#endif
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
|
||||
# ifndef OPENSSL_NO_COMP
|
||||
#include <openssl/crypto.h>
|
||||
#include <openssl/comperr.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef OPENSSL_NO_COMP
|
||||
|
||||
COMP_CTX *COMP_CTX_new(COMP_METHOD *meth);
|
||||
const COMP_METHOD *COMP_CTX_get_method(const COMP_CTX *ctx);
|
||||
@@ -34,20 +43,59 @@ int COMP_expand_block(COMP_CTX *ctx, unsigned char *out, int olen,
|
||||
unsigned char *in, int ilen);
|
||||
|
||||
COMP_METHOD *COMP_zlib(void);
|
||||
COMP_METHOD *COMP_zlib_oneshot(void);
|
||||
COMP_METHOD *COMP_brotli(void);
|
||||
COMP_METHOD *COMP_brotli_oneshot(void);
|
||||
COMP_METHOD *COMP_zstd(void);
|
||||
COMP_METHOD *COMP_zstd_oneshot(void);
|
||||
|
||||
#if OPENSSL_API_COMPAT < 0x10100000L
|
||||
#define COMP_zlib_cleanup() while(0) continue
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
#define COMP_zlib_cleanup() \
|
||||
while (0) \
|
||||
continue
|
||||
#endif
|
||||
|
||||
# ifdef HEADER_BIO_H
|
||||
# ifdef ZLIB
|
||||
#ifdef OPENSSL_BIO_H
|
||||
const BIO_METHOD *BIO_f_zlib(void);
|
||||
# endif
|
||||
const BIO_METHOD *BIO_f_brotli(void);
|
||||
const BIO_METHOD *BIO_f_zstd(void);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
typedef struct ssl_comp_st SSL_COMP;
|
||||
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(SSL_COMP, SSL_COMP, SSL_COMP)
|
||||
#define sk_SSL_COMP_num(sk) OPENSSL_sk_num(ossl_check_const_SSL_COMP_sk_type(sk))
|
||||
#define sk_SSL_COMP_value(sk, idx) ((SSL_COMP *)OPENSSL_sk_value(ossl_check_const_SSL_COMP_sk_type(sk), (idx)))
|
||||
#define sk_SSL_COMP_new(cmp) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_SSL_COMP_compfunc_type(cmp)), sk_SSL_COMP_cmpfunc_thunk))
|
||||
#define sk_SSL_COMP_new_null() ((STACK_OF(SSL_COMP) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_SSL_COMP_freefunc_thunk))
|
||||
#define sk_SSL_COMP_new_reserve(cmp, n) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_SSL_COMP_compfunc_type(cmp), (n)), sk_SSL_COMP_cmpfunc_thunk))
|
||||
#define sk_SSL_COMP_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SSL_COMP_sk_type(sk), (n))
|
||||
#define sk_SSL_COMP_free(sk) OPENSSL_sk_free(ossl_check_SSL_COMP_sk_type(sk))
|
||||
#define sk_SSL_COMP_zero(sk) OPENSSL_sk_zero(ossl_check_SSL_COMP_sk_type(sk))
|
||||
#define sk_SSL_COMP_delete(sk, i) ((SSL_COMP *)OPENSSL_sk_delete(ossl_check_SSL_COMP_sk_type(sk), (i)))
|
||||
#define sk_SSL_COMP_delete_ptr(sk, ptr) ((SSL_COMP *)OPENSSL_sk_delete_ptr(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr)))
|
||||
#define sk_SSL_COMP_push(sk, ptr) OPENSSL_sk_push(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
|
||||
#define sk_SSL_COMP_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
|
||||
#define sk_SSL_COMP_pop(sk) ((SSL_COMP *)OPENSSL_sk_pop(ossl_check_SSL_COMP_sk_type(sk)))
|
||||
#define sk_SSL_COMP_shift(sk) ((SSL_COMP *)OPENSSL_sk_shift(ossl_check_SSL_COMP_sk_type(sk)))
|
||||
#define sk_SSL_COMP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_freefunc_type(freefunc))
|
||||
#define sk_SSL_COMP_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr), (idx))
|
||||
#define sk_SSL_COMP_set(sk, idx, ptr) ((SSL_COMP *)OPENSSL_sk_set(ossl_check_SSL_COMP_sk_type(sk), (idx), ossl_check_SSL_COMP_type(ptr)))
|
||||
#define sk_SSL_COMP_find(sk, ptr) OPENSSL_sk_find(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
|
||||
#define sk_SSL_COMP_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr))
|
||||
#define sk_SSL_COMP_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_type(ptr), pnum)
|
||||
#define sk_SSL_COMP_sort(sk) OPENSSL_sk_sort(ossl_check_SSL_COMP_sk_type(sk))
|
||||
#define sk_SSL_COMP_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SSL_COMP_sk_type(sk))
|
||||
#define sk_SSL_COMP_dup(sk) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_dup(ossl_check_const_SSL_COMP_sk_type(sk)))
|
||||
#define sk_SSL_COMP_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SSL_COMP) *)OPENSSL_sk_deep_copy(ossl_check_const_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_copyfunc_type(copyfunc), ossl_check_SSL_COMP_freefunc_type(freefunc)))
|
||||
#define sk_SSL_COMP_set_cmp_func(sk, cmp) ((sk_SSL_COMP_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SSL_COMP_sk_type(sk), ossl_check_SSL_COMP_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,44 +1,36 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_COMPERR_H
|
||||
# define HEADER_COMPERR_H
|
||||
|
||||
# ifndef HEADER_SYMHACKS_H
|
||||
# include <openssl/symhacks.h>
|
||||
# endif
|
||||
#ifndef OPENSSL_COMPERR_H
|
||||
#define OPENSSL_COMPERR_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/symhacks.h>
|
||||
#include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
#ifndef OPENSSL_NO_COMP
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
int ERR_load_COMP_strings(void);
|
||||
|
||||
/*
|
||||
* COMP function codes.
|
||||
*/
|
||||
# define COMP_F_BIO_ZLIB_FLUSH 99
|
||||
# define COMP_F_BIO_ZLIB_NEW 100
|
||||
# define COMP_F_BIO_ZLIB_READ 101
|
||||
# define COMP_F_BIO_ZLIB_WRITE 102
|
||||
# define COMP_F_COMP_CTX_NEW 103
|
||||
|
||||
/*
|
||||
* COMP reason codes.
|
||||
*/
|
||||
#define COMP_R_BROTLI_DECODE_ERROR 102
|
||||
#define COMP_R_BROTLI_ENCODE_ERROR 103
|
||||
#define COMP_R_BROTLI_NOT_SUPPORTED 104
|
||||
#define COMP_R_ZLIB_DEFLATE_ERROR 99
|
||||
#define COMP_R_ZLIB_INFLATE_ERROR 100
|
||||
#define COMP_R_ZLIB_NOT_SUPPORTED 101
|
||||
#define COMP_R_ZSTD_COMPRESS_ERROR 105
|
||||
#define COMP_R_ZSTD_DECODE_ERROR 106
|
||||
#define COMP_R_ZSTD_DECOMPRESS_ERROR 107
|
||||
#define COMP_R_ZSTD_NOT_SUPPORTED 108
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,21 +1,37 @@
|
||||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/conf.h.in
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CONF_H
|
||||
/* clang-format off */
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#ifndef OPENSSL_CONF_H
|
||||
#define OPENSSL_CONF_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_CONF_H
|
||||
#endif
|
||||
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/safestack.h>
|
||||
#include <openssl/e_os2.h>
|
||||
# include <openssl/ossl_typ.h>
|
||||
#include <openssl/types.h>
|
||||
#include <openssl/conferr.h>
|
||||
#ifndef OPENSSL_NO_STDIO
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -27,33 +43,65 @@ typedef struct {
|
||||
char *value;
|
||||
} CONF_VALUE;
|
||||
|
||||
DEFINE_STACK_OF(CONF_VALUE)
|
||||
DEFINE_LHASH_OF(CONF_VALUE);
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(CONF_VALUE, CONF_VALUE, CONF_VALUE)
|
||||
#define sk_CONF_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_CONF_VALUE_sk_type(sk))
|
||||
#define sk_CONF_VALUE_value(sk, idx) ((CONF_VALUE *)OPENSSL_sk_value(ossl_check_const_CONF_VALUE_sk_type(sk), (idx)))
|
||||
#define sk_CONF_VALUE_new(cmp) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_CONF_VALUE_compfunc_type(cmp)), sk_CONF_VALUE_cmpfunc_thunk))
|
||||
#define sk_CONF_VALUE_new_null() ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_CONF_VALUE_freefunc_thunk))
|
||||
#define sk_CONF_VALUE_new_reserve(cmp, n) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_CONF_VALUE_compfunc_type(cmp), (n)), sk_CONF_VALUE_cmpfunc_thunk))
|
||||
#define sk_CONF_VALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CONF_VALUE_sk_type(sk), (n))
|
||||
#define sk_CONF_VALUE_free(sk) OPENSSL_sk_free(ossl_check_CONF_VALUE_sk_type(sk))
|
||||
#define sk_CONF_VALUE_zero(sk) OPENSSL_sk_zero(ossl_check_CONF_VALUE_sk_type(sk))
|
||||
#define sk_CONF_VALUE_delete(sk, i) ((CONF_VALUE *)OPENSSL_sk_delete(ossl_check_CONF_VALUE_sk_type(sk), (i)))
|
||||
#define sk_CONF_VALUE_delete_ptr(sk, ptr) ((CONF_VALUE *)OPENSSL_sk_delete_ptr(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr)))
|
||||
#define sk_CONF_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
||||
#define sk_CONF_VALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
||||
#define sk_CONF_VALUE_pop(sk) ((CONF_VALUE *)OPENSSL_sk_pop(ossl_check_CONF_VALUE_sk_type(sk)))
|
||||
#define sk_CONF_VALUE_shift(sk) ((CONF_VALUE *)OPENSSL_sk_shift(ossl_check_CONF_VALUE_sk_type(sk)))
|
||||
#define sk_CONF_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_freefunc_type(freefunc))
|
||||
#define sk_CONF_VALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr), (idx))
|
||||
#define sk_CONF_VALUE_set(sk, idx, ptr) ((CONF_VALUE *)OPENSSL_sk_set(ossl_check_CONF_VALUE_sk_type(sk), (idx), ossl_check_CONF_VALUE_type(ptr)))
|
||||
#define sk_CONF_VALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
||||
#define sk_CONF_VALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr))
|
||||
#define sk_CONF_VALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_type(ptr), pnum)
|
||||
#define sk_CONF_VALUE_sort(sk) OPENSSL_sk_sort(ossl_check_CONF_VALUE_sk_type(sk))
|
||||
#define sk_CONF_VALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CONF_VALUE_sk_type(sk))
|
||||
#define sk_CONF_VALUE_dup(sk) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_dup(ossl_check_const_CONF_VALUE_sk_type(sk)))
|
||||
#define sk_CONF_VALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CONF_VALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_copyfunc_type(copyfunc), ossl_check_CONF_VALUE_freefunc_type(freefunc)))
|
||||
#define sk_CONF_VALUE_set_cmp_func(sk, cmp) ((sk_CONF_VALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CONF_VALUE_sk_type(sk), ossl_check_CONF_VALUE_compfunc_type(cmp)))
|
||||
DEFINE_LHASH_OF_INTERNAL(CONF_VALUE);
|
||||
#define lh_CONF_VALUE_new(hfn, cmp) ((LHASH_OF(CONF_VALUE) *)OPENSSL_LH_set_thunks(OPENSSL_LH_new(ossl_check_CONF_VALUE_lh_hashfunc_type(hfn), ossl_check_CONF_VALUE_lh_compfunc_type(cmp)), lh_CONF_VALUE_hash_thunk, lh_CONF_VALUE_comp_thunk, lh_CONF_VALUE_doall_thunk, lh_CONF_VALUE_doall_arg_thunk))
|
||||
#define lh_CONF_VALUE_free(lh) OPENSSL_LH_free(ossl_check_CONF_VALUE_lh_type(lh))
|
||||
#define lh_CONF_VALUE_flush(lh) OPENSSL_LH_flush(ossl_check_CONF_VALUE_lh_type(lh))
|
||||
#define lh_CONF_VALUE_insert(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_insert(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_plain_type(ptr)))
|
||||
#define lh_CONF_VALUE_delete(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_delete(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr)))
|
||||
#define lh_CONF_VALUE_retrieve(lh, ptr) ((CONF_VALUE *)OPENSSL_LH_retrieve(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_const_CONF_VALUE_lh_plain_type(ptr)))
|
||||
#define lh_CONF_VALUE_error(lh) OPENSSL_LH_error(ossl_check_CONF_VALUE_lh_type(lh))
|
||||
#define lh_CONF_VALUE_num_items(lh) OPENSSL_LH_num_items(ossl_check_CONF_VALUE_lh_type(lh))
|
||||
#define lh_CONF_VALUE_node_stats_bio(lh, out) OPENSSL_LH_node_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out)
|
||||
#define lh_CONF_VALUE_node_usage_stats_bio(lh, out) OPENSSL_LH_node_usage_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out)
|
||||
#define lh_CONF_VALUE_stats_bio(lh, out) OPENSSL_LH_stats_bio(ossl_check_const_CONF_VALUE_lh_type(lh), out)
|
||||
#define lh_CONF_VALUE_get_down_load(lh) OPENSSL_LH_get_down_load(ossl_check_CONF_VALUE_lh_type(lh))
|
||||
#define lh_CONF_VALUE_set_down_load(lh, dl) OPENSSL_LH_set_down_load(ossl_check_CONF_VALUE_lh_type(lh), dl)
|
||||
#define lh_CONF_VALUE_doall(lh, dfn) OPENSSL_LH_doall(ossl_check_CONF_VALUE_lh_type(lh), ossl_check_CONF_VALUE_lh_doallfunc_type(dfn))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
struct conf_st;
|
||||
struct conf_method_st;
|
||||
typedef struct conf_method_st CONF_METHOD;
|
||||
|
||||
struct conf_method_st {
|
||||
const char *name;
|
||||
CONF *(*create) (CONF_METHOD *meth);
|
||||
int (*init) (CONF *conf);
|
||||
int (*destroy) (CONF *conf);
|
||||
int (*destroy_data) (CONF *conf);
|
||||
int (*load_bio) (CONF *conf, BIO *bp, long *eline);
|
||||
int (*dump) (const CONF *conf, BIO *bp);
|
||||
int (*is_number) (const CONF *conf, char c);
|
||||
int (*to_int) (const CONF *conf, char c);
|
||||
int (*load) (CONF *conf, const char *name, long *eline);
|
||||
};
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#include <openssl/conftypes.h>
|
||||
#endif
|
||||
|
||||
/* Module definitions */
|
||||
|
||||
typedef struct conf_imodule_st CONF_IMODULE;
|
||||
typedef struct conf_module_st CONF_MODULE;
|
||||
|
||||
DEFINE_STACK_OF(CONF_MODULE)
|
||||
DEFINE_STACK_OF(CONF_IMODULE)
|
||||
STACK_OF(CONF_MODULE);
|
||||
STACK_OF(CONF_IMODULE);
|
||||
|
||||
/* DSO module function typedefs */
|
||||
typedef int conf_init_func(CONF_IMODULE *md, const CONF *cnf);
|
||||
@@ -87,10 +135,11 @@ void CONF_free(LHASH_OF(CONF_VALUE) *conf);
|
||||
int CONF_dump_fp(LHASH_OF(CONF_VALUE) *conf, FILE *out);
|
||||
#endif
|
||||
int CONF_dump_bio(LHASH_OF(CONF_VALUE) *conf, BIO *out);
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
OSSL_DEPRECATEDIN_1_1_0 void OPENSSL_config(const char *config_name);
|
||||
#endif
|
||||
|
||||
DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name))
|
||||
|
||||
#if OPENSSL_API_COMPAT < 0x10100000L
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
#define OPENSSL_no_config() \
|
||||
OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL)
|
||||
#endif
|
||||
@@ -100,15 +149,13 @@ DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name))
|
||||
* that wasn't the case, the above functions would have been replaced
|
||||
*/
|
||||
|
||||
struct conf_st {
|
||||
CONF_METHOD *meth;
|
||||
void *meth_data;
|
||||
LHASH_OF(CONF_VALUE) *data;
|
||||
};
|
||||
|
||||
CONF *NCONF_new_ex(OSSL_LIB_CTX *libctx, CONF_METHOD *meth);
|
||||
OSSL_LIB_CTX *NCONF_get0_libctx(const CONF *conf);
|
||||
CONF *NCONF_new(CONF_METHOD *meth);
|
||||
CONF_METHOD *NCONF_default(void);
|
||||
CONF_METHOD *NCONF_WIN32(void);
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 CONF_METHOD *NCONF_WIN32(void);
|
||||
#endif
|
||||
void NCONF_free(CONF *conf);
|
||||
void NCONF_free_data(CONF *conf);
|
||||
|
||||
@@ -117,6 +164,7 @@ int NCONF_load(CONF *conf, const char *file, long *eline);
|
||||
int NCONF_load_fp(CONF *conf, FILE *fp, long *eline);
|
||||
#endif
|
||||
int NCONF_load_bio(CONF *conf, BIO *bp, long *eline);
|
||||
STACK_OF(OPENSSL_CSTRING) *NCONF_get_section_names(const CONF *conf);
|
||||
STACK_OF(CONF_VALUE) *NCONF_get_section(const CONF *conf,
|
||||
const char *section);
|
||||
char *NCONF_get_string(const CONF *conf, const char *group, const char *name);
|
||||
@@ -133,12 +181,16 @@ int NCONF_dump_bio(const CONF *conf, BIO *out);
|
||||
|
||||
int CONF_modules_load(const CONF *cnf, const char *appname,
|
||||
unsigned long flags);
|
||||
int CONF_modules_load_file_ex(OSSL_LIB_CTX *libctx, const char *filename,
|
||||
const char *appname, unsigned long flags);
|
||||
int CONF_modules_load_file(const char *filename, const char *appname,
|
||||
unsigned long flags);
|
||||
void CONF_modules_unload(int all);
|
||||
void CONF_modules_finish(void);
|
||||
#if OPENSSL_API_COMPAT < 0x10100000L
|
||||
# define CONF_modules_free() while(0) continue
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
#define CONF_modules_free() \
|
||||
while (0) \
|
||||
continue
|
||||
#endif
|
||||
int CONF_module_add(const char *name, conf_init_func *ifunc,
|
||||
conf_finish_func *ffunc);
|
||||
@@ -161,7 +213,6 @@ int CONF_parse_list(const char *list, int sep, int nospc,
|
||||
|
||||
void OPENSSL_load_builtin_modules(void);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
/*
|
||||
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CONF_API_H
|
||||
#ifndef OPENSSL_CONF_API_H
|
||||
#define OPENSSL_CONF_API_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_CONF_API_H
|
||||
#endif
|
||||
|
||||
#include <openssl/lhash.h>
|
||||
#include <openssl/conf.h>
|
||||
|
||||
@@ -1,57 +1,28 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CONFERR_H
|
||||
# define HEADER_CONFERR_H
|
||||
#ifndef OPENSSL_CONFERR_H
|
||||
#define OPENSSL_CONFERR_H
|
||||
#pragma once
|
||||
|
||||
# ifndef HEADER_SYMHACKS_H
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/symhacks.h>
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
int ERR_load_CONF_strings(void);
|
||||
|
||||
/*
|
||||
* CONF function codes.
|
||||
*/
|
||||
# define CONF_F_CONF_DUMP_FP 104
|
||||
# define CONF_F_CONF_LOAD 100
|
||||
# define CONF_F_CONF_LOAD_FP 103
|
||||
# define CONF_F_CONF_PARSE_LIST 119
|
||||
# define CONF_F_DEF_LOAD 120
|
||||
# define CONF_F_DEF_LOAD_BIO 121
|
||||
# define CONF_F_GET_NEXT_FILE 107
|
||||
# define CONF_F_MODULE_ADD 122
|
||||
# define CONF_F_MODULE_INIT 115
|
||||
# define CONF_F_MODULE_LOAD_DSO 117
|
||||
# define CONF_F_MODULE_RUN 118
|
||||
# define CONF_F_NCONF_DUMP_BIO 105
|
||||
# define CONF_F_NCONF_DUMP_FP 106
|
||||
# define CONF_F_NCONF_GET_NUMBER_E 112
|
||||
# define CONF_F_NCONF_GET_SECTION 108
|
||||
# define CONF_F_NCONF_GET_STRING 109
|
||||
# define CONF_F_NCONF_LOAD 113
|
||||
# define CONF_F_NCONF_LOAD_BIO 110
|
||||
# define CONF_F_NCONF_LOAD_FP 114
|
||||
# define CONF_F_NCONF_NEW 111
|
||||
# define CONF_F_PROCESS_INCLUDE 116
|
||||
# define CONF_F_SSL_MODULE_INIT 123
|
||||
# define CONF_F_STR_COPY 101
|
||||
#include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
/*
|
||||
* CONF reason codes.
|
||||
*/
|
||||
#define CONF_R_ERROR_LOADING_DSO 110
|
||||
#define CONF_R_INVALID_PRAGMA 122
|
||||
#define CONF_R_LIST_CANNOT_BE_NULL 115
|
||||
#define CONF_R_MANDATORY_BRACES_IN_VARIABLE_EXPANSION 123
|
||||
#define CONF_R_MISSING_CLOSE_SQUARE_BRACKET 100
|
||||
#define CONF_R_MISSING_EQUAL_SIGN 101
|
||||
#define CONF_R_MISSING_INIT_FUNCTION 112
|
||||
@@ -63,7 +34,10 @@ int ERR_load_CONF_strings(void);
|
||||
#define CONF_R_NO_SUCH_FILE 114
|
||||
#define CONF_R_NO_VALUE 108
|
||||
#define CONF_R_NUMBER_TOO_LARGE 121
|
||||
#define CONF_R_OPENSSL_CONF_REFERENCES_MISSING_SECTION 124
|
||||
#define CONF_R_RECURSIVE_DIRECTORY_INCLUDE 111
|
||||
#define CONF_R_RECURSIVE_SECTION_REFERENCE 126
|
||||
#define CONF_R_RELATIVE_PATH 125
|
||||
#define CONF_R_SSL_COMMAND_SECTION_EMPTY 117
|
||||
#define CONF_R_SSL_COMMAND_SECTION_NOT_FOUND 118
|
||||
#define CONF_R_SSL_SECTION_EMPTY 119
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/configuration.h.in
|
||||
* Generated by configdata.pm from Configurations/common0.tmpl, Configurations/unix-Makefile.tmpl
|
||||
* via Makefile.in
|
||||
*
|
||||
* Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
@@ -26,7 +27,8 @@ extern "C" {
|
||||
* OpenSSL was configured with the following options:
|
||||
*/
|
||||
|
||||
# define OPENSSL_CONFIGURED_API 30000
|
||||
/* clang-format off */
|
||||
# define OPENSSL_CONFIGURED_API 40000
|
||||
# ifndef OPENSSL_RAND_SEED_OS
|
||||
# define OPENSSL_RAND_SEED_OS
|
||||
# endif
|
||||
@@ -36,26 +38,35 @@ extern "C" {
|
||||
# ifndef OPENSSL_NO_ACVP_TESTS
|
||||
# define OPENSSL_NO_ACVP_TESTS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_AFALGENG
|
||||
# define OPENSSL_NO_AFALGENG
|
||||
# ifndef OPENSSL_NO_ALLOCFAIL_TESTS
|
||||
# define OPENSSL_NO_ALLOCFAIL_TESTS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_APPS
|
||||
# define OPENSSL_NO_APPS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_ASAN
|
||||
# define OPENSSL_NO_ASAN
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CAPIENG
|
||||
# define OPENSSL_NO_CAPIENG
|
||||
# ifndef OPENSSL_NO_BROTLI
|
||||
# define OPENSSL_NO_BROTLI
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_BROTLI_DYNAMIC
|
||||
# define OPENSSL_NO_BROTLI_DYNAMIC
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CRYPTO_MDEBUG
|
||||
# define OPENSSL_NO_CRYPTO_MDEBUG
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
|
||||
# define OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
|
||||
# ifndef OPENSSL_NO_DEMOS
|
||||
# define OPENSSL_NO_DEMOS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEPRECATED
|
||||
# define OPENSSL_NO_DEPRECATED
|
||||
# ifndef OPENSSL_NO_DSO
|
||||
# define OPENSSL_NO_DSO
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DEVCRYPTOENG
|
||||
# define OPENSSL_NO_DEVCRYPTOENG
|
||||
# ifndef OPENSSL_NO_DYNAMIC_ENGINE
|
||||
# define OPENSSL_NO_DYNAMIC_ENGINE
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_EC_EXPLICIT_CURVES
|
||||
# define OPENSSL_NO_EC_EXPLICIT_CURVES
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
|
||||
# define OPENSSL_NO_EC_NISTP_64_GCC_128
|
||||
@@ -69,6 +80,12 @@ extern "C" {
|
||||
# ifndef OPENSSL_NO_EXTERNAL_TESTS
|
||||
# define OPENSSL_NO_EXTERNAL_TESTS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_FIPS_JITTER
|
||||
# define OPENSSL_NO_FIPS_JITTER
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_FIPS_POST
|
||||
# define OPENSSL_NO_FIPS_POST
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_FIPS_SECURITYCHECKS
|
||||
# define OPENSSL_NO_FIPS_SECURITYCHECKS
|
||||
# endif
|
||||
@@ -78,11 +95,20 @@ extern "C" {
|
||||
# ifndef OPENSSL_NO_FUZZ_LIBFUZZER
|
||||
# define OPENSSL_NO_FUZZ_LIBFUZZER
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_H3DEMO
|
||||
# define OPENSSL_NO_H3DEMO
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_HQINTEROP
|
||||
# define OPENSSL_NO_HQINTEROP
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_JITTER
|
||||
# define OPENSSL_NO_JITTER
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_KTLS
|
||||
# define OPENSSL_NO_KTLS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_LOADERENG
|
||||
# define OPENSSL_NO_LOADERENG
|
||||
# ifndef OPENSSL_NO_LMS
|
||||
# define OPENSSL_NO_LMS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_MD2
|
||||
# define OPENSSL_NO_MD2
|
||||
@@ -90,8 +116,8 @@ extern "C" {
|
||||
# ifndef OPENSSL_NO_MSAN
|
||||
# define OPENSSL_NO_MSAN
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_PADLOCKENG
|
||||
# define OPENSSL_NO_PADLOCKENG
|
||||
# ifndef OPENSSL_NO_PIE
|
||||
# define OPENSSL_NO_PIE
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_RC5
|
||||
# define OPENSSL_NO_RC5
|
||||
@@ -99,18 +125,24 @@ extern "C" {
|
||||
# ifndef OPENSSL_NO_SCTP
|
||||
# define OPENSSL_NO_SCTP
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SRP
|
||||
# define OPENSSL_NO_SRP
|
||||
# ifndef OPENSSL_NO_SSLKEYLOG
|
||||
# define OPENSSL_NO_SSLKEYLOG
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SSL3
|
||||
# define OPENSSL_NO_SSL3
|
||||
# ifndef OPENSSL_NO_STATIC_ENGINE
|
||||
# define OPENSSL_NO_STATIC_ENGINE
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_SSL3_METHOD
|
||||
# define OPENSSL_NO_SSL3_METHOD
|
||||
# ifndef OPENSSL_NO_STATIC_VCRUNTIME
|
||||
# define OPENSSL_NO_STATIC_VCRUNTIME
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_TESTS
|
||||
# define OPENSSL_NO_TESTS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_TFO
|
||||
# define OPENSSL_NO_TFO
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_TLS_DEPRECATED_EC
|
||||
# define OPENSSL_NO_TLS_DEPRECATED_EC
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_TRACE
|
||||
# define OPENSSL_NO_TRACE
|
||||
# endif
|
||||
@@ -126,26 +158,63 @@ extern "C" {
|
||||
# ifndef OPENSSL_NO_WEAK_SSL_CIPHERS
|
||||
# define OPENSSL_NO_WEAK_SSL_CIPHERS
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_DYNAMIC_ENGINE
|
||||
# define OPENSSL_NO_DYNAMIC_ENGINE
|
||||
# ifndef OPENSSL_NO_WINSTORE
|
||||
# define OPENSSL_NO_WINSTORE
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_ZLIB
|
||||
# define OPENSSL_NO_ZLIB
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_ZLIB_DYNAMIC
|
||||
# define OPENSSL_NO_ZLIB_DYNAMIC
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_ZSTD
|
||||
# define OPENSSL_NO_ZSTD
|
||||
# endif
|
||||
# ifndef OPENSSL_NO_ZSTD_DYNAMIC
|
||||
# define OPENSSL_NO_ZSTD_DYNAMIC
|
||||
# endif
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
/* Generate 80386 code? */
|
||||
/* clang-format off */
|
||||
# undef I386_ONLY
|
||||
/* clang-format on */
|
||||
|
||||
/*
|
||||
* The UEFI build supports both 32-bit and 64-bit builds from a single run
|
||||
* of the Configure script. To allow this, they define THIRTY_TWO_BIT and
|
||||
* SIXTY_FOUR_BIT appropriately for their builds, and we should not touch
|
||||
* them in that case.
|
||||
*/
|
||||
#if !defined(OPENSSL_SYS_UEFI)
|
||||
/* clang-format off */
|
||||
# undef BN_LLONG
|
||||
/* clang-format on */
|
||||
/* Only one for the following should be defined */
|
||||
/* clang-format off */
|
||||
# define SIXTY_FOUR_BIT_LONG
|
||||
/* clang-format on */
|
||||
/* clang-format off */
|
||||
# undef SIXTY_FOUR_BIT
|
||||
/* clang-format on */
|
||||
/* clang-format off */
|
||||
# undef THIRTY_TWO_BIT
|
||||
/* clang-format on */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The following are cipher-specific, but are part of the public API.
|
||||
*/
|
||||
# if !defined(OPENSSL_SYS_UEFI)
|
||||
# undef BN_LLONG
|
||||
/* Only one for the following should be defined */
|
||||
# define SIXTY_FOUR_BIT_LONG
|
||||
# undef SIXTY_FOUR_BIT
|
||||
# undef THIRTY_TWO_BIT
|
||||
# endif
|
||||
|
||||
/* clang-format off */
|
||||
# define RC4_INT unsigned int
|
||||
/* clang-format on */
|
||||
|
||||
#if defined(OPENSSL_NO_COMP) || (defined(OPENSSL_NO_BROTLI) && defined(OPENSSL_NO_ZSTD) && defined(OPENSSL_NO_ZLIB))
|
||||
#define OPENSSL_NO_COMP_ALG
|
||||
#else
|
||||
#undef OPENSSL_NO_COMP_ALG
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef OPENSSL_CONFTYPES_H
|
||||
#define OPENSSL_CONFTYPES_H
|
||||
#pragma once
|
||||
|
||||
#ifndef OPENSSL_CONF_H
|
||||
#include <openssl/conf.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The contents of this file are deprecated and will be made opaque
|
||||
*/
|
||||
struct conf_method_st {
|
||||
const char *name;
|
||||
CONF *(*create)(CONF_METHOD *meth);
|
||||
int (*init)(CONF *conf);
|
||||
int (*destroy)(CONF *conf);
|
||||
int (*destroy_data)(CONF *conf);
|
||||
int (*load_bio)(CONF *conf, BIO *bp, long *eline);
|
||||
int (*dump)(const CONF *conf, BIO *bp);
|
||||
int (*is_number)(const CONF *conf, char c);
|
||||
int (*to_int)(const CONF *conf, char c);
|
||||
int (*load)(CONF *conf, const char *name, long *eline);
|
||||
};
|
||||
|
||||
struct conf_st {
|
||||
CONF_METHOD *meth;
|
||||
void *meth_data;
|
||||
LHASH_OF(CONF_VALUE) *data;
|
||||
int flag_dollarid;
|
||||
int flag_abspath;
|
||||
char *includedir;
|
||||
OSSL_LIB_CTX *libctx;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,235 @@
|
||||
/*
|
||||
* Copyright 2019-2023 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef OPENSSL_CORE_H
|
||||
#define OPENSSL_CORE_H
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
#include <openssl/types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*-
|
||||
* Base types
|
||||
* ----------
|
||||
*
|
||||
* These are the types that the OpenSSL core and providers have in common
|
||||
* to communicate data between them.
|
||||
*/
|
||||
|
||||
/* Opaque handles to be used with core upcall functions from providers */
|
||||
typedef struct ossl_core_handle_st OSSL_CORE_HANDLE;
|
||||
typedef struct openssl_core_ctx_st OPENSSL_CORE_CTX;
|
||||
typedef struct ossl_core_bio_st OSSL_CORE_BIO;
|
||||
|
||||
/*
|
||||
* Dispatch table element. function_id numbers and the functions are defined
|
||||
* in core_dispatch.h, see macros with 'OSSL_CORE_MAKE_FUNC' in their names.
|
||||
*
|
||||
* An array of these is always terminated by function_id == 0
|
||||
*/
|
||||
struct ossl_dispatch_st {
|
||||
int function_id;
|
||||
void (*function)(void);
|
||||
};
|
||||
|
||||
#define OSSL_DISPATCH_END \
|
||||
{ 0, NULL }
|
||||
|
||||
/*
|
||||
* Other items, essentially an int<->pointer map element.
|
||||
*
|
||||
* We make this type distinct from OSSL_DISPATCH to ensure that dispatch
|
||||
* tables remain tables with function pointers only.
|
||||
*
|
||||
* This is used whenever we need to pass things like a table of error reason
|
||||
* codes <-> reason string maps, ...
|
||||
*
|
||||
* Usage determines which field works as key if any, rather than field order.
|
||||
*
|
||||
* An array of these is always terminated by id == 0 && ptr == NULL
|
||||
*/
|
||||
struct ossl_item_st {
|
||||
unsigned int id;
|
||||
void *ptr;
|
||||
};
|
||||
|
||||
/*
|
||||
* Type to tie together algorithm names, property definition string and
|
||||
* the algorithm implementation in the form of a dispatch table.
|
||||
*
|
||||
* An array of these is always terminated by algorithm_names == NULL
|
||||
*/
|
||||
struct ossl_algorithm_st {
|
||||
const char *algorithm_names; /* key */
|
||||
const char *property_definition; /* key */
|
||||
const OSSL_DISPATCH *implementation;
|
||||
const char *algorithm_description;
|
||||
};
|
||||
|
||||
/*
|
||||
* Type to pass object data in a uniform way, without exposing the object
|
||||
* structure.
|
||||
*
|
||||
* An array of these is always terminated by key == NULL
|
||||
*/
|
||||
struct ossl_param_st {
|
||||
const char *key; /* the name of the parameter */
|
||||
unsigned int data_type; /* declare what kind of content is in buffer */
|
||||
void *data; /* value being passed in or out */
|
||||
size_t data_size; /* data size */
|
||||
size_t return_size; /* returned content size */
|
||||
};
|
||||
|
||||
/* Currently supported OSSL_PARAM data types */
|
||||
/*
|
||||
* OSSL_PARAM_INTEGER and OSSL_PARAM_UNSIGNED_INTEGER
|
||||
* are arbitrary length and therefore require an arbitrarily sized buffer,
|
||||
* since they may be used to pass numbers larger than what is natively
|
||||
* available.
|
||||
*
|
||||
* The number must be buffered in native form, i.e. MSB first on B_ENDIAN
|
||||
* systems and LSB first on L_ENDIAN systems. This means that arbitrary
|
||||
* native integers can be stored in the buffer, just make sure that the
|
||||
* buffer size is correct and the buffer itself is properly aligned (for
|
||||
* example by having the buffer field point at a C integer).
|
||||
*/
|
||||
#define OSSL_PARAM_INTEGER 1
|
||||
#define OSSL_PARAM_UNSIGNED_INTEGER 2
|
||||
/*-
|
||||
* OSSL_PARAM_REAL
|
||||
* is a C binary floating point values in native form and alignment.
|
||||
*/
|
||||
#define OSSL_PARAM_REAL 3
|
||||
/*-
|
||||
* OSSL_PARAM_UTF8_STRING
|
||||
* is a printable string. It is expected to be printed as it is.
|
||||
*/
|
||||
#define OSSL_PARAM_UTF8_STRING 4
|
||||
/*-
|
||||
* OSSL_PARAM_OCTET_STRING
|
||||
* is a string of bytes with no further specification. It is expected to be
|
||||
* printed as a hexdump.
|
||||
*/
|
||||
#define OSSL_PARAM_OCTET_STRING 5
|
||||
/*-
|
||||
* OSSL_PARAM_UTF8_PTR
|
||||
* is a pointer to a printable string. It is expected to be printed as it is.
|
||||
*
|
||||
* The difference between this and OSSL_PARAM_UTF8_STRING is that only pointers
|
||||
* are manipulated for this type.
|
||||
*
|
||||
* This is more relevant for parameter requests, where the responding
|
||||
* function doesn't need to copy the data to the provided buffer, but
|
||||
* sets the provided buffer to point at the actual data instead.
|
||||
*
|
||||
* WARNING! Using these is FRAGILE, as it assumes that the actual
|
||||
* data and its location are constant.
|
||||
*
|
||||
* EXTRA WARNING! If you are not completely sure you most likely want
|
||||
* to use the OSSL_PARAM_UTF8_STRING type.
|
||||
*/
|
||||
#define OSSL_PARAM_UTF8_PTR 6
|
||||
/*-
|
||||
* OSSL_PARAM_OCTET_PTR
|
||||
* is a pointer to a string of bytes with no further specification. It is
|
||||
* expected to be printed as a hexdump.
|
||||
*
|
||||
* The difference between this and OSSL_PARAM_OCTET_STRING is that only pointers
|
||||
* are manipulated for this type.
|
||||
*
|
||||
* This is more relevant for parameter requests, where the responding
|
||||
* function doesn't need to copy the data to the provided buffer, but
|
||||
* sets the provided buffer to point at the actual data instead.
|
||||
*
|
||||
* WARNING! Using these is FRAGILE, as it assumes that the actual
|
||||
* data and its location are constant.
|
||||
*
|
||||
* EXTRA WARNING! If you are not completely sure you most likely want
|
||||
* to use the OSSL_PARAM_OCTET_STRING type.
|
||||
*/
|
||||
#define OSSL_PARAM_OCTET_PTR 7
|
||||
|
||||
/*
|
||||
* Typedef for the thread stop handling callback. Used both internally and by
|
||||
* providers.
|
||||
*
|
||||
* Providers may register for notifications about threads stopping by
|
||||
* registering a callback to hear about such events. Providers register the
|
||||
* callback using the OSSL_FUNC_CORE_THREAD_START function in the |in| dispatch
|
||||
* table passed to OSSL_provider_init(). The arg passed back to a provider will
|
||||
* be the provider side context object.
|
||||
*/
|
||||
typedef void (*OSSL_thread_stop_handler_fn)(void *arg);
|
||||
|
||||
/*-
|
||||
* Provider entry point
|
||||
* --------------------
|
||||
*
|
||||
* This function is expected to be present in any dynamically loadable
|
||||
* provider module. By definition, if this function doesn't exist in a
|
||||
* module, that module is not an OpenSSL provider module.
|
||||
*/
|
||||
/*-
|
||||
* |handle| pointer to opaque type OSSL_CORE_HANDLE. This can be used
|
||||
* together with some functions passed via |in| to query data.
|
||||
* |in| is the array of functions that the Core passes to the provider.
|
||||
* |out| will be the array of base functions that the provider passes
|
||||
* back to the Core.
|
||||
* |provctx| a provider side context object, optionally created if the
|
||||
* provider needs it. This value is passed to other provider
|
||||
* functions, notably other context constructors.
|
||||
*/
|
||||
typedef int(OSSL_provider_init_fn)(const OSSL_CORE_HANDLE *handle,
|
||||
const OSSL_DISPATCH *in,
|
||||
const OSSL_DISPATCH **out,
|
||||
void **provctx);
|
||||
#ifdef __VMS
|
||||
#pragma names save
|
||||
#pragma names uppercase, truncated
|
||||
#endif
|
||||
OPENSSL_EXPORT OSSL_provider_init_fn OSSL_provider_init;
|
||||
#ifdef __VMS
|
||||
#pragma names restore
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Generic callback function signature.
|
||||
*
|
||||
* The expectation is that any provider function that wants to offer
|
||||
* a callback / hook can do so by taking an argument with this type,
|
||||
* as well as a pointer to caller-specific data. When calling the
|
||||
* callback, the provider function can populate an OSSL_PARAM array
|
||||
* with data of its choice and pass that in the callback call, along
|
||||
* with the caller data argument.
|
||||
*
|
||||
* libcrypto may use the OSSL_PARAM array to create arguments for an
|
||||
* application callback it knows about.
|
||||
*/
|
||||
typedef int(OSSL_CALLBACK)(const OSSL_PARAM params[], void *arg);
|
||||
typedef int(OSSL_INOUT_CALLBACK)(const OSSL_PARAM in_params[],
|
||||
OSSL_PARAM out_params[], void *arg);
|
||||
/*
|
||||
* Passphrase callback function signature
|
||||
*
|
||||
* This is similar to the generic callback function above, but adds a
|
||||
* result parameter.
|
||||
*/
|
||||
typedef int(OSSL_PASSPHRASE_CALLBACK)(char *pass, size_t pass_size,
|
||||
size_t *pass_len,
|
||||
const OSSL_PARAM params[], void *arg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,600 @@
|
||||
/*
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/core_names.h.in
|
||||
*
|
||||
* Copyright 2019-2026 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
/* clang-format off */
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#ifndef OPENSSL_CORE_NAMES_H
|
||||
#define OPENSSL_CORE_NAMES_H
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* OSSL_CIPHER_PARAM_CTS_MODE Values */
|
||||
#define OSSL_CIPHER_CTS_MODE_CS1 "CS1"
|
||||
#define OSSL_CIPHER_CTS_MODE_CS2 "CS2"
|
||||
#define OSSL_CIPHER_CTS_MODE_CS3 "CS3"
|
||||
|
||||
/* Known CIPHER names (not a complete list) */
|
||||
#define OSSL_CIPHER_NAME_AES_128_GCM_SIV "AES-128-GCM-SIV"
|
||||
#define OSSL_CIPHER_NAME_AES_192_GCM_SIV "AES-192-GCM-SIV"
|
||||
#define OSSL_CIPHER_NAME_AES_256_GCM_SIV "AES-256-GCM-SIV"
|
||||
|
||||
/* Known DIGEST names (not a complete list) */
|
||||
#define OSSL_DIGEST_NAME_MD5 "MD5"
|
||||
#define OSSL_DIGEST_NAME_MD5_SHA1 "MD5-SHA1"
|
||||
#define OSSL_DIGEST_NAME_SHA1 "SHA1"
|
||||
#define OSSL_DIGEST_NAME_SHA2_224 "SHA2-224"
|
||||
#define OSSL_DIGEST_NAME_SHA2_256 "SHA2-256"
|
||||
#define OSSL_DIGEST_NAME_SHA2_256_192 "SHA2-256/192"
|
||||
#define OSSL_DIGEST_NAME_SHA2_384 "SHA2-384"
|
||||
#define OSSL_DIGEST_NAME_SHA2_512 "SHA2-512"
|
||||
#define OSSL_DIGEST_NAME_SHA2_512_224 "SHA2-512/224"
|
||||
#define OSSL_DIGEST_NAME_SHA2_512_256 "SHA2-512/256"
|
||||
#define OSSL_DIGEST_NAME_MD2 "MD2"
|
||||
#define OSSL_DIGEST_NAME_MD4 "MD4"
|
||||
#define OSSL_DIGEST_NAME_MDC2 "MDC2"
|
||||
#define OSSL_DIGEST_NAME_RIPEMD160 "RIPEMD160"
|
||||
#define OSSL_DIGEST_NAME_SHA3_224 "SHA3-224"
|
||||
#define OSSL_DIGEST_NAME_SHA3_256 "SHA3-256"
|
||||
#define OSSL_DIGEST_NAME_SHA3_384 "SHA3-384"
|
||||
#define OSSL_DIGEST_NAME_SHA3_512 "SHA3-512"
|
||||
#define OSSL_DIGEST_NAME_KECCAK_KMAC128 "KECCAK-KMAC-128"
|
||||
#define OSSL_DIGEST_NAME_KECCAK_KMAC256 "KECCAK-KMAC-256"
|
||||
#define OSSL_DIGEST_NAME_SM3 "SM3"
|
||||
|
||||
/* Known MAC names */
|
||||
#define OSSL_MAC_NAME_BLAKE2BMAC "BLAKE2BMAC"
|
||||
#define OSSL_MAC_NAME_BLAKE2SMAC "BLAKE2SMAC"
|
||||
#define OSSL_MAC_NAME_CMAC "CMAC"
|
||||
#define OSSL_MAC_NAME_GMAC "GMAC"
|
||||
#define OSSL_MAC_NAME_HMAC "HMAC"
|
||||
#define OSSL_MAC_NAME_KMAC128 "KMAC128"
|
||||
#define OSSL_MAC_NAME_KMAC256 "KMAC256"
|
||||
#define OSSL_MAC_NAME_POLY1305 "POLY1305"
|
||||
#define OSSL_MAC_NAME_SIPHASH "SIPHASH"
|
||||
|
||||
/* Known KDF names */
|
||||
#define OSSL_KDF_NAME_HKDF "HKDF"
|
||||
#define OSSL_KDF_NAME_HKDF_SHA256 "HKDF-SHA256"
|
||||
#define OSSL_KDF_NAME_HKDF_SHA384 "HKDF-SHA384"
|
||||
#define OSSL_KDF_NAME_HKDF_SHA512 "HKDF-SHA512"
|
||||
#define OSSL_KDF_NAME_TLS1_3_KDF "TLS13-KDF"
|
||||
#define OSSL_KDF_NAME_PBKDF1 "PBKDF1"
|
||||
#define OSSL_KDF_NAME_PBKDF2 "PBKDF2"
|
||||
#define OSSL_KDF_NAME_SCRYPT "SCRYPT"
|
||||
#define OSSL_KDF_NAME_SNMPKDF "SNMPKDF"
|
||||
#define OSSL_KDF_NAME_SRTPKDF "SRTPKDF"
|
||||
#define OSSL_KDF_NAME_SSHKDF "SSHKDF"
|
||||
#define OSSL_KDF_NAME_SSKDF "SSKDF"
|
||||
#define OSSL_KDF_NAME_TLS1_PRF "TLS1-PRF"
|
||||
#define OSSL_KDF_NAME_X942KDF_ASN1 "X942KDF-ASN1"
|
||||
#define OSSL_KDF_NAME_X942KDF_CONCAT "X942KDF-CONCAT"
|
||||
#define OSSL_KDF_NAME_X963KDF "X963KDF"
|
||||
#define OSSL_KDF_NAME_KBKDF "KBKDF"
|
||||
#define OSSL_KDF_NAME_KRB5KDF "KRB5KDF"
|
||||
#define OSSL_KDF_NAME_HMACDRBGKDF "HMAC-DRBG-KDF"
|
||||
|
||||
/* RSA padding modes */
|
||||
#define OSSL_PKEY_RSA_PAD_MODE_NONE "none"
|
||||
#define OSSL_PKEY_RSA_PAD_MODE_PKCSV15 "pkcs1"
|
||||
#define OSSL_PKEY_RSA_PAD_MODE_OAEP "oaep"
|
||||
#define OSSL_PKEY_RSA_PAD_MODE_X931 "x931"
|
||||
#define OSSL_PKEY_RSA_PAD_MODE_PSS "pss"
|
||||
|
||||
/* RSA pss padding salt length */
|
||||
#define OSSL_PKEY_RSA_PSS_SALT_LEN_DIGEST "digest"
|
||||
#define OSSL_PKEY_RSA_PSS_SALT_LEN_MAX "max"
|
||||
#define OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO "auto"
|
||||
#define OSSL_PKEY_RSA_PSS_SALT_LEN_AUTO_DIGEST_MAX "auto-digestmax"
|
||||
|
||||
/* OSSL_PKEY_PARAM_EC_ENCODING values */
|
||||
#define OSSL_PKEY_EC_ENCODING_EXPLICIT "explicit"
|
||||
#define OSSL_PKEY_EC_ENCODING_GROUP "named_curve"
|
||||
|
||||
#define OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_UNCOMPRESSED "uncompressed"
|
||||
#define OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_COMPRESSED "compressed"
|
||||
#define OSSL_PKEY_EC_POINT_CONVERSION_FORMAT_HYBRID "hybrid"
|
||||
|
||||
#define OSSL_PKEY_EC_GROUP_CHECK_DEFAULT "default"
|
||||
#define OSSL_PKEY_EC_GROUP_CHECK_NAMED "named"
|
||||
#define OSSL_PKEY_EC_GROUP_CHECK_NAMED_NIST "named-nist"
|
||||
|
||||
/* PROV_SKEY well known key types */
|
||||
#define OSSL_SKEY_TYPE_GENERIC "GENERIC-SECRET"
|
||||
#define OSSL_SKEY_TYPE_AES "AES"
|
||||
|
||||
/* OSSL_KEM_PARAM_OPERATION values */
|
||||
#define OSSL_KEM_PARAM_OPERATION_RSASVE "RSASVE"
|
||||
#define OSSL_KEM_PARAM_OPERATION_DHKEM "DHKEM"
|
||||
|
||||
/* Parameter name definitions - generated by util/perl/OpenSSL/paramnames.pm */
|
||||
/* clang-format off */
|
||||
# define OSSL_ALG_PARAM_ALGORITHM_ID "algorithm-id"
|
||||
# define OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS "algorithm-id-params"
|
||||
# define OSSL_ALG_PARAM_CIPHER "cipher"
|
||||
# define OSSL_ALG_PARAM_DIGEST "digest"
|
||||
# define OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR "fips-indicator"
|
||||
# define OSSL_ALG_PARAM_MAC "mac"
|
||||
# define OSSL_ALG_PARAM_PROPERTIES "properties"
|
||||
# define OSSL_ALG_PARAM_SECURITY_CATEGORY "security-category"
|
||||
# define OSSL_ASYM_CIPHER_PARAM_DIGEST OSSL_PKEY_PARAM_DIGEST
|
||||
# define OSSL_ASYM_CIPHER_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
||||
# define OSSL_ASYM_CIPHER_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK
|
||||
# define OSSL_ASYM_CIPHER_PARAM_FIPS_RSA_PKCS15_PAD_DISABLED OSSL_PROV_PARAM_RSA_PKCS15_PAD_DISABLED
|
||||
# define OSSL_ASYM_CIPHER_PARAM_IMPLICIT_REJECTION "implicit-rejection"
|
||||
# define OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST
|
||||
# define OSSL_ASYM_CIPHER_PARAM_MGF1_DIGEST_PROPS OSSL_PKEY_PARAM_MGF1_PROPERTIES
|
||||
# define OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST OSSL_ALG_PARAM_DIGEST
|
||||
# define OSSL_ASYM_CIPHER_PARAM_OAEP_DIGEST_PROPS "digest-props"
|
||||
# define OSSL_ASYM_CIPHER_PARAM_OAEP_LABEL "oaep-label"
|
||||
# define OSSL_ASYM_CIPHER_PARAM_PAD_MODE OSSL_PKEY_PARAM_PAD_MODE
|
||||
# define OSSL_ASYM_CIPHER_PARAM_PROPERTIES OSSL_PKEY_PARAM_PROPERTIES
|
||||
# define OSSL_ASYM_CIPHER_PARAM_TLS_CLIENT_VERSION "tls-client-version"
|
||||
# define OSSL_ASYM_CIPHER_PARAM_TLS_NEGOTIATED_VERSION "tls-negotiated-version"
|
||||
# define OSSL_CAPABILITY_TLS_GROUP_ALG "tls-group-alg"
|
||||
# define OSSL_CAPABILITY_TLS_GROUP_ID "tls-group-id"
|
||||
# define OSSL_CAPABILITY_TLS_GROUP_IS_KEM "tls-group-is-kem"
|
||||
# define OSSL_CAPABILITY_TLS_GROUP_MAX_DTLS "tls-max-dtls"
|
||||
# define OSSL_CAPABILITY_TLS_GROUP_MAX_TLS "tls-max-tls"
|
||||
# define OSSL_CAPABILITY_TLS_GROUP_MIN_DTLS "tls-min-dtls"
|
||||
# define OSSL_CAPABILITY_TLS_GROUP_MIN_TLS "tls-min-tls"
|
||||
# define OSSL_CAPABILITY_TLS_GROUP_NAME "tls-group-name"
|
||||
# define OSSL_CAPABILITY_TLS_GROUP_NAME_INTERNAL "tls-group-name-internal"
|
||||
# define OSSL_CAPABILITY_TLS_GROUP_SECURITY_BITS "tls-group-sec-bits"
|
||||
# define OSSL_CAPABILITY_TLS_SIGALG_CODE_POINT "tls-sigalg-code-point"
|
||||
# define OSSL_CAPABILITY_TLS_SIGALG_HASH_NAME "tls-sigalg-hash-name"
|
||||
# define OSSL_CAPABILITY_TLS_SIGALG_HASH_OID "tls-sigalg-hash-oid"
|
||||
# define OSSL_CAPABILITY_TLS_SIGALG_IANA_NAME "tls-sigalg-iana-name"
|
||||
# define OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE "tls-sigalg-keytype"
|
||||
# define OSSL_CAPABILITY_TLS_SIGALG_KEYTYPE_OID "tls-sigalg-keytype-oid"
|
||||
# define OSSL_CAPABILITY_TLS_SIGALG_MAX_DTLS "tls-max-dtls"
|
||||
# define OSSL_CAPABILITY_TLS_SIGALG_MAX_TLS "tls-max-tls"
|
||||
# define OSSL_CAPABILITY_TLS_SIGALG_MIN_DTLS "tls-min-dtls"
|
||||
# define OSSL_CAPABILITY_TLS_SIGALG_MIN_TLS "tls-min-tls"
|
||||
# define OSSL_CAPABILITY_TLS_SIGALG_NAME "tls-sigalg-name"
|
||||
# define OSSL_CAPABILITY_TLS_SIGALG_OID "tls-sigalg-oid"
|
||||
# define OSSL_CAPABILITY_TLS_SIGALG_SECURITY_BITS "tls-sigalg-sec-bits"
|
||||
# define OSSL_CAPABILITY_TLS_SIGALG_SIG_NAME "tls-sigalg-sig-name"
|
||||
# define OSSL_CAPABILITY_TLS_SIGALG_SIG_OID "tls-sigalg-sig-oid"
|
||||
# define OSSL_CIPHER_HMAC_PARAM_MAC OSSL_CIPHER_PARAM_AEAD_TAG
|
||||
# define OSSL_CIPHER_PARAM_AEAD "aead"
|
||||
# define OSSL_CIPHER_PARAM_AEAD_IVLEN OSSL_CIPHER_PARAM_IVLEN
|
||||
# define OSSL_CIPHER_PARAM_AEAD_IV_GENERATED "iv-generated"
|
||||
# define OSSL_CIPHER_PARAM_AEAD_MAC_KEY "mackey"
|
||||
# define OSSL_CIPHER_PARAM_AEAD_TAG "tag"
|
||||
# define OSSL_CIPHER_PARAM_AEAD_TAGLEN "taglen"
|
||||
# define OSSL_CIPHER_PARAM_AEAD_TLS1_AAD "tlsaad"
|
||||
# define OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD "tlsaadpad"
|
||||
# define OSSL_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN "tlsivgen"
|
||||
# define OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED "tlsivfixed"
|
||||
# define OSSL_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV "tlsivinv"
|
||||
# define OSSL_CIPHER_PARAM_ALGORITHM_ID OSSL_ALG_PARAM_ALGORITHM_ID
|
||||
# define OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS
|
||||
# define OSSL_CIPHER_PARAM_ALGORITHM_ID_PARAMS_OLD "alg_id_param"
|
||||
# define OSSL_CIPHER_PARAM_BLOCK_SIZE "blocksize"
|
||||
# define OSSL_CIPHER_PARAM_CTS "cts"
|
||||
# define OSSL_CIPHER_PARAM_CTS_MODE "cts_mode"
|
||||
# define OSSL_CIPHER_PARAM_CUSTOM_IV "custom-iv"
|
||||
# define OSSL_CIPHER_PARAM_DECRYPT_ONLY "decrypt-only"
|
||||
# define OSSL_CIPHER_PARAM_ENCRYPT_THEN_MAC "encrypt-then-mac"
|
||||
# define OSSL_CIPHER_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
||||
# define OSSL_CIPHER_PARAM_FIPS_ENCRYPT_CHECK "encrypt-check"
|
||||
# define OSSL_CIPHER_PARAM_HAS_RAND_KEY "has-randkey"
|
||||
# define OSSL_CIPHER_PARAM_IV "iv"
|
||||
# define OSSL_CIPHER_PARAM_IVLEN "ivlen"
|
||||
# define OSSL_CIPHER_PARAM_KEYLEN "keylen"
|
||||
# define OSSL_CIPHER_PARAM_MODE "mode"
|
||||
# define OSSL_CIPHER_PARAM_NUM "num"
|
||||
# define OSSL_CIPHER_PARAM_PADDING "padding"
|
||||
# define OSSL_CIPHER_PARAM_PIPELINE_AEAD_TAG "pipeline-tag"
|
||||
# define OSSL_CIPHER_PARAM_RANDOM_KEY "randkey"
|
||||
# define OSSL_CIPHER_PARAM_RC2_KEYBITS "keybits"
|
||||
# define OSSL_CIPHER_PARAM_ROUNDS "rounds"
|
||||
# define OSSL_CIPHER_PARAM_SPEED "speed"
|
||||
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK "tls-multi"
|
||||
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD "tls1multi_aad"
|
||||
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD_PACKLEN "tls1multi_aadpacklen"
|
||||
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC "tls1multi_enc"
|
||||
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN "tls1multi_encin"
|
||||
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_LEN "tls1multi_enclen"
|
||||
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE "tls1multi_interleave"
|
||||
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE "tls1multi_maxbufsz"
|
||||
# define OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_SEND_FRAGMENT "tls1multi_maxsndfrag"
|
||||
# define OSSL_CIPHER_PARAM_TLS_MAC "tls-mac"
|
||||
# define OSSL_CIPHER_PARAM_TLS_MAC_SIZE "tls-mac-size"
|
||||
# define OSSL_CIPHER_PARAM_TLS_VERSION "tls-version"
|
||||
# define OSSL_CIPHER_PARAM_UPDATED_IV "updated-iv"
|
||||
# define OSSL_CIPHER_PARAM_USE_BITS "use-bits"
|
||||
# define OSSL_CIPHER_PARAM_XTS_STANDARD "xts_standard"
|
||||
# define OSSL_DECODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
||||
# define OSSL_DIGEST_PARAM_ALGID_ABSENT "algid-absent"
|
||||
# define OSSL_DIGEST_PARAM_BLOCK_SIZE "blocksize"
|
||||
# define OSSL_DIGEST_PARAM_CUSTOMIZATION "customization"
|
||||
# define OSSL_DIGEST_PARAM_FUNCTION_NAME "function-name"
|
||||
# define OSSL_DIGEST_PARAM_MICALG "micalg"
|
||||
# define OSSL_DIGEST_PARAM_MU_CONTEXT_STRING "context-string"
|
||||
# define OSSL_DIGEST_PARAM_MU_DIGEST OSSL_ALG_PARAM_DIGEST
|
||||
# define OSSL_DIGEST_PARAM_MU_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
||||
# define OSSL_DIGEST_PARAM_MU_PUB_KEY "pub"
|
||||
# define OSSL_DIGEST_PARAM_PAD_TYPE "pad-type"
|
||||
# define OSSL_DIGEST_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
||||
# define OSSL_DIGEST_PARAM_SIZE "size"
|
||||
# define OSSL_DIGEST_PARAM_SSL3_MS "ssl3-ms"
|
||||
# define OSSL_DIGEST_PARAM_XOF "xof"
|
||||
# define OSSL_DIGEST_PARAM_XOFLEN "xoflen"
|
||||
# define OSSL_DRBG_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
|
||||
# define OSSL_DRBG_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
|
||||
# define OSSL_DRBG_PARAM_ENTROPY_REQUIRED "entropy_required"
|
||||
# define OSSL_DRBG_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
||||
# define OSSL_DRBG_PARAM_FIPS_DIGEST_CHECK OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK
|
||||
# define OSSL_DRBG_PARAM_MAC OSSL_ALG_PARAM_MAC
|
||||
# define OSSL_DRBG_PARAM_MAX_ADINLEN "max_adinlen"
|
||||
# define OSSL_DRBG_PARAM_MAX_ENTROPYLEN "max_entropylen"
|
||||
# define OSSL_DRBG_PARAM_MAX_LENGTH "maxium_length"
|
||||
# define OSSL_DRBG_PARAM_MAX_NONCELEN "max_noncelen"
|
||||
# define OSSL_DRBG_PARAM_MAX_PERSLEN "max_perslen"
|
||||
# define OSSL_DRBG_PARAM_MIN_ENTROPYLEN "min_entropylen"
|
||||
# define OSSL_DRBG_PARAM_MIN_LENGTH "minium_length"
|
||||
# define OSSL_DRBG_PARAM_MIN_NONCELEN "min_noncelen"
|
||||
# define OSSL_DRBG_PARAM_PREDICTION_RESISTANCE "prediction_resistance"
|
||||
# define OSSL_DRBG_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
||||
# define OSSL_DRBG_PARAM_RANDOM_DATA "random_data"
|
||||
# define OSSL_DRBG_PARAM_RESEED_COUNTER "reseed_counter"
|
||||
# define OSSL_DRBG_PARAM_RESEED_REQUESTS "reseed_requests"
|
||||
# define OSSL_DRBG_PARAM_RESEED_TIME "reseed_time"
|
||||
# define OSSL_DRBG_PARAM_RESEED_TIME_INTERVAL "reseed_time_interval"
|
||||
# define OSSL_DRBG_PARAM_SIZE "size"
|
||||
# define OSSL_DRBG_PARAM_USE_DF "use_derivation_function"
|
||||
# define OSSL_ENCODER_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
|
||||
# define OSSL_ENCODER_PARAM_ENCRYPT_LEVEL "encrypt-level"
|
||||
# define OSSL_ENCODER_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
||||
# define OSSL_ENCODER_PARAM_SAVE_PARAMETERS "save-parameters"
|
||||
# define OSSL_EXCHANGE_PARAM_EC_ECDH_COFACTOR_MODE "ecdh-cofactor-mode"
|
||||
# define OSSL_EXCHANGE_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
||||
# define OSSL_EXCHANGE_PARAM_FIPS_DIGEST_CHECK OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK
|
||||
# define OSSL_EXCHANGE_PARAM_FIPS_ECDH_COFACTOR_CHECK OSSL_PROV_PARAM_ECDH_COFACTOR_CHECK
|
||||
# define OSSL_EXCHANGE_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK
|
||||
# define OSSL_EXCHANGE_PARAM_KDF_DIGEST "kdf-digest"
|
||||
# define OSSL_EXCHANGE_PARAM_KDF_DIGEST_PROPS "kdf-digest-props"
|
||||
# define OSSL_EXCHANGE_PARAM_KDF_OUTLEN "kdf-outlen"
|
||||
# define OSSL_EXCHANGE_PARAM_KDF_TYPE "kdf-type"
|
||||
# define OSSL_EXCHANGE_PARAM_KDF_UKM "kdf-ukm"
|
||||
# define OSSL_EXCHANGE_PARAM_PAD "pad"
|
||||
# define OSSL_GEN_PARAM_ITERATION "iteration"
|
||||
# define OSSL_GEN_PARAM_POTENTIAL "potential"
|
||||
# define OSSL_KDF_PARAM_ARGON2_AD "ad"
|
||||
# define OSSL_KDF_PARAM_ARGON2_LANES "lanes"
|
||||
# define OSSL_KDF_PARAM_ARGON2_MEMCOST "memcost"
|
||||
# define OSSL_KDF_PARAM_ARGON2_VERSION "version"
|
||||
# define OSSL_KDF_PARAM_CEK_ALG "cekalg"
|
||||
# define OSSL_KDF_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
|
||||
# define OSSL_KDF_PARAM_CONSTANT "constant"
|
||||
# define OSSL_KDF_PARAM_DATA "data"
|
||||
# define OSSL_KDF_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
|
||||
# define OSSL_KDF_PARAM_EARLY_CLEAN "early_clean"
|
||||
# define OSSL_KDF_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
||||
# define OSSL_KDF_PARAM_FIPS_DIGEST_CHECK OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK
|
||||
# define OSSL_KDF_PARAM_FIPS_EMS_CHECK "ems_check"
|
||||
# define OSSL_KDF_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK
|
||||
# define OSSL_KDF_PARAM_HMACDRBG_ENTROPY "entropy"
|
||||
# define OSSL_KDF_PARAM_HMACDRBG_NONCE "nonce"
|
||||
# define OSSL_KDF_PARAM_INFO "info"
|
||||
# define OSSL_KDF_PARAM_ITER "iter"
|
||||
# define OSSL_KDF_PARAM_KBKDF_R "r"
|
||||
# define OSSL_KDF_PARAM_KBKDF_USE_L "use-l"
|
||||
# define OSSL_KDF_PARAM_KBKDF_USE_SEPARATOR "use-separator"
|
||||
# define OSSL_KDF_PARAM_KEY "key"
|
||||
# define OSSL_KDF_PARAM_LABEL "label"
|
||||
# define OSSL_KDF_PARAM_MAC OSSL_ALG_PARAM_MAC
|
||||
# define OSSL_KDF_PARAM_MAC_SIZE "maclen"
|
||||
# define OSSL_KDF_PARAM_MODE "mode"
|
||||
# define OSSL_KDF_PARAM_PASSWORD "pass"
|
||||
# define OSSL_KDF_PARAM_PKCS12_ID "id"
|
||||
# define OSSL_KDF_PARAM_PKCS5 "pkcs5"
|
||||
# define OSSL_KDF_PARAM_PREFIX "prefix"
|
||||
# define OSSL_KDF_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
||||
# define OSSL_KDF_PARAM_SALT "salt"
|
||||
# define OSSL_KDF_PARAM_SCRYPT_MAXMEM "maxmem_bytes"
|
||||
# define OSSL_KDF_PARAM_SCRYPT_N "n"
|
||||
# define OSSL_KDF_PARAM_SCRYPT_P "p"
|
||||
# define OSSL_KDF_PARAM_SCRYPT_R "r"
|
||||
# define OSSL_KDF_PARAM_SECRET "secret"
|
||||
# define OSSL_KDF_PARAM_SEED "seed"
|
||||
# define OSSL_KDF_PARAM_SIZE "size"
|
||||
# define OSSL_KDF_PARAM_SNMPKDF_EID "eid"
|
||||
# define OSSL_KDF_PARAM_SRTPKDF_INDEX "index"
|
||||
# define OSSL_KDF_PARAM_SRTPKDF_KDR "kdr"
|
||||
# define OSSL_KDF_PARAM_SRTPKDF_LABEL "label"
|
||||
# define OSSL_KDF_PARAM_SSHKDF_SESSION_ID "session_id"
|
||||
# define OSSL_KDF_PARAM_SSHKDF_TYPE "type"
|
||||
# define OSSL_KDF_PARAM_SSHKDF_XCGHASH "xcghash"
|
||||
# define OSSL_KDF_PARAM_THREADS "threads"
|
||||
# define OSSL_KDF_PARAM_UKM "ukm"
|
||||
# define OSSL_KDF_PARAM_X942_ACVPINFO "acvp-info"
|
||||
# define OSSL_KDF_PARAM_X942_PARTYUINFO "partyu-info"
|
||||
# define OSSL_KDF_PARAM_X942_PARTYVINFO "partyv-info"
|
||||
# define OSSL_KDF_PARAM_X942_SUPP_PRIVINFO "supp-privinfo"
|
||||
# define OSSL_KDF_PARAM_X942_SUPP_PUBINFO "supp-pubinfo"
|
||||
# define OSSL_KDF_PARAM_X942_USE_KEYBITS "use-keybits"
|
||||
# define OSSL_KEM_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
||||
# define OSSL_KEM_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK
|
||||
# define OSSL_KEM_PARAM_IKME "ikme"
|
||||
# define OSSL_KEM_PARAM_OPERATION "operation"
|
||||
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_BLOCK_PADDING "block_padding"
|
||||
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_HS_PADDING "hs_padding"
|
||||
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_EARLY_DATA "max_early_data"
|
||||
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MAX_FRAG_LEN "max_frag_len"
|
||||
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_MODE "mode"
|
||||
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_OPTIONS "options"
|
||||
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_READ_AHEAD "read_ahead"
|
||||
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_STREAM_MAC "stream_mac"
|
||||
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_TLSTREE "tlstree"
|
||||
# define OSSL_LIBSSL_RECORD_LAYER_PARAM_USE_ETM "use_etm"
|
||||
# define OSSL_LIBSSL_RECORD_LAYER_READ_BUFFER_LEN "read_buffer_len"
|
||||
# define OSSL_MAC_PARAM_BLOCK_SIZE "block-size"
|
||||
# define OSSL_MAC_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
|
||||
# define OSSL_MAC_PARAM_CUSTOM "custom"
|
||||
# define OSSL_MAC_PARAM_C_ROUNDS "c-rounds"
|
||||
# define OSSL_MAC_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
|
||||
# define OSSL_MAC_PARAM_DIGEST_NOINIT "digest-noinit"
|
||||
# define OSSL_MAC_PARAM_DIGEST_ONESHOT "digest-oneshot"
|
||||
# define OSSL_MAC_PARAM_D_ROUNDS "d-rounds"
|
||||
# define OSSL_MAC_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
||||
# define OSSL_MAC_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK
|
||||
# define OSSL_MAC_PARAM_FIPS_NO_SHORT_MAC OSSL_PROV_PARAM_NO_SHORT_MAC
|
||||
# define OSSL_MAC_PARAM_IV "iv"
|
||||
# define OSSL_MAC_PARAM_KEY "key"
|
||||
# define OSSL_MAC_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
||||
# define OSSL_MAC_PARAM_SALT "salt"
|
||||
# define OSSL_MAC_PARAM_SIZE "size"
|
||||
# define OSSL_MAC_PARAM_TLS_DATA_SIZE "tls-data-size"
|
||||
# define OSSL_MAC_PARAM_XOF "xof"
|
||||
# define OSSL_OBJECT_PARAM_DATA "data"
|
||||
# define OSSL_OBJECT_PARAM_DATA_STRUCTURE "data-structure"
|
||||
# define OSSL_OBJECT_PARAM_DATA_TYPE "data-type"
|
||||
# define OSSL_OBJECT_PARAM_DESC "desc"
|
||||
# define OSSL_OBJECT_PARAM_INPUT_TYPE "input-type"
|
||||
# define OSSL_OBJECT_PARAM_REFERENCE "reference"
|
||||
# define OSSL_OBJECT_PARAM_TYPE "type"
|
||||
# define OSSL_PASSPHRASE_PARAM_INFO "info"
|
||||
# define OSSL_PKEY_PARAM_ALGORITHM_ID OSSL_ALG_PARAM_ALGORITHM_ID
|
||||
# define OSSL_PKEY_PARAM_ALGORITHM_ID_PARAMS OSSL_ALG_PARAM_ALGORITHM_ID_PARAMS
|
||||
# define OSSL_PKEY_PARAM_BITS "bits"
|
||||
# define OSSL_PKEY_PARAM_CIPHER OSSL_ALG_PARAM_CIPHER
|
||||
# define OSSL_PKEY_PARAM_CMS_KEMRI_KDF_ALGORITHM "kemri-kdf-alg"
|
||||
# define OSSL_PKEY_PARAM_CMS_RI_TYPE "ri-type"
|
||||
# define OSSL_PKEY_PARAM_DEFAULT_DIGEST "default-digest"
|
||||
# define OSSL_PKEY_PARAM_DHKEM_IKM "dhkem-ikm"
|
||||
# define OSSL_PKEY_PARAM_DH_GENERATOR "safeprime-generator"
|
||||
# define OSSL_PKEY_PARAM_DH_PRIV_LEN "priv_len"
|
||||
# define OSSL_PKEY_PARAM_DIGEST OSSL_ALG_PARAM_DIGEST
|
||||
# define OSSL_PKEY_PARAM_DIGEST_SIZE "digest-size"
|
||||
# define OSSL_PKEY_PARAM_DIST_ID "distid"
|
||||
# define OSSL_PKEY_PARAM_EC_A "a"
|
||||
# define OSSL_PKEY_PARAM_EC_B "b"
|
||||
# define OSSL_PKEY_PARAM_EC_CHAR2_M "m"
|
||||
# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K1 "k1"
|
||||
# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K2 "k2"
|
||||
# define OSSL_PKEY_PARAM_EC_CHAR2_PP_K3 "k3"
|
||||
# define OSSL_PKEY_PARAM_EC_CHAR2_TP_BASIS "tp"
|
||||
# define OSSL_PKEY_PARAM_EC_CHAR2_TYPE "basis-type"
|
||||
# define OSSL_PKEY_PARAM_EC_COFACTOR "cofactor"
|
||||
# define OSSL_PKEY_PARAM_EC_DECODED_FROM_EXPLICIT_PARAMS "decoded-from-explicit"
|
||||
# define OSSL_PKEY_PARAM_EC_ENCODING "encoding"
|
||||
# define OSSL_PKEY_PARAM_EC_FIELD_DEGREE "field-degree"
|
||||
# define OSSL_PKEY_PARAM_EC_FIELD_TYPE "field-type"
|
||||
# define OSSL_PKEY_PARAM_EC_GENERATOR "generator"
|
||||
# define OSSL_PKEY_PARAM_EC_GROUP_CHECK_TYPE "group-check"
|
||||
# define OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC "include-public"
|
||||
# define OSSL_PKEY_PARAM_EC_ORDER "order"
|
||||
# define OSSL_PKEY_PARAM_EC_P "p"
|
||||
# define OSSL_PKEY_PARAM_EC_POINT_CONVERSION_FORMAT "point-format"
|
||||
# define OSSL_PKEY_PARAM_EC_PUB_X "qx"
|
||||
# define OSSL_PKEY_PARAM_EC_PUB_Y "qy"
|
||||
# define OSSL_PKEY_PARAM_EC_SEED "seed"
|
||||
# define OSSL_PKEY_PARAM_ENCODED_PUBLIC_KEY "encoded-pub-key"
|
||||
# define OSSL_PKEY_PARAM_FFC_COFACTOR "j"
|
||||
# define OSSL_PKEY_PARAM_FFC_DIGEST OSSL_PKEY_PARAM_DIGEST
|
||||
# define OSSL_PKEY_PARAM_FFC_DIGEST_PROPS OSSL_PKEY_PARAM_PROPERTIES
|
||||
# define OSSL_PKEY_PARAM_FFC_G "g"
|
||||
# define OSSL_PKEY_PARAM_FFC_GINDEX "gindex"
|
||||
# define OSSL_PKEY_PARAM_FFC_H "hindex"
|
||||
# define OSSL_PKEY_PARAM_FFC_P "p"
|
||||
# define OSSL_PKEY_PARAM_FFC_PBITS "pbits"
|
||||
# define OSSL_PKEY_PARAM_FFC_PCOUNTER "pcounter"
|
||||
# define OSSL_PKEY_PARAM_FFC_Q "q"
|
||||
# define OSSL_PKEY_PARAM_FFC_QBITS "qbits"
|
||||
# define OSSL_PKEY_PARAM_FFC_SEED "seed"
|
||||
# define OSSL_PKEY_PARAM_FFC_TYPE "type"
|
||||
# define OSSL_PKEY_PARAM_FFC_VALIDATE_G "validate-g"
|
||||
# define OSSL_PKEY_PARAM_FFC_VALIDATE_LEGACY "validate-legacy"
|
||||
# define OSSL_PKEY_PARAM_FFC_VALIDATE_PQ "validate-pq"
|
||||
# define OSSL_PKEY_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
||||
# define OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK "digest-check"
|
||||
# define OSSL_PKEY_PARAM_FIPS_KEY_CHECK "key-check"
|
||||
# define OSSL_PKEY_PARAM_FIPS_SIGN_CHECK "sign-check"
|
||||
# define OSSL_PKEY_PARAM_GROUP_NAME "group"
|
||||
# define OSSL_PKEY_PARAM_IMPLICIT_REJECTION "implicit-rejection"
|
||||
# define OSSL_PKEY_PARAM_MANDATORY_DIGEST "mandatory-digest"
|
||||
# define OSSL_PKEY_PARAM_MASKGENFUNC "mgf"
|
||||
# define OSSL_PKEY_PARAM_MAX_SIZE "max-size"
|
||||
# define OSSL_PKEY_PARAM_MGF1_DIGEST "mgf1-digest"
|
||||
# define OSSL_PKEY_PARAM_MGF1_PROPERTIES "mgf1-properties"
|
||||
# define OSSL_PKEY_PARAM_ML_DSA_INPUT_FORMATS "ml-dsa.input_formats"
|
||||
# define OSSL_PKEY_PARAM_ML_DSA_OUTPUT_FORMATS "ml-dsa.output_formats"
|
||||
# define OSSL_PKEY_PARAM_ML_DSA_PREFER_SEED "ml-dsa.prefer_seed"
|
||||
# define OSSL_PKEY_PARAM_ML_DSA_RETAIN_SEED "ml-dsa.retain_seed"
|
||||
# define OSSL_PKEY_PARAM_ML_DSA_SEED "seed"
|
||||
# define OSSL_PKEY_PARAM_ML_KEM_IMPORT_PCT_TYPE "ml-kem.import_pct_type"
|
||||
# define OSSL_PKEY_PARAM_ML_KEM_INPUT_FORMATS "ml-kem.input_formats"
|
||||
# define OSSL_PKEY_PARAM_ML_KEM_OUTPUT_FORMATS "ml-kem.output_formats"
|
||||
# define OSSL_PKEY_PARAM_ML_KEM_PREFER_SEED "ml-kem.prefer_seed"
|
||||
# define OSSL_PKEY_PARAM_ML_KEM_RETAIN_SEED "ml-kem.retain_seed"
|
||||
# define OSSL_PKEY_PARAM_ML_KEM_SEED "seed"
|
||||
# define OSSL_PKEY_PARAM_OUTPUT_FORMATS "output_formats"
|
||||
# define OSSL_PKEY_PARAM_PAD_MODE "pad-mode"
|
||||
# define OSSL_PKEY_PARAM_PRIV_KEY "priv"
|
||||
# define OSSL_PKEY_PARAM_PROPERTIES OSSL_ALG_PARAM_PROPERTIES
|
||||
# define OSSL_PKEY_PARAM_PUB_KEY "pub"
|
||||
# define OSSL_PKEY_PARAM_RSA_A "rsa-a"
|
||||
# define OSSL_PKEY_PARAM_RSA_B "rsa-b"
|
||||
# define OSSL_PKEY_PARAM_RSA_BITS OSSL_PKEY_PARAM_BITS
|
||||
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT "rsa-coefficient"
|
||||
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT1 "rsa-coefficient1"
|
||||
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT2 "rsa-coefficient2"
|
||||
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT3 "rsa-coefficient3"
|
||||
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT4 "rsa-coefficient4"
|
||||
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT5 "rsa-coefficient5"
|
||||
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT6 "rsa-coefficient6"
|
||||
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT7 "rsa-coefficient7"
|
||||
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT8 "rsa-coefficient8"
|
||||
# define OSSL_PKEY_PARAM_RSA_COEFFICIENT9 "rsa-coefficient9"
|
||||
# define OSSL_PKEY_PARAM_RSA_D "d"
|
||||
# define OSSL_PKEY_PARAM_RSA_DERIVE_FROM_PQ "rsa-derive-from-pq"
|
||||
# define OSSL_PKEY_PARAM_RSA_DIGEST OSSL_PKEY_PARAM_DIGEST
|
||||
# define OSSL_PKEY_PARAM_RSA_DIGEST_PROPS OSSL_PKEY_PARAM_PROPERTIES
|
||||
# define OSSL_PKEY_PARAM_RSA_E "e"
|
||||
# define OSSL_PKEY_PARAM_RSA_EXPONENT "rsa-exponent"
|
||||
# define OSSL_PKEY_PARAM_RSA_EXPONENT1 "rsa-exponent1"
|
||||
# define OSSL_PKEY_PARAM_RSA_EXPONENT10 "rsa-exponent10"
|
||||
# define OSSL_PKEY_PARAM_RSA_EXPONENT2 "rsa-exponent2"
|
||||
# define OSSL_PKEY_PARAM_RSA_EXPONENT3 "rsa-exponent3"
|
||||
# define OSSL_PKEY_PARAM_RSA_EXPONENT4 "rsa-exponent4"
|
||||
# define OSSL_PKEY_PARAM_RSA_EXPONENT5 "rsa-exponent5"
|
||||
# define OSSL_PKEY_PARAM_RSA_EXPONENT6 "rsa-exponent6"
|
||||
# define OSSL_PKEY_PARAM_RSA_EXPONENT7 "rsa-exponent7"
|
||||
# define OSSL_PKEY_PARAM_RSA_EXPONENT8 "rsa-exponent8"
|
||||
# define OSSL_PKEY_PARAM_RSA_EXPONENT9 "rsa-exponent9"
|
||||
# define OSSL_PKEY_PARAM_RSA_FACTOR "rsa-factor"
|
||||
# define OSSL_PKEY_PARAM_RSA_FACTOR1 "rsa-factor1"
|
||||
# define OSSL_PKEY_PARAM_RSA_FACTOR10 "rsa-factor10"
|
||||
# define OSSL_PKEY_PARAM_RSA_FACTOR2 "rsa-factor2"
|
||||
# define OSSL_PKEY_PARAM_RSA_FACTOR3 "rsa-factor3"
|
||||
# define OSSL_PKEY_PARAM_RSA_FACTOR4 "rsa-factor4"
|
||||
# define OSSL_PKEY_PARAM_RSA_FACTOR5 "rsa-factor5"
|
||||
# define OSSL_PKEY_PARAM_RSA_FACTOR6 "rsa-factor6"
|
||||
# define OSSL_PKEY_PARAM_RSA_FACTOR7 "rsa-factor7"
|
||||
# define OSSL_PKEY_PARAM_RSA_FACTOR8 "rsa-factor8"
|
||||
# define OSSL_PKEY_PARAM_RSA_FACTOR9 "rsa-factor9"
|
||||
# define OSSL_PKEY_PARAM_RSA_MASKGENFUNC OSSL_PKEY_PARAM_MASKGENFUNC
|
||||
# define OSSL_PKEY_PARAM_RSA_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST
|
||||
# define OSSL_PKEY_PARAM_RSA_N "n"
|
||||
# define OSSL_PKEY_PARAM_RSA_PRIMES "primes"
|
||||
# define OSSL_PKEY_PARAM_RSA_PSS_SALTLEN "saltlen"
|
||||
# define OSSL_PKEY_PARAM_RSA_TEST_P1 "p1"
|
||||
# define OSSL_PKEY_PARAM_RSA_TEST_P2 "p2"
|
||||
# define OSSL_PKEY_PARAM_RSA_TEST_Q1 "q1"
|
||||
# define OSSL_PKEY_PARAM_RSA_TEST_Q2 "q2"
|
||||
# define OSSL_PKEY_PARAM_RSA_TEST_XP "xp"
|
||||
# define OSSL_PKEY_PARAM_RSA_TEST_XP1 "xp1"
|
||||
# define OSSL_PKEY_PARAM_RSA_TEST_XP2 "xp2"
|
||||
# define OSSL_PKEY_PARAM_RSA_TEST_XQ "xq"
|
||||
# define OSSL_PKEY_PARAM_RSA_TEST_XQ1 "xq1"
|
||||
# define OSSL_PKEY_PARAM_RSA_TEST_XQ2 "xq2"
|
||||
# define OSSL_PKEY_PARAM_SECURITY_BITS "security-bits"
|
||||
# define OSSL_PKEY_PARAM_SECURITY_CATEGORY OSSL_ALG_PARAM_SECURITY_CATEGORY
|
||||
# define OSSL_PKEY_PARAM_SLH_DSA_SEED "seed"
|
||||
# define OSSL_PKEY_PARAM_USE_COFACTOR_ECDH OSSL_PKEY_PARAM_USE_COFACTOR_FLAG
|
||||
# define OSSL_PKEY_PARAM_USE_COFACTOR_FLAG "use-cofactor-flag"
|
||||
# define OSSL_PROV_PARAM_BUILDINFO "buildinfo"
|
||||
# define OSSL_PROV_PARAM_CORE_MODULE_FILENAME "module-filename"
|
||||
# define OSSL_PROV_PARAM_CORE_PROV_NAME "provider-name"
|
||||
# define OSSL_PROV_PARAM_CORE_VERSION "openssl-version"
|
||||
# define OSSL_PROV_PARAM_DRBG_TRUNC_DIGEST "drbg-no-trunc-md"
|
||||
# define OSSL_PROV_PARAM_DSA_SIGN_DISABLED "dsa-sign-disabled"
|
||||
# define OSSL_PROV_PARAM_ECDH_COFACTOR_CHECK "ecdh-cofactor-check"
|
||||
# define OSSL_PROV_PARAM_HKDF_DIGEST_CHECK "hkdf-digest-check"
|
||||
# define OSSL_PROV_PARAM_HKDF_KEY_CHECK "hkdf-key-check"
|
||||
# define OSSL_PROV_PARAM_HMAC_KEY_CHECK "hmac-key-check"
|
||||
# define OSSL_PROV_PARAM_KBKDF_KEY_CHECK "kbkdf-key-check"
|
||||
# define OSSL_PROV_PARAM_KMAC_KEY_CHECK "kmac-key-check"
|
||||
# define OSSL_PROV_PARAM_NAME "name"
|
||||
# define OSSL_PROV_PARAM_NO_SHORT_MAC "no-short-mac"
|
||||
# define OSSL_PROV_PARAM_PBKDF2_LOWER_BOUND_CHECK "pbkdf2-lower-bound-check"
|
||||
# define OSSL_PROV_PARAM_RSA_PKCS15_PAD_DISABLED "rsa-pkcs15-pad-disabled"
|
||||
# define OSSL_PROV_PARAM_RSA_PSS_SALTLEN_CHECK "rsa-pss-saltlen-check"
|
||||
# define OSSL_PROV_PARAM_RSA_SIGN_X931_PAD_DISABLED "rsa-sign-x931-pad-disabled"
|
||||
# define OSSL_PROV_PARAM_SECURITY_CHECKS "security-checks"
|
||||
# define OSSL_PROV_PARAM_SELF_TEST_DESC "st-desc"
|
||||
# define OSSL_PROV_PARAM_SELF_TEST_PHASE "st-phase"
|
||||
# define OSSL_PROV_PARAM_SELF_TEST_TYPE "st-type"
|
||||
# define OSSL_PROV_PARAM_SIGNATURE_DIGEST_CHECK "signature-digest-check"
|
||||
# define OSSL_PROV_PARAM_SSHKDF_DIGEST_CHECK "sshkdf-digest-check"
|
||||
# define OSSL_PROV_PARAM_SSHKDF_KEY_CHECK "sshkdf-key-check"
|
||||
# define OSSL_PROV_PARAM_SSKDF_DIGEST_CHECK "sskdf-digest-check"
|
||||
# define OSSL_PROV_PARAM_SSKDF_KEY_CHECK "sskdf-key-check"
|
||||
# define OSSL_PROV_PARAM_STATUS "status"
|
||||
# define OSSL_PROV_PARAM_TDES_ENCRYPT_DISABLED "tdes-encrypt-disabled"
|
||||
# define OSSL_PROV_PARAM_TLS13_KDF_DIGEST_CHECK "tls13-kdf-digest-check"
|
||||
# define OSSL_PROV_PARAM_TLS13_KDF_KEY_CHECK "tls13-kdf-key-check"
|
||||
# define OSSL_PROV_PARAM_TLS1_PRF_DIGEST_CHECK "tls1-prf-digest-check"
|
||||
# define OSSL_PROV_PARAM_TLS1_PRF_EMS_CHECK "tls1-prf-ems-check"
|
||||
# define OSSL_PROV_PARAM_TLS1_PRF_KEY_CHECK "tls1-prf-key-check"
|
||||
# define OSSL_PROV_PARAM_VERSION "version"
|
||||
# define OSSL_PROV_PARAM_X942KDF_KEY_CHECK "x942kdf-key-check"
|
||||
# define OSSL_PROV_PARAM_X963KDF_DIGEST_CHECK "x963kdf-digest-check"
|
||||
# define OSSL_PROV_PARAM_X963KDF_KEY_CHECK "x963kdf-key-check"
|
||||
# define OSSL_RAND_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
||||
# define OSSL_RAND_PARAM_GENERATE "generate"
|
||||
# define OSSL_RAND_PARAM_MAX_REQUEST "max_request"
|
||||
# define OSSL_RAND_PARAM_STATE "state"
|
||||
# define OSSL_RAND_PARAM_STRENGTH "strength"
|
||||
# define OSSL_RAND_PARAM_TEST_ENTROPY "test_entropy"
|
||||
# define OSSL_RAND_PARAM_TEST_NONCE "test_nonce"
|
||||
# define OSSL_SIGNATURE_PARAM_ADD_RANDOM "additional-random"
|
||||
# define OSSL_SIGNATURE_PARAM_ALGORITHM_ID OSSL_PKEY_PARAM_ALGORITHM_ID
|
||||
# define OSSL_SIGNATURE_PARAM_ALGORITHM_ID_PARAMS OSSL_PKEY_PARAM_ALGORITHM_ID_PARAMS
|
||||
# define OSSL_SIGNATURE_PARAM_CONTEXT_STRING "context-string"
|
||||
# define OSSL_SIGNATURE_PARAM_DETERMINISTIC "deterministic"
|
||||
# define OSSL_SIGNATURE_PARAM_DIGEST OSSL_PKEY_PARAM_DIGEST
|
||||
# define OSSL_SIGNATURE_PARAM_DIGEST_SIZE OSSL_PKEY_PARAM_DIGEST_SIZE
|
||||
# define OSSL_SIGNATURE_PARAM_FIPS_APPROVED_INDICATOR OSSL_ALG_PARAM_FIPS_APPROVED_INDICATOR
|
||||
# define OSSL_SIGNATURE_PARAM_FIPS_DIGEST_CHECK OSSL_PKEY_PARAM_FIPS_DIGEST_CHECK
|
||||
# define OSSL_SIGNATURE_PARAM_FIPS_KEY_CHECK OSSL_PKEY_PARAM_FIPS_KEY_CHECK
|
||||
# define OSSL_SIGNATURE_PARAM_FIPS_RSA_PSS_SALTLEN_CHECK "rsa-pss-saltlen-check"
|
||||
# define OSSL_SIGNATURE_PARAM_FIPS_SIGN_CHECK OSSL_PKEY_PARAM_FIPS_SIGN_CHECK
|
||||
# define OSSL_SIGNATURE_PARAM_FIPS_SIGN_X931_PAD_CHECK "sign-x931-pad-check"
|
||||
# define OSSL_SIGNATURE_PARAM_FIPS_VERIFY_MESSAGE "verify-message"
|
||||
# define OSSL_SIGNATURE_PARAM_INSTANCE "instance"
|
||||
# define OSSL_SIGNATURE_PARAM_KAT "kat"
|
||||
# define OSSL_SIGNATURE_PARAM_MESSAGE_ENCODING "message-encoding"
|
||||
# define OSSL_SIGNATURE_PARAM_MGF1_DIGEST OSSL_PKEY_PARAM_MGF1_DIGEST
|
||||
# define OSSL_SIGNATURE_PARAM_MGF1_PROPERTIES OSSL_PKEY_PARAM_MGF1_PROPERTIES
|
||||
# define OSSL_SIGNATURE_PARAM_MU "mu"
|
||||
# define OSSL_SIGNATURE_PARAM_NONCE_TYPE "nonce-type"
|
||||
# define OSSL_SIGNATURE_PARAM_PAD_MODE OSSL_PKEY_PARAM_PAD_MODE
|
||||
# define OSSL_SIGNATURE_PARAM_PROPERTIES OSSL_PKEY_PARAM_PROPERTIES
|
||||
# define OSSL_SIGNATURE_PARAM_PSS_SALTLEN "saltlen"
|
||||
# define OSSL_SIGNATURE_PARAM_SIGNATURE "signature"
|
||||
# define OSSL_SIGNATURE_PARAM_TEST_ENTROPY "test-entropy"
|
||||
# define OSSL_SIGNATURE_PARAM_TLS_VERSION "tls-version"
|
||||
# define OSSL_SKEY_PARAM_KEY_LENGTH "key-length"
|
||||
# define OSSL_SKEY_PARAM_RAW_BYTES "raw-bytes"
|
||||
# define OSSL_STORE_PARAM_ALIAS "alias"
|
||||
# define OSSL_STORE_PARAM_DIGEST "digest"
|
||||
# define OSSL_STORE_PARAM_EXPECT "expect"
|
||||
# define OSSL_STORE_PARAM_FINGERPRINT "fingerprint"
|
||||
# define OSSL_STORE_PARAM_INPUT_TYPE "input-type"
|
||||
# define OSSL_STORE_PARAM_ISSUER "name"
|
||||
# define OSSL_STORE_PARAM_PROPERTIES "properties"
|
||||
# define OSSL_STORE_PARAM_SERIAL "serial"
|
||||
# define OSSL_STORE_PARAM_SUBJECT "subject"
|
||||
/* clang-format on */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef OPENSSL_CORE_OBJECT_H
|
||||
#define OPENSSL_CORE_OBJECT_H
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*-
|
||||
* Known object types
|
||||
*
|
||||
* These numbers are used as values for the OSSL_PARAM parameter
|
||||
* OSSL_OBJECT_PARAM_TYPE.
|
||||
*
|
||||
* For most of these types, there's a corresponding libcrypto object type.
|
||||
* The corresponding type is indicated with a comment after the number.
|
||||
*/
|
||||
#define OSSL_OBJECT_UNKNOWN 0
|
||||
#define OSSL_OBJECT_NAME 1 /* char * */
|
||||
#define OSSL_OBJECT_PKEY 2 /* EVP_PKEY * */
|
||||
#define OSSL_OBJECT_CERT 3 /* X509 * */
|
||||
#define OSSL_OBJECT_CRL 4 /* X509_CRL * */
|
||||
#define OSSL_OBJECT_SKEY 5 /* EVP_SKEY * */
|
||||
|
||||
/*
|
||||
* The rest of the associated OSSL_PARAM elements is described in core_names.h
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -2,7 +2,7 @@
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/crmf.h.in
|
||||
*
|
||||
* Copyright 2007-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2007-2026 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright Nokia 2007-2019
|
||||
* Copyright Siemens AG 2015-2019
|
||||
*
|
||||
@@ -14,7 +14,9 @@
|
||||
* CRMF (RFC 4211) implementation by M. Peylo, M. Viljanen, and D. von Oheimb.
|
||||
*/
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#ifndef OPENSSL_CRMF_H
|
||||
#define OPENSSL_CRMF_H
|
||||
@@ -26,6 +28,7 @@
|
||||
#include <openssl/safestack.h>
|
||||
#include <openssl/crmferr.h>
|
||||
#include <openssl/x509v3.h> /* for GENERAL_NAME etc. */
|
||||
#include <openssl/cms.h>
|
||||
|
||||
/* explicit #includes not strictly needed since implied by the above: */
|
||||
#include <openssl/types.h>
|
||||
@@ -43,18 +46,22 @@ extern "C" {
|
||||
|
||||
#define OSSL_CRMF_SUBSEQUENTMESSAGE_ENCRCERT 0
|
||||
#define OSSL_CRMF_SUBSEQUENTMESSAGE_CHALLENGERESP 1
|
||||
|
||||
typedef struct ossl_crmf_encryptedvalue_st OSSL_CRMF_ENCRYPTEDVALUE;
|
||||
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_ENCRYPTEDVALUE)
|
||||
|
||||
typedef struct ossl_crmf_encryptedkey_st OSSL_CRMF_ENCRYPTEDKEY;
|
||||
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_ENCRYPTEDKEY)
|
||||
|
||||
typedef struct ossl_crmf_msg_st OSSL_CRMF_MSG;
|
||||
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_MSG)
|
||||
DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_MSG)
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CRMF_MSG, OSSL_CRMF_MSG, OSSL_CRMF_MSG)
|
||||
#define sk_OSSL_CRMF_MSG_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk))
|
||||
#define sk_OSSL_CRMF_MSG_value(sk, idx) ((OSSL_CRMF_MSG *)OPENSSL_sk_value(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk), (idx)))
|
||||
#define sk_OSSL_CRMF_MSG_new(cmp) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_new(ossl_check_OSSL_CRMF_MSG_compfunc_type(cmp)))
|
||||
#define sk_OSSL_CRMF_MSG_new_null() ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_new_null())
|
||||
#define sk_OSSL_CRMF_MSG_new_reserve(cmp, n) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CRMF_MSG_compfunc_type(cmp), (n)))
|
||||
#define sk_OSSL_CRMF_MSG_new(cmp) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_OSSL_CRMF_MSG_compfunc_type(cmp)), sk_OSSL_CRMF_MSG_cmpfunc_thunk))
|
||||
#define sk_OSSL_CRMF_MSG_new_null() ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_OSSL_CRMF_MSG_freefunc_thunk))
|
||||
#define sk_OSSL_CRMF_MSG_new_reserve(cmp, n) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_OSSL_CRMF_MSG_compfunc_type(cmp), (n)), sk_OSSL_CRMF_MSG_cmpfunc_thunk))
|
||||
#define sk_OSSL_CRMF_MSG_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CRMF_MSG_sk_type(sk), (n))
|
||||
#define sk_OSSL_CRMF_MSG_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CRMF_MSG_sk_type(sk))
|
||||
#define sk_OSSL_CRMF_MSG_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CRMF_MSG_sk_type(sk))
|
||||
@@ -76,7 +83,40 @@ SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CRMF_MSG, OSSL_CRMF_MSG, OSSL_CRMF_MSG)
|
||||
#define sk_OSSL_CRMF_MSG_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CRMF_MSG) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_copyfunc_type(copyfunc), ossl_check_OSSL_CRMF_MSG_freefunc_type(freefunc)))
|
||||
#define sk_OSSL_CRMF_MSG_set_cmp_func(sk, cmp) ((sk_OSSL_CRMF_MSG_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CRMF_MSG_sk_type(sk), ossl_check_OSSL_CRMF_MSG_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
typedef struct ossl_crmf_attributetypeandvalue_st OSSL_CRMF_ATTRIBUTETYPEANDVALUE;
|
||||
void OSSL_CRMF_ATTRIBUTETYPEANDVALUE_free(OSSL_CRMF_ATTRIBUTETYPEANDVALUE *v);
|
||||
DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_ATTRIBUTETYPEANDVALUE)
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CRMF_ATTRIBUTETYPEANDVALUE, OSSL_CRMF_ATTRIBUTETYPEANDVALUE, OSSL_CRMF_ATTRIBUTETYPEANDVALUE)
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_value(sk, idx) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_value(ossl_check_const_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), (idx)))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_new(cmp) ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_compfunc_type(cmp)), sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_cmpfunc_thunk))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_new_null() ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_freefunc_thunk))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_new_reserve(cmp, n) ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_compfunc_type(cmp), (n)), sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_cmpfunc_thunk))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), (n))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_delete(sk, i) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_delete(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), (i)))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_delete_ptr(sk, ptr) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_delete_ptr(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr)))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_pop(sk) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_pop(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk)))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_shift(sk) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_shift(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk)))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_freefunc_type(freefunc))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr), (idx))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_set(sk, idx, ptr) ((OSSL_CRMF_ATTRIBUTETYPEANDVALUE *)OPENSSL_sk_set(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), (idx), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr)))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_type(ptr), pnum)
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sort(sk) OPENSSL_sk_sort(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_dup(sk) ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_dup(ossl_check_const_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk)))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CRMF_ATTRIBUTETYPEANDVALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_copyfunc_type(copyfunc), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_freefunc_type(freefunc)))
|
||||
#define sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_set_cmp_func(sk, cmp) ((sk_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_sk_type(sk), ossl_check_OSSL_CRMF_ATTRIBUTETYPEANDVALUE_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
typedef struct ossl_crmf_pbmparameter_st OSSL_CRMF_PBMPARAMETER;
|
||||
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PBMPARAMETER)
|
||||
typedef struct ossl_crmf_poposigningkey_st OSSL_CRMF_POPOSIGNINGKEY;
|
||||
@@ -84,12 +124,13 @@ typedef struct ossl_crmf_certrequest_st OSSL_CRMF_CERTREQUEST;
|
||||
typedef struct ossl_crmf_certid_st OSSL_CRMF_CERTID;
|
||||
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_CERTID)
|
||||
DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_CERTID)
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CRMF_CERTID, OSSL_CRMF_CERTID, OSSL_CRMF_CERTID)
|
||||
#define sk_OSSL_CRMF_CERTID_num(sk) OPENSSL_sk_num(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk))
|
||||
#define sk_OSSL_CRMF_CERTID_value(sk, idx) ((OSSL_CRMF_CERTID *)OPENSSL_sk_value(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk), (idx)))
|
||||
#define sk_OSSL_CRMF_CERTID_new(cmp) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_new(ossl_check_OSSL_CRMF_CERTID_compfunc_type(cmp)))
|
||||
#define sk_OSSL_CRMF_CERTID_new_null() ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_new_null())
|
||||
#define sk_OSSL_CRMF_CERTID_new_reserve(cmp, n) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_new_reserve(ossl_check_OSSL_CRMF_CERTID_compfunc_type(cmp), (n)))
|
||||
#define sk_OSSL_CRMF_CERTID_new(cmp) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_OSSL_CRMF_CERTID_compfunc_type(cmp)), sk_OSSL_CRMF_CERTID_cmpfunc_thunk))
|
||||
#define sk_OSSL_CRMF_CERTID_new_null() ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_OSSL_CRMF_CERTID_freefunc_thunk))
|
||||
#define sk_OSSL_CRMF_CERTID_new_reserve(cmp, n) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_OSSL_CRMF_CERTID_compfunc_type(cmp), (n)), sk_OSSL_CRMF_CERTID_cmpfunc_thunk))
|
||||
#define sk_OSSL_CRMF_CERTID_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), (n))
|
||||
#define sk_OSSL_CRMF_CERTID_free(sk) OPENSSL_sk_free(ossl_check_OSSL_CRMF_CERTID_sk_type(sk))
|
||||
#define sk_OSSL_CRMF_CERTID_zero(sk) OPENSSL_sk_zero(ossl_check_OSSL_CRMF_CERTID_sk_type(sk))
|
||||
@@ -111,6 +152,7 @@ SKM_DEFINE_STACK_OF_INTERNAL(OSSL_CRMF_CERTID, OSSL_CRMF_CERTID, OSSL_CRMF_CERTI
|
||||
#define sk_OSSL_CRMF_CERTID_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(OSSL_CRMF_CERTID) *)OPENSSL_sk_deep_copy(ossl_check_const_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_copyfunc_type(copyfunc), ossl_check_OSSL_CRMF_CERTID_freefunc_type(freefunc)))
|
||||
#define sk_OSSL_CRMF_CERTID_set_cmp_func(sk, cmp) ((sk_OSSL_CRMF_CERTID_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_OSSL_CRMF_CERTID_sk_type(sk), ossl_check_OSSL_CRMF_CERTID_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
typedef struct ossl_crmf_pkipublicationinfo_st OSSL_CRMF_PKIPUBLICATIONINFO;
|
||||
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_PKIPUBLICATIONINFO)
|
||||
@@ -118,6 +160,7 @@ typedef struct ossl_crmf_singlepubinfo_st OSSL_CRMF_SINGLEPUBINFO;
|
||||
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_SINGLEPUBINFO)
|
||||
typedef struct ossl_crmf_certtemplate_st OSSL_CRMF_CERTTEMPLATE;
|
||||
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_CERTTEMPLATE)
|
||||
DECLARE_ASN1_DUP_FUNCTION(OSSL_CRMF_CERTTEMPLATE)
|
||||
typedef STACK_OF(OSSL_CRMF_MSG) OSSL_CRMF_MSGS;
|
||||
DECLARE_ASN1_FUNCTIONS(OSSL_CRMF_MSGS)
|
||||
|
||||
@@ -142,8 +185,7 @@ int OSSL_CRMF_MSG_set1_regCtrl_authenticator(OSSL_CRMF_MSG *msg,
|
||||
const ASN1_UTF8STRING *auth);
|
||||
ASN1_UTF8STRING
|
||||
*OSSL_CRMF_MSG_get0_regCtrl_authenticator(const OSSL_CRMF_MSG *msg);
|
||||
int
|
||||
OSSL_CRMF_MSG_PKIPublicationInfo_push0_SinglePubInfo(OSSL_CRMF_PKIPUBLICATIONINFO *pi,
|
||||
int OSSL_CRMF_MSG_PKIPublicationInfo_push0_SinglePubInfo(OSSL_CRMF_PKIPUBLICATIONINFO *pi,
|
||||
OSSL_CRMF_SINGLEPUBINFO *spi);
|
||||
#define OSSL_CRMF_PUB_METHOD_DONTCARE 0
|
||||
#define OSSL_CRMF_PUB_METHOD_X500 1
|
||||
@@ -198,27 +240,37 @@ int OSSL_CRMF_MSGS_verify_popo(const OSSL_CRMF_MSGS *reqs,
|
||||
int rid, int acceptRAVerified,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
OSSL_CRMF_CERTTEMPLATE *OSSL_CRMF_MSG_get0_tmpl(const OSSL_CRMF_MSG *crm);
|
||||
const ASN1_INTEGER
|
||||
*OSSL_CRMF_CERTTEMPLATE_get0_serialNumber(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
||||
const X509_NAME
|
||||
*OSSL_CRMF_CERTTEMPLATE_get0_subject(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
||||
const X509_NAME
|
||||
*OSSL_CRMF_CERTTEMPLATE_get0_issuer(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
||||
X509_PUBKEY
|
||||
*OSSL_CRMF_CERTTEMPLATE_get0_publicKey(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
||||
const X509_NAME *OSSL_CRMF_CERTTEMPLATE_get0_subject(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
||||
const X509_NAME *OSSL_CRMF_CERTTEMPLATE_get0_issuer(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
||||
const ASN1_INTEGER *OSSL_CRMF_CERTTEMPLATE_get0_serialNumber(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
||||
X509_EXTENSIONS
|
||||
*OSSL_CRMF_CERTTEMPLATE_get0_extensions(const OSSL_CRMF_CERTTEMPLATE *tmpl);
|
||||
const X509_NAME
|
||||
*OSSL_CRMF_CERTID_get0_issuer(const OSSL_CRMF_CERTID *cid);
|
||||
const ASN1_INTEGER
|
||||
*OSSL_CRMF_CERTID_get0_serialNumber(const OSSL_CRMF_CERTID *cid);
|
||||
const X509_NAME *OSSL_CRMF_CERTID_get0_issuer(const OSSL_CRMF_CERTID *cid);
|
||||
const ASN1_INTEGER *OSSL_CRMF_CERTID_get0_serialNumber(const OSSL_CRMF_CERTID *cid);
|
||||
int OSSL_CRMF_CERTTEMPLATE_fill(OSSL_CRMF_CERTTEMPLATE *tmpl,
|
||||
EVP_PKEY *pubkey,
|
||||
const X509_NAME *subject,
|
||||
const X509_NAME *issuer,
|
||||
const ASN1_INTEGER *serial);
|
||||
X509
|
||||
*OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert(const OSSL_CRMF_ENCRYPTEDVALUE *ecert,
|
||||
X509 *OSSL_CRMF_ENCRYPTEDVALUE_get1_encCert(const OSSL_CRMF_ENCRYPTEDVALUE *ecert,
|
||||
OSSL_LIB_CTX *libctx, const char *propq,
|
||||
EVP_PKEY *pkey);
|
||||
X509 *OSSL_CRMF_ENCRYPTEDKEY_get1_encCert(const OSSL_CRMF_ENCRYPTEDKEY *ecert,
|
||||
OSSL_LIB_CTX *libctx, const char *propq,
|
||||
EVP_PKEY *pkey, unsigned int flags);
|
||||
unsigned char *OSSL_CRMF_ENCRYPTEDVALUE_decrypt(const OSSL_CRMF_ENCRYPTEDVALUE *enc,
|
||||
OSSL_LIB_CTX *libctx, const char *propq,
|
||||
EVP_PKEY *pkey, int *outlen);
|
||||
EVP_PKEY *OSSL_CRMF_ENCRYPTEDKEY_get1_pkey(const OSSL_CRMF_ENCRYPTEDKEY *encryptedKey,
|
||||
X509_STORE *ts, STACK_OF(X509) *extra, EVP_PKEY *pkey,
|
||||
X509 *cert, ASN1_OCTET_STRING *secret,
|
||||
OSSL_LIB_CTX *libctx, const char *propq);
|
||||
int OSSL_CRMF_MSG_centralkeygen_requested(const OSSL_CRMF_MSG *crm, const X509_REQ *p10);
|
||||
#ifndef OPENSSL_NO_CMS
|
||||
OSSL_CRMF_ENCRYPTEDKEY *OSSL_CRMF_ENCRYPTEDKEY_init_envdata(CMS_EnvelopedData *envdata);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef OPENSSL_CRMFERR_H
|
||||
#define OPENSSL_CRMFERR_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/symhacks.h>
|
||||
#include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
#ifndef OPENSSL_NO_CRMF
|
||||
|
||||
/*
|
||||
* CRMF reason codes.
|
||||
*/
|
||||
#define CRMF_R_BAD_PBM_ITERATIONCOUNT 100
|
||||
#define CRMF_R_CMS_NOT_SUPPORTED 122
|
||||
#define CRMF_R_CRMFERROR 102
|
||||
#define CRMF_R_ERROR 103
|
||||
#define CRMF_R_ERROR_DECODING_CERTIFICATE 104
|
||||
#define CRMF_R_ERROR_DECODING_ENCRYPTEDKEY 123
|
||||
#define CRMF_R_ERROR_DECRYPTING_CERTIFICATE 105
|
||||
#define CRMF_R_ERROR_DECRYPTING_ENCRYPTEDKEY 124
|
||||
#define CRMF_R_ERROR_DECRYPTING_ENCRYPTEDVALUE 125
|
||||
#define CRMF_R_ERROR_DECRYPTING_SYMMETRIC_KEY 106
|
||||
#define CRMF_R_ERROR_SETTING_PURPOSE 126
|
||||
#define CRMF_R_ERROR_SIGNING_POPO 129
|
||||
#define CRMF_R_ERROR_VERIFYING_ENCRYPTEDKEY 127
|
||||
#define CRMF_R_FAILURE_OBTAINING_RANDOM 107
|
||||
#define CRMF_R_ITERATIONCOUNT_BELOW_100 108
|
||||
#define CRMF_R_MALFORMED_IV 101
|
||||
#define CRMF_R_NULL_ARGUMENT 109
|
||||
#define CRMF_R_POPOSKINPUT_NOT_SUPPORTED 113
|
||||
#define CRMF_R_POPO_INCONSISTENT_CENTRAL_KEYGEN 128
|
||||
#define CRMF_R_POPO_INCONSISTENT_PUBLIC_KEY 117
|
||||
#define CRMF_R_POPO_MISSING 121
|
||||
#define CRMF_R_POPO_MISSING_PUBLIC_KEY 118
|
||||
#define CRMF_R_POPO_MISSING_SUBJECT 119
|
||||
#define CRMF_R_POPO_RAVERIFIED_NOT_ACCEPTED 120
|
||||
#define CRMF_R_SETTING_MAC_ALGOR_FAILURE 110
|
||||
#define CRMF_R_SETTING_OWF_ALGOR_FAILURE 111
|
||||
#define CRMF_R_UNSUPPORTED_ALGORITHM 112
|
||||
#define CRMF_R_UNSUPPORTED_CIPHER 114
|
||||
#define CRMF_R_UNSUPPORTED_METHOD_FOR_CREATING_POPO 115
|
||||
#define CRMF_R_UNSUPPORTED_POPO_METHOD 116
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,15 +1,28 @@
|
||||
/*
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/crypto.h.in
|
||||
*
|
||||
* Copyright 1995-2026 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CRYPTO_H
|
||||
/* clang-format off */
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#ifndef OPENSSL_CRYPTO_H
|
||||
#define OPENSSL_CRYPTO_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_CRYPTO_H
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
@@ -22,9 +35,10 @@
|
||||
|
||||
#include <openssl/safestack.h>
|
||||
#include <openssl/opensslv.h>
|
||||
# include <openssl/ossl_typ.h>
|
||||
#include <openssl/types.h>
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/cryptoerr.h>
|
||||
#include <openssl/core.h>
|
||||
|
||||
#ifdef CHARSET_EBCDIC
|
||||
#include <openssl/ebcdic.h>
|
||||
@@ -36,7 +50,7 @@
|
||||
*/
|
||||
#include <openssl/symhacks.h>
|
||||
|
||||
# if OPENSSL_API_COMPAT < 0x10100000L
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
#include <openssl/opensslv.h>
|
||||
#endif
|
||||
|
||||
@@ -44,7 +58,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
# if OPENSSL_API_COMPAT < 0x10100000L
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
#define SSLeay OpenSSL_version_num
|
||||
#define SSLeay_version OpenSSL_version
|
||||
#define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER
|
||||
@@ -62,31 +76,174 @@ typedef struct {
|
||||
int dummy;
|
||||
} CRYPTO_dynlock;
|
||||
|
||||
# endif /* OPENSSL_API_COMPAT */
|
||||
#endif /* OPENSSL_NO_DEPRECATED_1_1_0 */
|
||||
|
||||
typedef void CRYPTO_RWLOCK;
|
||||
|
||||
CRYPTO_RWLOCK *CRYPTO_THREAD_lock_new(void);
|
||||
int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock);
|
||||
int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock);
|
||||
__owur int CRYPTO_THREAD_read_lock(CRYPTO_RWLOCK *lock);
|
||||
__owur int CRYPTO_THREAD_write_lock(CRYPTO_RWLOCK *lock);
|
||||
int CRYPTO_THREAD_unlock(CRYPTO_RWLOCK *lock);
|
||||
void CRYPTO_THREAD_lock_free(CRYPTO_RWLOCK *lock);
|
||||
|
||||
int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock);
|
||||
int CRYPTO_atomic_add64(uint64_t *val, uint64_t op, uint64_t *ret,
|
||||
CRYPTO_RWLOCK *lock);
|
||||
int CRYPTO_atomic_and(uint64_t *val, uint64_t op, uint64_t *ret,
|
||||
CRYPTO_RWLOCK *lock);
|
||||
int CRYPTO_atomic_or(uint64_t *val, uint64_t op, uint64_t *ret,
|
||||
CRYPTO_RWLOCK *lock);
|
||||
int CRYPTO_atomic_load(uint64_t *val, uint64_t *ret, CRYPTO_RWLOCK *lock);
|
||||
int CRYPTO_atomic_load_int(int *val, int *ret, CRYPTO_RWLOCK *lock);
|
||||
int CRYPTO_atomic_store(uint64_t *dst, uint64_t val, CRYPTO_RWLOCK *lock);
|
||||
int CRYPTO_atomic_store_int(int *dst, int val, CRYPTO_RWLOCK *lock);
|
||||
|
||||
/* No longer needed, so this is a no-op */
|
||||
#define OPENSSL_malloc_init() \
|
||||
while (0) \
|
||||
continue
|
||||
|
||||
#define OPENSSL_malloc(num) \
|
||||
CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_zalloc(num) \
|
||||
CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_malloc_array(num, size) \
|
||||
CRYPTO_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_calloc(num, size) \
|
||||
CRYPTO_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_aligned_alloc(num, alignment, freeptr) \
|
||||
CRYPTO_aligned_alloc(num, alignment, freeptr, \
|
||||
OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_aligned_alloc_array(num, size, alignment, freeptr) \
|
||||
CRYPTO_aligned_alloc_array(num, size, alignment, freeptr, \
|
||||
OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_realloc(addr, num) \
|
||||
CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_clear_realloc(addr, old_num, num) \
|
||||
CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_realloc_array(addr, num, size) \
|
||||
CRYPTO_realloc_array(addr, num, size, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_clear_realloc_array(addr, old_num, num, size) \
|
||||
CRYPTO_clear_realloc_array(addr, old_num, num, size, \
|
||||
OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_clear_free(addr, num) \
|
||||
CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_free(addr) \
|
||||
CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_memdup(str, s) \
|
||||
CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_strdup(str) \
|
||||
CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_strndup(str, n) \
|
||||
CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_secure_malloc(num) \
|
||||
CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_secure_zalloc(num) \
|
||||
CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_secure_malloc_array(num, size) \
|
||||
CRYPTO_secure_malloc_array(num, size, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_secure_calloc(num, size) \
|
||||
CRYPTO_secure_calloc(num, size, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_secure_free(addr) \
|
||||
CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_secure_clear_free(addr, num) \
|
||||
CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_secure_actual_size(ptr) \
|
||||
CRYPTO_secure_actual_size(ptr)
|
||||
|
||||
size_t OPENSSL_strlcpy(char *dst, const char *src, size_t siz);
|
||||
size_t OPENSSL_strlcat(char *dst, const char *src, size_t siz);
|
||||
size_t OPENSSL_strnlen(const char *str, size_t maxlen);
|
||||
int OPENSSL_strtoul(const char *str, char **endptr, int base, unsigned long *num);
|
||||
int OPENSSL_buf2hexstr_ex(char *str, size_t str_n, size_t *strlength,
|
||||
const unsigned char *buf, size_t buflen,
|
||||
const char sep);
|
||||
char *OPENSSL_buf2hexstr(const unsigned char *buf, long buflen);
|
||||
int OPENSSL_hexstr2buf_ex(unsigned char *buf, size_t buf_n, size_t *buflen,
|
||||
const char *str, const char sep);
|
||||
unsigned char *OPENSSL_hexstr2buf(const char *str, long *buflen);
|
||||
int OPENSSL_hexchar2int(unsigned char c);
|
||||
int OPENSSL_strcasecmp(const char *s1, const char *s2);
|
||||
int OPENSSL_strncasecmp(const char *s1, const char *s2, size_t n);
|
||||
|
||||
#define OPENSSL_MALLOC_MAX_NELEMS(type) (((1U << (sizeof(int) * 8 - 1)) - 1) / sizeof(type))
|
||||
|
||||
/*
|
||||
* The following can be used to detect memory leaks in the library. If
|
||||
* used, it turns on malloc checking
|
||||
* These functions return the values of OPENSSL_VERSION_MAJOR,
|
||||
* OPENSSL_VERSION_MINOR, OPENSSL_VERSION_PATCH, OPENSSL_VERSION_PRE_RELEASE
|
||||
* and OPENSSL_VERSION_BUILD_METADATA, respectively.
|
||||
*/
|
||||
# define CRYPTO_MEM_CHECK_OFF 0x0 /* Control only */
|
||||
# define CRYPTO_MEM_CHECK_ON 0x1 /* Control and mode bit */
|
||||
# define CRYPTO_MEM_CHECK_ENABLE 0x2 /* Control and mode bit */
|
||||
# define CRYPTO_MEM_CHECK_DISABLE 0x3 /* Control only */
|
||||
unsigned int OPENSSL_version_major(void);
|
||||
unsigned int OPENSSL_version_minor(void);
|
||||
unsigned int OPENSSL_version_patch(void);
|
||||
const char *OPENSSL_version_pre_release(void);
|
||||
const char *OPENSSL_version_build_metadata(void);
|
||||
|
||||
unsigned long OpenSSL_version_num(void);
|
||||
const char *OpenSSL_version(int type);
|
||||
#define OPENSSL_VERSION 0
|
||||
#define OPENSSL_CFLAGS 1
|
||||
#define OPENSSL_BUILT_ON 2
|
||||
#define OPENSSL_PLATFORM 3
|
||||
#define OPENSSL_DIR 4
|
||||
#define OPENSSL_ENGINES_DIR 5
|
||||
#define OPENSSL_VERSION_STRING 6
|
||||
#define OPENSSL_FULL_VERSION_STRING 7
|
||||
#define OPENSSL_MODULES_DIR 8
|
||||
#define OPENSSL_CPU_INFO 9
|
||||
#define OPENSSL_WINCTX 10
|
||||
|
||||
const char *OPENSSL_info(int type);
|
||||
/*
|
||||
* The series starts at 1001 to avoid confusion with the OpenSSL_version
|
||||
* types.
|
||||
*/
|
||||
#define OPENSSL_INFO_CONFIG_DIR 1001
|
||||
#define OPENSSL_INFO_ENGINES_DIR 1002
|
||||
#define OPENSSL_INFO_MODULES_DIR 1003
|
||||
#define OPENSSL_INFO_DSO_EXTENSION 1004
|
||||
#define OPENSSL_INFO_DIR_FILENAME_SEPARATOR 1005
|
||||
#define OPENSSL_INFO_LIST_SEPARATOR 1006
|
||||
#define OPENSSL_INFO_SEED_SOURCE 1007
|
||||
#define OPENSSL_INFO_CPU_SETTINGS 1008
|
||||
#define OPENSSL_INFO_WINDOWS_CONTEXT 1009
|
||||
|
||||
int OPENSSL_issetugid(void);
|
||||
|
||||
struct crypto_ex_data_st {
|
||||
OSSL_LIB_CTX *ctx;
|
||||
STACK_OF(void) *sk;
|
||||
};
|
||||
DEFINE_STACK_OF(void)
|
||||
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(void, void, void)
|
||||
#define sk_void_num(sk) OPENSSL_sk_num(ossl_check_const_void_sk_type(sk))
|
||||
#define sk_void_value(sk, idx) ((void *)OPENSSL_sk_value(ossl_check_const_void_sk_type(sk), (idx)))
|
||||
#define sk_void_new(cmp) ((STACK_OF(void) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_void_compfunc_type(cmp)), sk_void_cmpfunc_thunk))
|
||||
#define sk_void_new_null() ((STACK_OF(void) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_void_freefunc_thunk))
|
||||
#define sk_void_new_reserve(cmp, n) ((STACK_OF(void) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_void_compfunc_type(cmp), (n)), sk_void_cmpfunc_thunk))
|
||||
#define sk_void_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_void_sk_type(sk), (n))
|
||||
#define sk_void_free(sk) OPENSSL_sk_free(ossl_check_void_sk_type(sk))
|
||||
#define sk_void_zero(sk) OPENSSL_sk_zero(ossl_check_void_sk_type(sk))
|
||||
#define sk_void_delete(sk, i) ((void *)OPENSSL_sk_delete(ossl_check_void_sk_type(sk), (i)))
|
||||
#define sk_void_delete_ptr(sk, ptr) ((void *)OPENSSL_sk_delete_ptr(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr)))
|
||||
#define sk_void_push(sk, ptr) OPENSSL_sk_push(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
|
||||
#define sk_void_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
|
||||
#define sk_void_pop(sk) ((void *)OPENSSL_sk_pop(ossl_check_void_sk_type(sk)))
|
||||
#define sk_void_shift(sk) ((void *)OPENSSL_sk_shift(ossl_check_void_sk_type(sk)))
|
||||
#define sk_void_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_void_sk_type(sk), ossl_check_void_freefunc_type(freefunc))
|
||||
#define sk_void_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr), (idx))
|
||||
#define sk_void_set(sk, idx, ptr) ((void *)OPENSSL_sk_set(ossl_check_void_sk_type(sk), (idx), ossl_check_void_type(ptr)))
|
||||
#define sk_void_find(sk, ptr) OPENSSL_sk_find(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
|
||||
#define sk_void_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr))
|
||||
#define sk_void_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_void_sk_type(sk), ossl_check_void_type(ptr), pnum)
|
||||
#define sk_void_sort(sk) OPENSSL_sk_sort(ossl_check_void_sk_type(sk))
|
||||
#define sk_void_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_void_sk_type(sk))
|
||||
#define sk_void_dup(sk) ((STACK_OF(void) *)OPENSSL_sk_dup(ossl_check_const_void_sk_type(sk)))
|
||||
#define sk_void_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(void) *)OPENSSL_sk_deep_copy(ossl_check_const_void_sk_type(sk), ossl_check_void_copyfunc_type(copyfunc), ossl_check_void_freefunc_type(freefunc)))
|
||||
#define sk_void_set_cmp_func(sk, cmp) ((sk_void_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_void_sk_type(sk), ossl_check_void_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
/*
|
||||
* Per class, we have a STACK of function pointers.
|
||||
@@ -106,71 +263,21 @@ DEFINE_STACK_OF(void)
|
||||
#define CRYPTO_EX_INDEX_BIO 12
|
||||
#define CRYPTO_EX_INDEX_APP 13
|
||||
#define CRYPTO_EX_INDEX_UI_METHOD 14
|
||||
# define CRYPTO_EX_INDEX_DRBG 15
|
||||
# define CRYPTO_EX_INDEX__COUNT 16
|
||||
|
||||
/* No longer needed, so this is a no-op */
|
||||
#define OPENSSL_malloc_init() while(0) continue
|
||||
|
||||
int CRYPTO_mem_ctrl(int mode);
|
||||
|
||||
# define OPENSSL_malloc(num) \
|
||||
CRYPTO_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_zalloc(num) \
|
||||
CRYPTO_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_realloc(addr, num) \
|
||||
CRYPTO_realloc(addr, num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_clear_realloc(addr, old_num, num) \
|
||||
CRYPTO_clear_realloc(addr, old_num, num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_clear_free(addr, num) \
|
||||
CRYPTO_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_free(addr) \
|
||||
CRYPTO_free(addr, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_memdup(str, s) \
|
||||
CRYPTO_memdup((str), s, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_strdup(str) \
|
||||
CRYPTO_strdup(str, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_strndup(str, n) \
|
||||
CRYPTO_strndup(str, n, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_secure_malloc(num) \
|
||||
CRYPTO_secure_malloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_secure_zalloc(num) \
|
||||
CRYPTO_secure_zalloc(num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_secure_free(addr) \
|
||||
CRYPTO_secure_free(addr, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_secure_clear_free(addr, num) \
|
||||
CRYPTO_secure_clear_free(addr, num, OPENSSL_FILE, OPENSSL_LINE)
|
||||
# define OPENSSL_secure_actual_size(ptr) \
|
||||
CRYPTO_secure_actual_size(ptr)
|
||||
|
||||
size_t OPENSSL_strlcpy(char *dst, const char *src, size_t siz);
|
||||
size_t OPENSSL_strlcat(char *dst, const char *src, size_t siz);
|
||||
size_t OPENSSL_strnlen(const char *str, size_t maxlen);
|
||||
char *OPENSSL_buf2hexstr(const unsigned char *buffer, long len);
|
||||
unsigned char *OPENSSL_hexstr2buf(const char *str, long *len);
|
||||
int OPENSSL_hexchar2int(unsigned char c);
|
||||
|
||||
# define OPENSSL_MALLOC_MAX_NELEMS(type) (((1U<<(sizeof(int)*8-1))-1)/sizeof(type))
|
||||
|
||||
unsigned long OpenSSL_version_num(void);
|
||||
const char *OpenSSL_version(int type);
|
||||
# define OPENSSL_VERSION 0
|
||||
# define OPENSSL_CFLAGS 1
|
||||
# define OPENSSL_BUILT_ON 2
|
||||
# define OPENSSL_PLATFORM 3
|
||||
# define OPENSSL_DIR 4
|
||||
# define OPENSSL_ENGINES_DIR 5
|
||||
|
||||
int OPENSSL_issetugid(void);
|
||||
#define CRYPTO_EX_INDEX_RAND_DRBG 15
|
||||
#define CRYPTO_EX_INDEX_DRBG CRYPTO_EX_INDEX_RAND_DRBG
|
||||
#define CRYPTO_EX_INDEX_OSSL_LIB_CTX 16
|
||||
#define CRYPTO_EX_INDEX_EVP_PKEY 17
|
||||
#define CRYPTO_EX_INDEX__COUNT 18
|
||||
|
||||
typedef void CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
|
||||
int idx, long argl, void *argp);
|
||||
typedef void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad,
|
||||
int idx, long argl, void *argp);
|
||||
typedef int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, const CRYPTO_EX_DATA *from,
|
||||
void *from_d, int idx, long argl, void *argp);
|
||||
void **from_d, int idx, long argl, void *argp);
|
||||
__owur int CRYPTO_get_ex_new_index(int class_index, long argl, void *argp,
|
||||
CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func,
|
||||
CRYPTO_EX_new *new_func,
|
||||
CRYPTO_EX_dup *dup_func,
|
||||
CRYPTO_EX_free *free_func);
|
||||
/* No longer use an index. */
|
||||
int CRYPTO_free_ex_index(int class_index, int idx);
|
||||
@@ -185,6 +292,10 @@ int CRYPTO_dup_ex_data(int class_index, CRYPTO_EX_DATA *to,
|
||||
|
||||
void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
|
||||
|
||||
/* Allocate a single item in the CRYPTO_EX_DATA variable */
|
||||
int CRYPTO_alloc_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad,
|
||||
int idx);
|
||||
|
||||
/*
|
||||
* Get/set data in a CRYPTO_EX_DATA variable corresponding to a particular
|
||||
* index (relative to the class type involved)
|
||||
@@ -192,12 +303,14 @@ void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
|
||||
int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val);
|
||||
void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx);
|
||||
|
||||
# if OPENSSL_API_COMPAT < 0x10100000L
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
/*
|
||||
* This function cleans up all "ex_data" state. It mustn't be called under
|
||||
* potential race-conditions.
|
||||
*/
|
||||
# define CRYPTO_cleanup_all_ex_data() while(0) continue
|
||||
#define CRYPTO_cleanup_all_ex_data() \
|
||||
while (0) \
|
||||
continue
|
||||
|
||||
/*
|
||||
* The old locking functions have been removed completely without compatibility
|
||||
@@ -239,11 +352,11 @@ typedef struct crypto_threadid_st {
|
||||
#define CRYPTO_THREADID_cpy(dest, src)
|
||||
#define CRYPTO_THREADID_hash(id) (0UL)
|
||||
|
||||
# if OPENSSL_API_COMPAT < 0x10000000L
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_0_0
|
||||
#define CRYPTO_set_id_callback(func)
|
||||
#define CRYPTO_get_id_callback() (NULL)
|
||||
#define CRYPTO_thread_id() (0UL)
|
||||
# endif /* OPENSSL_API_COMPAT < 0x10000000L */
|
||||
#endif /* OPENSSL_NO_DEPRECATED_1_0_0 */
|
||||
|
||||
#define CRYPTO_set_dynlock_create_callback(dyn_create_function)
|
||||
#define CRYPTO_set_dynlock_lock_callback(dyn_lock_function)
|
||||
@@ -251,20 +364,31 @@ typedef struct crypto_threadid_st {
|
||||
#define CRYPTO_get_dynlock_create_callback() (NULL)
|
||||
#define CRYPTO_get_dynlock_lock_callback() (NULL)
|
||||
#define CRYPTO_get_dynlock_destroy_callback() (NULL)
|
||||
# endif /* OPENSSL_API_COMPAT < 0x10100000L */
|
||||
#endif /* OPENSSL_NO_DEPRECATED_1_1_0 */
|
||||
|
||||
int CRYPTO_set_mem_functions(
|
||||
void *(*m) (size_t, const char *, int),
|
||||
void *(*r) (void *, size_t, const char *, int),
|
||||
void (*f) (void *, const char *, int));
|
||||
int CRYPTO_set_mem_debug(int flag);
|
||||
void CRYPTO_get_mem_functions(
|
||||
void *(**m) (size_t, const char *, int),
|
||||
void *(**r) (void *, size_t, const char *, int),
|
||||
void (**f) (void *, const char *, int));
|
||||
typedef void *(*CRYPTO_malloc_fn)(size_t num, const char *file, int line);
|
||||
typedef void *(*CRYPTO_realloc_fn)(void *addr, size_t num, const char *file,
|
||||
int line);
|
||||
typedef void (*CRYPTO_free_fn)(void *addr, const char *file, int line);
|
||||
int CRYPTO_set_mem_functions(CRYPTO_malloc_fn malloc_fn,
|
||||
CRYPTO_realloc_fn realloc_fn,
|
||||
CRYPTO_free_fn free_fn);
|
||||
void CRYPTO_get_mem_functions(CRYPTO_malloc_fn *malloc_fn,
|
||||
CRYPTO_realloc_fn *realloc_fn,
|
||||
CRYPTO_free_fn *free_fn);
|
||||
|
||||
void *CRYPTO_malloc(size_t num, const char *file, int line);
|
||||
void *CRYPTO_zalloc(size_t num, const char *file, int line);
|
||||
OSSL_CRYPTO_ALLOC void *CRYPTO_malloc(size_t num, const char *file, int line);
|
||||
OSSL_CRYPTO_ALLOC void *CRYPTO_zalloc(size_t num, const char *file, int line);
|
||||
OSSL_CRYPTO_ALLOC void *CRYPTO_malloc_array(size_t num, size_t size,
|
||||
const char *file, int line);
|
||||
OSSL_CRYPTO_ALLOC void *CRYPTO_calloc(size_t num, size_t size,
|
||||
const char *file, int line);
|
||||
OSSL_CRYPTO_ALLOC void *CRYPTO_aligned_alloc(size_t num, size_t align,
|
||||
void **freeptr, const char *file,
|
||||
int line);
|
||||
OSSL_CRYPTO_ALLOC void *CRYPTO_aligned_alloc_array(size_t num, size_t size,
|
||||
size_t align, void **freeptr,
|
||||
const char *file, int line);
|
||||
void *CRYPTO_memdup(const void *str, size_t siz, const char *file, int line);
|
||||
char *CRYPTO_strdup(const char *str, const char *file, int line);
|
||||
char *CRYPTO_strndup(const char *str, size_t s, const char *file, int line);
|
||||
@@ -273,11 +397,19 @@ void CRYPTO_clear_free(void *ptr, size_t num, const char *file, int line);
|
||||
void *CRYPTO_realloc(void *addr, size_t num, const char *file, int line);
|
||||
void *CRYPTO_clear_realloc(void *addr, size_t old_num, size_t num,
|
||||
const char *file, int line);
|
||||
void *CRYPTO_realloc_array(void *addr, size_t num, size_t size,
|
||||
const char *file, int line);
|
||||
void *CRYPTO_clear_realloc_array(void *addr, size_t old_num, size_t num,
|
||||
size_t size, const char *file, int line);
|
||||
|
||||
int CRYPTO_secure_malloc_init(size_t sz, int minsize);
|
||||
int CRYPTO_secure_malloc_init(size_t sz, size_t minsize);
|
||||
int CRYPTO_secure_malloc_done(void);
|
||||
void *CRYPTO_secure_malloc(size_t num, const char *file, int line);
|
||||
void *CRYPTO_secure_zalloc(size_t num, const char *file, int line);
|
||||
OSSL_CRYPTO_ALLOC void *CRYPTO_secure_malloc(size_t num, const char *file, int line);
|
||||
OSSL_CRYPTO_ALLOC void *CRYPTO_secure_zalloc(size_t num, const char *file, int line);
|
||||
OSSL_CRYPTO_ALLOC void *CRYPTO_secure_malloc_array(size_t num, size_t size,
|
||||
const char *file, int line);
|
||||
OSSL_CRYPTO_ALLOC void *CRYPTO_secure_calloc(size_t num, size_t size,
|
||||
const char *file, int line);
|
||||
void CRYPTO_secure_free(void *ptr, const char *file, int line);
|
||||
void CRYPTO_secure_clear_free(void *ptr, size_t num,
|
||||
const char *file, int line);
|
||||
@@ -289,38 +421,56 @@ size_t CRYPTO_secure_used(void);
|
||||
void OPENSSL_cleanse(void *ptr, size_t len);
|
||||
|
||||
#ifndef OPENSSL_NO_CRYPTO_MDEBUG
|
||||
/*
|
||||
* The following can be used to detect memory leaks in the library. If
|
||||
* used, it turns on malloc checking
|
||||
*/
|
||||
#define CRYPTO_MEM_CHECK_OFF 0x0 /* Control only */
|
||||
#define CRYPTO_MEM_CHECK_ON 0x1 /* Control and mode bit */
|
||||
#define CRYPTO_MEM_CHECK_ENABLE 0x2 /* Control and mode bit */
|
||||
#define CRYPTO_MEM_CHECK_DISABLE 0x3 /* Control only */
|
||||
|
||||
/* max allowed length for value of OPENSSL_MALLOC_FAILURES env var. */
|
||||
#define CRYPTO_MEM_CHECK_MAX_FS 256
|
||||
|
||||
void CRYPTO_get_alloc_counts(int *mcount, int *rcount, int *fcount);
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define OPENSSL_mem_debug_push(info) \
|
||||
CRYPTO_mem_debug_push(info, OPENSSL_FILE, OPENSSL_LINE)
|
||||
#define OPENSSL_mem_debug_pop() \
|
||||
CRYPTO_mem_debug_pop()
|
||||
int CRYPTO_mem_debug_push(const char *info, const char *file, int line);
|
||||
int CRYPTO_mem_debug_pop(void);
|
||||
void CRYPTO_get_alloc_counts(int *mcount, int *rcount, int *fcount);
|
||||
|
||||
/*-
|
||||
* Debugging functions (enabled by CRYPTO_set_mem_debug(1))
|
||||
* The flag argument has the following significance:
|
||||
* 0: called before the actual memory allocation has taken place
|
||||
* 1: called after the actual memory allocation has taken place
|
||||
*/
|
||||
void CRYPTO_mem_debug_malloc(void *addr, size_t num, int flag,
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int CRYPTO_set_mem_debug(int flag);
|
||||
OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_ctrl(int mode);
|
||||
OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_debug_push(const char *info,
|
||||
const char *file, int line);
|
||||
void CRYPTO_mem_debug_realloc(void *addr1, void *addr2, size_t num, int flag,
|
||||
OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_debug_pop(void);
|
||||
OSSL_DEPRECATEDIN_3_0 void CRYPTO_mem_debug_malloc(void *addr, size_t num,
|
||||
int flag,
|
||||
const char *file, int line);
|
||||
void CRYPTO_mem_debug_free(void *addr, int flag,
|
||||
OSSL_DEPRECATEDIN_3_0 void CRYPTO_mem_debug_realloc(void *addr1, void *addr2,
|
||||
size_t num, int flag,
|
||||
const char *file, int line);
|
||||
|
||||
OSSL_DEPRECATEDIN_3_0 void CRYPTO_mem_debug_free(void *addr, int flag,
|
||||
const char *file, int line);
|
||||
OSSL_DEPRECATEDIN_3_0
|
||||
int CRYPTO_mem_leaks_cb(int (*cb)(const char *str, size_t len, void *u),
|
||||
void *u);
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_STDIO
|
||||
int CRYPTO_mem_leaks_fp(FILE *);
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_leaks_fp(FILE *);
|
||||
#endif
|
||||
int CRYPTO_mem_leaks(BIO *bio);
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 int CRYPTO_mem_leaks(BIO *bio);
|
||||
#endif
|
||||
#endif /* OPENSSL_NO_CRYPTO_MDEBUG */
|
||||
|
||||
/* die if we have to */
|
||||
ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line);
|
||||
# if OPENSSL_API_COMPAT < 0x10100000L
|
||||
#ifndef OPENSSL_NO_DEPRECATED_1_1_0
|
||||
#define OpenSSLDie(f, l, a) OPENSSL_die((a), (f), (l))
|
||||
#endif
|
||||
#define OPENSSL_assert(e) \
|
||||
@@ -328,14 +478,13 @@ ossl_noreturn void OPENSSL_die(const char *assertion, const char *file, int line
|
||||
|
||||
int OPENSSL_isservice(void);
|
||||
|
||||
int FIPS_mode(void);
|
||||
int FIPS_mode_set(int r);
|
||||
|
||||
void OPENSSL_init(void);
|
||||
#ifdef OPENSSL_SYS_UNIX
|
||||
void OPENSSL_fork_prepare(void);
|
||||
void OPENSSL_fork_parent(void);
|
||||
void OPENSSL_fork_child(void);
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
OSSL_DEPRECATEDIN_3_0 void OPENSSL_fork_prepare(void);
|
||||
OSSL_DEPRECATEDIN_3_0 void OPENSSL_fork_parent(void);
|
||||
OSSL_DEPRECATEDIN_3_0 void OPENSSL_fork_child(void);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result);
|
||||
@@ -362,32 +511,37 @@ int CRYPTO_memcmp(const void * in_a, const void * in_b, size_t len);
|
||||
#define OPENSSL_INIT_LOAD_CONFIG 0x00000040L
|
||||
#define OPENSSL_INIT_NO_LOAD_CONFIG 0x00000080L
|
||||
#define OPENSSL_INIT_ASYNC 0x00000100L
|
||||
# define OPENSSL_INIT_ENGINE_RDRAND 0x00000200L
|
||||
# define OPENSSL_INIT_ENGINE_DYNAMIC 0x00000400L
|
||||
# define OPENSSL_INIT_ENGINE_OPENSSL 0x00000800L
|
||||
# define OPENSSL_INIT_ENGINE_CRYPTODEV 0x00001000L
|
||||
# define OPENSSL_INIT_ENGINE_CAPI 0x00002000L
|
||||
# define OPENSSL_INIT_ENGINE_PADLOCK 0x00004000L
|
||||
# define OPENSSL_INIT_ENGINE_AFALG 0x00008000L
|
||||
/* OPENSSL_INIT_ZLIB 0x00010000L */
|
||||
/* FREE: 0x00010000L */
|
||||
#define OPENSSL_INIT_ATFORK 0x00020000L
|
||||
/* OPENSSL_INIT_BASE_ONLY 0x00040000L */
|
||||
#define OPENSSL_INIT_NO_ATEXIT 0x00080000L
|
||||
/* OPENSSL_INIT flag range 0xfff00000 reserved for OPENSSL_init_ssl() */
|
||||
/* OPENSSL_INIT flag range 0x03f00000 reserved for OPENSSL_init_ssl() */
|
||||
/* FREE: 0x04000000L */
|
||||
/* FREE: 0x08000000L */
|
||||
/* FREE: 0x10000000L */
|
||||
/* FREE: 0x20000000L */
|
||||
/* FREE: 0x40000000L */
|
||||
/* FREE: 0x80000000L */
|
||||
/* Max OPENSSL_INIT flag value is 0x80000000 */
|
||||
|
||||
/* openssl and dasync not counted as builtin */
|
||||
# define OPENSSL_INIT_ENGINE_ALL_BUILTIN \
|
||||
(OPENSSL_INIT_ENGINE_RDRAND | OPENSSL_INIT_ENGINE_DYNAMIC \
|
||||
| OPENSSL_INIT_ENGINE_CRYPTODEV | OPENSSL_INIT_ENGINE_CAPI | \
|
||||
OPENSSL_INIT_ENGINE_PADLOCK)
|
||||
/* ENGINEs are no longer available */
|
||||
#define OPENSSL_INIT_ENGINE_ALL_BUILTIN 0
|
||||
|
||||
#ifdef OPENSSL_ENGINE_STUBS
|
||||
#define OPENSSL_INIT_ENGINE_RDRAND 0
|
||||
#define OPENSSL_INIT_ENGINE_DYNAMIC 0
|
||||
#define OPENSSL_INIT_ENGINE_OPENSSL 0
|
||||
#define OPENSSL_INIT_ENGINE_CRYPTODEV 0
|
||||
#define OPENSSL_INIT_ENGINE_CAPI 0
|
||||
#define OPENSSL_INIT_ENGINE_PADLOCK 0
|
||||
#define OPENSSL_INIT_ENGINE_AFALG 0
|
||||
#endif
|
||||
|
||||
/* Library initialisation functions */
|
||||
void OPENSSL_cleanup(void);
|
||||
int OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
|
||||
int OPENSSL_atexit(void (*handler)(void));
|
||||
void OPENSSL_thread_stop(void);
|
||||
void OPENSSL_thread_stop_ex(OSSL_LIB_CTX *ctx);
|
||||
|
||||
/* Low-level control of initialization */
|
||||
OPENSSL_INIT_SETTINGS *OPENSSL_INIT_new(void);
|
||||
@@ -412,7 +566,13 @@ typedef LONG CRYPTO_ONCE;
|
||||
#define CRYPTO_ONCE_STATIC_INIT 0
|
||||
#endif
|
||||
#else
|
||||
#if defined(__TANDEM) && defined(_SPT_MODEL_)
|
||||
#define SPT_THREAD_SIGNAL 1
|
||||
#define SPT_THREAD_AWARE 1
|
||||
#include <spthread.h>
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
typedef pthread_once_t CRYPTO_ONCE;
|
||||
typedef pthread_key_t CRYPTO_THREAD_LOCAL;
|
||||
typedef pthread_t CRYPTO_THREAD_ID;
|
||||
@@ -438,6 +598,21 @@ int CRYPTO_THREAD_cleanup_local(CRYPTO_THREAD_LOCAL *key);
|
||||
CRYPTO_THREAD_ID CRYPTO_THREAD_get_current_id(void);
|
||||
int CRYPTO_THREAD_compare_id(CRYPTO_THREAD_ID a, CRYPTO_THREAD_ID b);
|
||||
|
||||
OSSL_LIB_CTX *OSSL_LIB_CTX_new(void);
|
||||
OSSL_LIB_CTX *OSSL_LIB_CTX_new_from_dispatch(const OSSL_CORE_HANDLE *handle,
|
||||
const OSSL_DISPATCH *in);
|
||||
OSSL_LIB_CTX *OSSL_LIB_CTX_new_child(const OSSL_CORE_HANDLE *handle,
|
||||
const OSSL_DISPATCH *in);
|
||||
int OSSL_LIB_CTX_load_config(OSSL_LIB_CTX *ctx, const char *config_file);
|
||||
void OSSL_LIB_CTX_free(OSSL_LIB_CTX *);
|
||||
OSSL_LIB_CTX *OSSL_LIB_CTX_get0_global_default(void);
|
||||
OSSL_LIB_CTX *OSSL_LIB_CTX_set0_default(OSSL_LIB_CTX *libctx);
|
||||
int OSSL_LIB_CTX_get_conf_diagnostics(OSSL_LIB_CTX *ctx);
|
||||
void OSSL_LIB_CTX_set_conf_diagnostics(OSSL_LIB_CTX *ctx, int value);
|
||||
|
||||
void OSSL_sleep(uint64_t millis);
|
||||
|
||||
void *OSSL_LIB_CTX_get_data(OSSL_LIB_CTX *ctx, int index);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -1,57 +1,54 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2024 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CRYPTOERR_H
|
||||
# define HEADER_CRYPTOERR_H
|
||||
#ifndef OPENSSL_CRYPTOERR_H
|
||||
#define OPENSSL_CRYPTOERR_H
|
||||
#pragma once
|
||||
|
||||
# ifndef HEADER_SYMHACKS_H
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/symhacks.h>
|
||||
# endif
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
int ERR_load_CRYPTO_strings(void);
|
||||
|
||||
/*
|
||||
* CRYPTO function codes.
|
||||
*/
|
||||
# define CRYPTO_F_CMAC_CTX_NEW 120
|
||||
# define CRYPTO_F_CRYPTO_DUP_EX_DATA 110
|
||||
# define CRYPTO_F_CRYPTO_FREE_EX_DATA 111
|
||||
# define CRYPTO_F_CRYPTO_GET_EX_NEW_INDEX 100
|
||||
# define CRYPTO_F_CRYPTO_MEMDUP 115
|
||||
# define CRYPTO_F_CRYPTO_NEW_EX_DATA 112
|
||||
# define CRYPTO_F_CRYPTO_OCB128_COPY_CTX 121
|
||||
# define CRYPTO_F_CRYPTO_OCB128_INIT 122
|
||||
# define CRYPTO_F_CRYPTO_SET_EX_DATA 102
|
||||
# define CRYPTO_F_FIPS_MODE_SET 109
|
||||
# define CRYPTO_F_GET_AND_LOCK 113
|
||||
# define CRYPTO_F_OPENSSL_ATEXIT 114
|
||||
# define CRYPTO_F_OPENSSL_BUF2HEXSTR 117
|
||||
# define CRYPTO_F_OPENSSL_FOPEN 119
|
||||
# define CRYPTO_F_OPENSSL_HEXSTR2BUF 118
|
||||
# define CRYPTO_F_OPENSSL_INIT_CRYPTO 116
|
||||
# define CRYPTO_F_OPENSSL_LH_NEW 126
|
||||
# define CRYPTO_F_OPENSSL_SK_DEEP_COPY 127
|
||||
# define CRYPTO_F_OPENSSL_SK_DUP 128
|
||||
# define CRYPTO_F_PKEY_HMAC_INIT 123
|
||||
# define CRYPTO_F_PKEY_POLY1305_INIT 124
|
||||
# define CRYPTO_F_PKEY_SIPHASH_INIT 125
|
||||
# define CRYPTO_F_SK_RESERVE 129
|
||||
#include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
/*
|
||||
* CRYPTO reason codes.
|
||||
*/
|
||||
# define CRYPTO_R_FIPS_MODE_NOT_SUPPORTED 101
|
||||
#define CRYPTO_R_BAD_ALGORITHM_NAME 117
|
||||
#define CRYPTO_R_CONFLICTING_NAMES 118
|
||||
#define CRYPTO_R_HEX_STRING_TOO_SHORT 121
|
||||
#define CRYPTO_R_ILLEGAL_HEX_DIGIT 102
|
||||
#define CRYPTO_R_INSUFFICIENT_DATA_SPACE 106
|
||||
#define CRYPTO_R_INSUFFICIENT_PARAM_SIZE 107
|
||||
#define CRYPTO_R_INSUFFICIENT_SECURE_DATA_SPACE 108
|
||||
#define CRYPTO_R_INTEGER_OVERFLOW 127
|
||||
#define CRYPTO_R_INVALID_NEGATIVE_VALUE 122
|
||||
#define CRYPTO_R_INVALID_NULL_ARGUMENT 109
|
||||
#define CRYPTO_R_INVALID_OSSL_PARAM_TYPE 110
|
||||
#define CRYPTO_R_NO_PARAMS_TO_MERGE 131
|
||||
#define CRYPTO_R_NO_SPACE_FOR_TERMINATING_NULL 128
|
||||
#define CRYPTO_R_ODD_NUMBER_OF_DIGITS 103
|
||||
#define CRYPTO_R_PARAM_CANNOT_BE_REPRESENTED_EXACTLY 123
|
||||
#define CRYPTO_R_PARAM_NOT_INTEGER_TYPE 124
|
||||
#define CRYPTO_R_PARAM_OF_INCOMPATIBLE_TYPE 129
|
||||
#define CRYPTO_R_PARAM_UNSIGNED_INTEGER_NEGATIVE_VALUE_UNSUPPORTED 125
|
||||
#define CRYPTO_R_PARAM_UNSUPPORTED_FLOATING_POINT_FORMAT 130
|
||||
#define CRYPTO_R_PARAM_VALUE_TOO_LARGE_FOR_DESTINATION 126
|
||||
#define CRYPTO_R_PROVIDER_ALREADY_EXISTS 104
|
||||
#define CRYPTO_R_PROVIDER_SECTION_ERROR 105
|
||||
#define CRYPTO_R_RANDOM_SECTION_ERROR 119
|
||||
#define CRYPTO_R_SECURE_MALLOC_FAILURE 111
|
||||
#define CRYPTO_R_STRING_TOO_LONG 112
|
||||
#define CRYPTO_R_TOO_MANY_BYTES 113
|
||||
#define CRYPTO_R_TOO_MANY_NAMES 132
|
||||
#define CRYPTO_R_TOO_MANY_RECORDS 114
|
||||
#define CRYPTO_R_TOO_SMALL_BUFFER 116
|
||||
#define CRYPTO_R_UNKNOWN_NAME_IN_RANDOM_SECTION 120
|
||||
#define CRYPTO_R_ZERO_LENGTH_NUMBER 115
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,19 +1,32 @@
|
||||
/*
|
||||
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* WARNING: do not edit!
|
||||
* Generated by Makefile from include/openssl/ct.h.in
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CT_H
|
||||
/* clang-format off */
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
#ifndef OPENSSL_CT_H
|
||||
#define OPENSSL_CT_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/macros.h>
|
||||
#ifndef OPENSSL_NO_DEPRECATED_3_0
|
||||
#define HEADER_CT_H
|
||||
#endif
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
|
||||
#ifndef OPENSSL_NO_CT
|
||||
# include <openssl/ossl_typ.h>
|
||||
#include <openssl/types.h>
|
||||
#include <openssl/safestack.h>
|
||||
#include <openssl/x509.h>
|
||||
#include <openssl/cterr.h>
|
||||
@@ -21,13 +34,68 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* Minimum RSA key size, from RFC6962 */
|
||||
#define SCT_MIN_RSA_BITS 2048
|
||||
|
||||
/* All hashes are SHA256 in v1 of Certificate Transparency */
|
||||
#define CT_V1_HASHLEN SHA256_DIGEST_LENGTH
|
||||
|
||||
/* clang-format off */
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(SCT, SCT, SCT)
|
||||
#define sk_SCT_num(sk) OPENSSL_sk_num(ossl_check_const_SCT_sk_type(sk))
|
||||
#define sk_SCT_value(sk, idx) ((SCT *)OPENSSL_sk_value(ossl_check_const_SCT_sk_type(sk), (idx)))
|
||||
#define sk_SCT_new(cmp) ((STACK_OF(SCT) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_SCT_compfunc_type(cmp)), sk_SCT_cmpfunc_thunk))
|
||||
#define sk_SCT_new_null() ((STACK_OF(SCT) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_SCT_freefunc_thunk))
|
||||
#define sk_SCT_new_reserve(cmp, n) ((STACK_OF(SCT) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_SCT_compfunc_type(cmp), (n)), sk_SCT_cmpfunc_thunk))
|
||||
#define sk_SCT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_SCT_sk_type(sk), (n))
|
||||
#define sk_SCT_free(sk) OPENSSL_sk_free(ossl_check_SCT_sk_type(sk))
|
||||
#define sk_SCT_zero(sk) OPENSSL_sk_zero(ossl_check_SCT_sk_type(sk))
|
||||
#define sk_SCT_delete(sk, i) ((SCT *)OPENSSL_sk_delete(ossl_check_SCT_sk_type(sk), (i)))
|
||||
#define sk_SCT_delete_ptr(sk, ptr) ((SCT *)OPENSSL_sk_delete_ptr(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr)))
|
||||
#define sk_SCT_push(sk, ptr) OPENSSL_sk_push(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
||||
#define sk_SCT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
||||
#define sk_SCT_pop(sk) ((SCT *)OPENSSL_sk_pop(ossl_check_SCT_sk_type(sk)))
|
||||
#define sk_SCT_shift(sk) ((SCT *)OPENSSL_sk_shift(ossl_check_SCT_sk_type(sk)))
|
||||
#define sk_SCT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_SCT_sk_type(sk), ossl_check_SCT_freefunc_type(freefunc))
|
||||
#define sk_SCT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr), (idx))
|
||||
#define sk_SCT_set(sk, idx, ptr) ((SCT *)OPENSSL_sk_set(ossl_check_SCT_sk_type(sk), (idx), ossl_check_SCT_type(ptr)))
|
||||
#define sk_SCT_find(sk, ptr) OPENSSL_sk_find(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
||||
#define sk_SCT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr))
|
||||
#define sk_SCT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_SCT_sk_type(sk), ossl_check_SCT_type(ptr), pnum)
|
||||
#define sk_SCT_sort(sk) OPENSSL_sk_sort(ossl_check_SCT_sk_type(sk))
|
||||
#define sk_SCT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_SCT_sk_type(sk))
|
||||
#define sk_SCT_dup(sk) ((STACK_OF(SCT) *)OPENSSL_sk_dup(ossl_check_const_SCT_sk_type(sk)))
|
||||
#define sk_SCT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(SCT) *)OPENSSL_sk_deep_copy(ossl_check_const_SCT_sk_type(sk), ossl_check_SCT_copyfunc_type(copyfunc), ossl_check_SCT_freefunc_type(freefunc)))
|
||||
#define sk_SCT_set_cmp_func(sk, cmp) ((sk_SCT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_SCT_sk_type(sk), ossl_check_SCT_compfunc_type(cmp)))
|
||||
SKM_DEFINE_STACK_OF_INTERNAL(CTLOG, CTLOG, CTLOG)
|
||||
#define sk_CTLOG_num(sk) OPENSSL_sk_num(ossl_check_const_CTLOG_sk_type(sk))
|
||||
#define sk_CTLOG_value(sk, idx) ((CTLOG *)OPENSSL_sk_value(ossl_check_const_CTLOG_sk_type(sk), (idx)))
|
||||
#define sk_CTLOG_new(cmp) ((STACK_OF(CTLOG) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new(ossl_check_CTLOG_compfunc_type(cmp)), sk_CTLOG_cmpfunc_thunk))
|
||||
#define sk_CTLOG_new_null() ((STACK_OF(CTLOG) *)OPENSSL_sk_set_thunks(OPENSSL_sk_new_null(), sk_CTLOG_freefunc_thunk))
|
||||
#define sk_CTLOG_new_reserve(cmp, n) ((STACK_OF(CTLOG) *)OPENSSL_sk_set_cmp_thunks(OPENSSL_sk_new_reserve(ossl_check_CTLOG_compfunc_type(cmp), (n)), sk_CTLOG_cmpfunc_thunk))
|
||||
#define sk_CTLOG_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_CTLOG_sk_type(sk), (n))
|
||||
#define sk_CTLOG_free(sk) OPENSSL_sk_free(ossl_check_CTLOG_sk_type(sk))
|
||||
#define sk_CTLOG_zero(sk) OPENSSL_sk_zero(ossl_check_CTLOG_sk_type(sk))
|
||||
#define sk_CTLOG_delete(sk, i) ((CTLOG *)OPENSSL_sk_delete(ossl_check_CTLOG_sk_type(sk), (i)))
|
||||
#define sk_CTLOG_delete_ptr(sk, ptr) ((CTLOG *)OPENSSL_sk_delete_ptr(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr)))
|
||||
#define sk_CTLOG_push(sk, ptr) OPENSSL_sk_push(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
||||
#define sk_CTLOG_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
||||
#define sk_CTLOG_pop(sk) ((CTLOG *)OPENSSL_sk_pop(ossl_check_CTLOG_sk_type(sk)))
|
||||
#define sk_CTLOG_shift(sk) ((CTLOG *)OPENSSL_sk_shift(ossl_check_CTLOG_sk_type(sk)))
|
||||
#define sk_CTLOG_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_freefunc_type(freefunc))
|
||||
#define sk_CTLOG_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr), (idx))
|
||||
#define sk_CTLOG_set(sk, idx, ptr) ((CTLOG *)OPENSSL_sk_set(ossl_check_CTLOG_sk_type(sk), (idx), ossl_check_CTLOG_type(ptr)))
|
||||
#define sk_CTLOG_find(sk, ptr) OPENSSL_sk_find(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
||||
#define sk_CTLOG_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr))
|
||||
#define sk_CTLOG_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_type(ptr), pnum)
|
||||
#define sk_CTLOG_sort(sk) OPENSSL_sk_sort(ossl_check_CTLOG_sk_type(sk))
|
||||
#define sk_CTLOG_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_CTLOG_sk_type(sk))
|
||||
#define sk_CTLOG_dup(sk) ((STACK_OF(CTLOG) *)OPENSSL_sk_dup(ossl_check_const_CTLOG_sk_type(sk)))
|
||||
#define sk_CTLOG_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(CTLOG) *)OPENSSL_sk_deep_copy(ossl_check_const_CTLOG_sk_type(sk), ossl_check_CTLOG_copyfunc_type(copyfunc), ossl_check_CTLOG_freefunc_type(freefunc)))
|
||||
#define sk_CTLOG_set_cmp_func(sk, cmp) ((sk_CTLOG_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_CTLOG_sk_type(sk), ossl_check_CTLOG_compfunc_type(cmp)))
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
typedef enum {
|
||||
CT_LOG_ENTRY_TYPE_NOT_SET = -1,
|
||||
CT_LOG_ENTRY_TYPE_X509 = 0,
|
||||
@@ -55,18 +123,23 @@ typedef enum {
|
||||
SCT_VALIDATION_STATUS_UNKNOWN_VERSION
|
||||
} sct_validation_status_t;
|
||||
|
||||
DEFINE_STACK_OF(SCT)
|
||||
DEFINE_STACK_OF(CTLOG)
|
||||
|
||||
/******************************************
|
||||
* CT policy evaluation context functions *
|
||||
******************************************/
|
||||
|
||||
/*
|
||||
* Creates a new, empty policy evaluation context.
|
||||
* Creates a new, empty policy evaluation context associated with the given
|
||||
* library context and property query string.
|
||||
* The caller is responsible for calling CT_POLICY_EVAL_CTX_free when finished
|
||||
* with the CT_POLICY_EVAL_CTX.
|
||||
*/
|
||||
CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new_ex(OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
|
||||
/*
|
||||
* The same as CT_POLICY_EVAL_CTX_new_ex() but the default library
|
||||
* context and property query string is used.
|
||||
*/
|
||||
CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void);
|
||||
|
||||
/* Deletes a policy evaluation context and anything it owns. */
|
||||
@@ -315,9 +388,8 @@ __owur int SCT_validate(SCT *sct, const CT_POLICY_EVAL_CTX *ctx);
|
||||
__owur int SCT_LIST_validate(const STACK_OF(SCT) *scts,
|
||||
CT_POLICY_EVAL_CTX *ctx);
|
||||
|
||||
|
||||
/*********************************
|
||||
* SCT parsing and serialisation *
|
||||
* SCT parsing and serialization *
|
||||
*********************************/
|
||||
|
||||
/*
|
||||
@@ -403,19 +475,39 @@ SCT *o2i_SCT(SCT **psct, const unsigned char **in, size_t len);
|
||||
********************/
|
||||
|
||||
/*
|
||||
* Creates a new CT log instance with the given |public_key| and |name|.
|
||||
* Creates a new CT log instance with the given |public_key| and |name| and
|
||||
* associates it with the give library context |libctx| and property query
|
||||
* string |propq|.
|
||||
* Takes ownership of |public_key| but copies |name|.
|
||||
* Returns NULL if malloc fails or if |public_key| cannot be converted to DER.
|
||||
* Should be deleted by the caller using CTLOG_free when no longer needed.
|
||||
*/
|
||||
CTLOG *CTLOG_new_ex(EVP_PKEY *public_key, const char *name, OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
|
||||
/*
|
||||
* The same as CTLOG_new_ex except that the default library context and
|
||||
* property query string are used.
|
||||
*/
|
||||
CTLOG *CTLOG_new(EVP_PKEY *public_key, const char *name);
|
||||
|
||||
/*
|
||||
* Creates a new CTLOG instance with the base64-encoded SubjectPublicKeyInfo DER
|
||||
* in |pkey_base64|. The |name| is a string to help users identify this log.
|
||||
* in |pkey_base64| and associated with the given library context |libctx| and
|
||||
* property query string |propq|. The |name| is a string to help users identify
|
||||
* this log.
|
||||
* Returns 1 on success, 0 on failure.
|
||||
* Should be deleted by the caller using CTLOG_free when no longer needed.
|
||||
*/
|
||||
int CTLOG_new_from_base64_ex(CTLOG **ct_log, const char *pkey_base64,
|
||||
const char *name, OSSL_LIB_CTX *libctx,
|
||||
const char *propq);
|
||||
|
||||
/*
|
||||
* The same as CTLOG_new_from_base64_ex() except that the default
|
||||
* library context and property query string are used.
|
||||
* Returns 1 on success, 0 on failure.
|
||||
*/
|
||||
int CTLOG_new_from_base64(CTLOG **ct_log,
|
||||
const char *pkey_base64, const char *name);
|
||||
|
||||
@@ -437,7 +529,15 @@ EVP_PKEY *CTLOG_get0_public_key(const CTLOG *log);
|
||||
**************************/
|
||||
|
||||
/*
|
||||
* Creates a new CT log store.
|
||||
* Creates a new CT log store and associates it with the given libctx and
|
||||
* property query string.
|
||||
* Should be deleted by the caller using CTLOG_STORE_free when no longer needed.
|
||||
*/
|
||||
CTLOG_STORE *CTLOG_STORE_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
|
||||
|
||||
/*
|
||||
* Same as CTLOG_STORE_new_ex except that the default libctx and
|
||||
* property query string are used.
|
||||
* Should be deleted by the caller using CTLOG_STORE_free when no longer needed.
|
||||
*/
|
||||
CTLOG_STORE *CTLOG_STORE_new(void);
|
||||
|
||||
@@ -1,60 +1,23 @@
|
||||
/*
|
||||
* Generated by util/mkerr.pl DO NOT EDIT
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2021 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
* in the file LICENSE in the source distribution or at
|
||||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#ifndef HEADER_CTERR_H
|
||||
# define HEADER_CTERR_H
|
||||
|
||||
# ifndef HEADER_SYMHACKS_H
|
||||
# include <openssl/symhacks.h>
|
||||
# endif
|
||||
#ifndef OPENSSL_CTERR_H
|
||||
#define OPENSSL_CTERR_H
|
||||
#pragma once
|
||||
|
||||
#include <openssl/opensslconf.h>
|
||||
#include <openssl/symhacks.h>
|
||||
#include <openssl/cryptoerr_legacy.h>
|
||||
|
||||
#ifndef OPENSSL_NO_CT
|
||||
|
||||
# ifdef __cplusplus
|
||||
extern "C"
|
||||
# endif
|
||||
int ERR_load_CT_strings(void);
|
||||
|
||||
/*
|
||||
* CT function codes.
|
||||
*/
|
||||
# define CT_F_CTLOG_NEW 117
|
||||
# define CT_F_CTLOG_NEW_FROM_BASE64 118
|
||||
# define CT_F_CTLOG_NEW_FROM_CONF 119
|
||||
# define CT_F_CTLOG_STORE_LOAD_CTX_NEW 122
|
||||
# define CT_F_CTLOG_STORE_LOAD_FILE 123
|
||||
# define CT_F_CTLOG_STORE_LOAD_LOG 130
|
||||
# define CT_F_CTLOG_STORE_NEW 131
|
||||
# define CT_F_CT_BASE64_DECODE 124
|
||||
# define CT_F_CT_POLICY_EVAL_CTX_NEW 133
|
||||
# define CT_F_CT_V1_LOG_ID_FROM_PKEY 125
|
||||
# define CT_F_I2O_SCT 107
|
||||
# define CT_F_I2O_SCT_LIST 108
|
||||
# define CT_F_I2O_SCT_SIGNATURE 109
|
||||
# define CT_F_O2I_SCT 110
|
||||
# define CT_F_O2I_SCT_LIST 111
|
||||
# define CT_F_O2I_SCT_SIGNATURE 112
|
||||
# define CT_F_SCT_CTX_NEW 126
|
||||
# define CT_F_SCT_CTX_VERIFY 128
|
||||
# define CT_F_SCT_NEW 100
|
||||
# define CT_F_SCT_NEW_FROM_BASE64 127
|
||||
# define CT_F_SCT_SET0_LOG_ID 101
|
||||
# define CT_F_SCT_SET1_EXTENSIONS 114
|
||||
# define CT_F_SCT_SET1_LOG_ID 115
|
||||
# define CT_F_SCT_SET1_SIGNATURE 116
|
||||
# define CT_F_SCT_SET_LOG_ENTRY_TYPE 102
|
||||
# define CT_F_SCT_SET_SIGNATURE_NID 103
|
||||
# define CT_F_SCT_SET_VERSION 104
|
||||
|
||||
/*
|
||||
* CT reason codes.
|
||||
*/
|
||||
|
||||
Loaded 100 of 258 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user