This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new f33ee501c3 Move around some declarations after some symbol visibility
changes
f33ee501c3 is described below
commit f33ee501c309d57e2f168af8b5e67d9823c78c2b
Author: remm <[email protected]>
AuthorDate: Fri Dec 1 16:52:04 2023 +0100
Move around some declarations after some symbol visibility changes
Update jextract.
Remove callback helpers that are not actually used (they seem to use
bind).
No actual change to symbols or deprecation status.
---
.../apache/tomcat/util/openssl/RuntimeHelper.java | 197 +++--------
.../SSL_CTX_set_cert_verify_callback$cb.java | 58 ---
.../openssl/SSL_CTX_set_tmp_dh_callback$dh.java | 59 ----
.../util/openssl/SSL_set_info_callback$cb.java | 58 ---
java/org/apache/tomcat/util/openssl/openssl_h.java | 388 +--------------------
.../tomcat/util/openssl/openssl_h_Macros.java | 352 ++++++++++++++++++-
6 files changed, 392 insertions(+), 720 deletions(-)
diff --git a/java/org/apache/tomcat/util/openssl/RuntimeHelper.java
b/java/org/apache/tomcat/util/openssl/RuntimeHelper.java
index f4e829c9d1..701027006a 100644
--- a/java/org/apache/tomcat/util/openssl/RuntimeHelper.java
+++ b/java/org/apache/tomcat/util/openssl/RuntimeHelper.java
@@ -18,23 +18,25 @@
package org.apache.tomcat.util.openssl;
// Generated by jextract
-import java.lang.foreign.Linker;
+import static java.lang.Long.MAX_VALUE;
+import static java.lang.foreign.ValueLayout.ADDRESS;
+import static java.lang.foreign.ValueLayout.JAVA_BYTE;
+import static java.lang.foreign.ValueLayout.JAVA_DOUBLE;
+import static java.lang.foreign.ValueLayout.JAVA_INT;
+import static java.lang.foreign.ValueLayout.JAVA_LONG;
+
+import java.lang.foreign.AddressLayout;
+import java.lang.foreign.Arena;
import java.lang.foreign.FunctionDescriptor;
-import java.lang.foreign.GroupLayout;
-import java.lang.foreign.SymbolLookup;
+import java.lang.foreign.Linker;
import java.lang.foreign.MemoryLayout;
import java.lang.foreign.MemorySegment;
-import java.lang.foreign.Arena;
import java.lang.foreign.SegmentAllocator;
+import java.lang.foreign.SymbolLookup;
import java.lang.foreign.ValueLayout;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandles;
-import java.lang.invoke.MethodType;
-import java.lang.foreign.AddressLayout;
-import static java.lang.foreign.ValueLayout.*;
-import static java.lang.Long.MAX_VALUE;
-@SuppressWarnings("unused")
final class RuntimeHelper {
private static final Linker LINKER = Linker.nativeLinker();
@@ -44,8 +46,8 @@ final class RuntimeHelper {
private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> {
throw new AssertionError("should not reach here");
};
- static final AddressLayout POINTER =
-
ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(MAX_VALUE,
JAVA_BYTE));
+ static final AddressLayout POINTER = ValueLayout.ADDRESS
+ .withTargetLayout(MemoryLayout.sequenceLayout(MAX_VALUE,
JAVA_BYTE));
final static SegmentAllocator CONSTANT_ALLOCATOR = (size, align) ->
Arena.ofAuto().allocate(size, align);
@@ -78,8 +80,20 @@ final class RuntimeHelper {
return LINKER.downcallHandle(fdesc);
}
- static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor
fdesc) {
- return SYMBOL_LOOKUP.find(name).map(addr -> VarargsInvoker.make(addr,
fdesc)).orElse(null);
+ static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor
baseDesc,
+ MemoryLayout[] variadicLayouts) {
+ FunctionDescriptor variadicDesc =
baseDesc.appendArgumentLayouts(variadicLayouts);
+ Linker.Option fva =
Linker.Option.firstVariadicArg(baseDesc.argumentLayouts().size());
+ return SYMBOL_LOOKUP.find(name).map(addr ->
LINKER.downcallHandle(addr, variadicDesc, fva)
+ .asSpreader(Object[].class,
variadicLayouts.length)).orElse(null);
+ }
+
+ static MemoryLayout[] inferVariadicLayouts(Object[] varargs) {
+ MemoryLayout[] result = new MemoryLayout[varargs.length];
+ for (int i = 0; i < varargs.length; i++) {
+ result[i] = variadicLayout(varargs[i].getClass());
+ }
+ return result;
}
static MethodHandle upcallHandle(Class<?> fi, String name,
FunctionDescriptor fdesc) {
@@ -100,154 +114,23 @@ final class RuntimeHelper {
}
static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int
numElements, Arena arena) {
- return addr.reinterpret(numElements * layout.byteSize(), arena, null);
+ return addr.reinterpret(numElements * layout.byteSize(), arena, null);
}
// Internals only below this point
- private static final class VarargsInvoker {
- private static final MethodHandle INVOKE_MH;
- private final MemorySegment symbol;
- private final FunctionDescriptor function;
-
- private VarargsInvoker(MemorySegment symbol, FunctionDescriptor
function) {
- this.symbol = symbol;
- this.function = function;
- }
-
- static {
- try {
- INVOKE_MH =
MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke",
- MethodType.methodType(Object.class,
SegmentAllocator.class, Object[].class));
- } catch (ReflectiveOperationException e) {
- throw new RuntimeException(e);
- }
- }
-
- static MethodHandle make(MemorySegment symbol, FunctionDescriptor
function) {
- VarargsInvoker invoker = new VarargsInvoker(symbol, function);
- MethodHandle handle =
- INVOKE_MH.bindTo(invoker).asCollector(Object[].class,
function.argumentLayouts().size() + 1);
- MethodType mtype = MethodType.methodType(
- function.returnLayout().isPresent() ?
carrier(function.returnLayout().get(), true) : void.class);
- for (MemoryLayout layout : function.argumentLayouts()) {
- mtype = mtype.appendParameterTypes(carrier(layout, false));
- }
- mtype = mtype.appendParameterTypes(Object[].class);
- boolean needsAllocator =
- function.returnLayout().isPresent() &&
function.returnLayout().get() instanceof GroupLayout;
- if (needsAllocator) {
- mtype = mtype.insertParameterTypes(0, SegmentAllocator.class);
- } else {
- handle = MethodHandles.insertArguments(handle, 0,
THROWING_ALLOCATOR);
- }
- return handle.asType(mtype);
- }
-
- static Class<?> carrier(MemoryLayout layout, boolean ret) {
- if (layout instanceof ValueLayout valueLayout) {
- return valueLayout.carrier();
- } else if (layout instanceof GroupLayout) {
- return MemorySegment.class;
- } else {
- throw new AssertionError("Cannot get here!");
- }
- }
-
- private Object invoke(SegmentAllocator allocator, Object[] args)
throws Throwable {
- // one trailing Object[]
- int nNamedArgs = function.argumentLayouts().size();
- assert(args.length == nNamedArgs + 1);
- // The last argument is the array of vararg collector
- Object[] unnamedArgs = (Object[]) args[args.length - 1];
-
- int argsCount = nNamedArgs + unnamedArgs.length;
- Class<?>[] argTypes = new Class<?>[argsCount];
- MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs +
unnamedArgs.length];
-
- int pos = 0;
- for (pos = 0; pos < nNamedArgs; pos++) {
- argLayouts[pos] = function.argumentLayouts().get(pos);
- }
-
- assert pos == nNamedArgs;
- for (Object o: unnamedArgs) {
- argLayouts[pos] = variadicLayout(normalize(o.getClass()));
- pos++;
- }
- assert pos == argsCount;
-
- FunctionDescriptor f = (function.returnLayout().isEmpty()) ?
FunctionDescriptor.ofVoid(argLayouts) :
- FunctionDescriptor.of(function.returnLayout().get(),
argLayouts);
- MethodHandle mh = LINKER.downcallHandle(symbol, f);
- boolean needsAllocator =
- function.returnLayout().isPresent() &&
function.returnLayout().get() instanceof GroupLayout;
- if (needsAllocator) {
- mh = mh.bindTo(allocator);
- }
- // flatten argument list so that it can be passed to an asSpreader
MH
- Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length];
- System.arraycopy(args, 0, allArgs, 0, nNamedArgs);
- System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs,
unnamedArgs.length);
-
- return mh.asSpreader(Object[].class, argsCount).invoke(allArgs);
- }
-
- private static Class<?> unboxIfNeeded(Class<?> clazz) {
- if (clazz == Boolean.class) {
- return boolean.class;
- } else if (clazz == Void.class) {
- return void.class;
- } else if (clazz == Byte.class) {
- return byte.class;
- } else if (clazz == Character.class) {
- return char.class;
- } else if (clazz == Short.class) {
- return short.class;
- } else if (clazz == Integer.class) {
- return int.class;
- } else if (clazz == Long.class) {
- return long.class;
- } else if (clazz == Float.class) {
- return float.class;
- } else if (clazz == Double.class) {
- return double.class;
- } else {
- return clazz;
- }
- }
-
- private Class<?> promote(Class<?> c) {
- if (c == byte.class || c == char.class || c == short.class || c ==
int.class) {
- return long.class;
- } else if (c == float.class) {
- return double.class;
- } else {
- return c;
- }
- }
-
- private Class<?> normalize(Class<?> c) {
- c = unboxIfNeeded(c);
- if (c.isPrimitive()) {
- return promote(c);
- }
- if (MemorySegment.class.isAssignableFrom(c)) {
- return MemorySegment.class;
- }
- throw new IllegalArgumentException("Invalid type for ABI: " +
c.getTypeName());
- }
-
- private MemoryLayout variadicLayout(Class<?> c) {
- if (c == long.class) {
- return JAVA_LONG;
- } else if (c == double.class) {
- return JAVA_DOUBLE;
- } else if (c == MemorySegment.class) {
- return ADDRESS;
- } else {
- throw new IllegalArgumentException("Unhandled variadic
argument class: " + c);
- }
+ private static MemoryLayout variadicLayout(Class<?> c) {
+ // apply default argument promotions per C spec
+ // note that all primitives are boxed, since they are passed through
an Object[]
+ if (c == Boolean.class || c == Byte.class || c == Character.class || c
== Short.class || c == Integer.class) {
+ return JAVA_INT;
+ } else if (c == Long.class) {
+ return JAVA_LONG;
+ } else if (c == Float.class || c == Double.class) {
+ return JAVA_DOUBLE;
+ } else if (MemorySegment.class.isAssignableFrom(c)) {
+ return ADDRESS;
}
+ throw new IllegalArgumentException("Invalid type for ABI: " +
c.getTypeName());
}
}
diff --git
a/java/org/apache/tomcat/util/openssl/SSL_CTX_set_cert_verify_callback$cb.java
b/java/org/apache/tomcat/util/openssl/SSL_CTX_set_cert_verify_callback$cb.java
deleted file mode 100644
index dce8ac64d0..0000000000
---
a/java/org/apache/tomcat/util/openssl/SSL_CTX_set_cert_verify_callback$cb.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Generated by jextract
-
-package org.apache.tomcat.util.openssl;
-
-import java.lang.foreign.*;
-import java.lang.invoke.MethodHandle;
-
-/**
- * {@snippet lang=c :
- * int (*SSL_CTX_set_cert_verify_callback$cb)(X509_STORE_CTX*,void*);
- * }
- */
-@SuppressWarnings("javadoc")
-public interface SSL_CTX_set_cert_verify_callback$cb {
-
- FunctionDescriptor $DESC = FunctionDescriptor.of(
- ValueLayout.JAVA_INT,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER
- );
- int apply(MemorySegment _x0, MemorySegment _x1);
- MethodHandle UP$MH =
RuntimeHelper.upcallHandle(SSL_CTX_set_cert_verify_callback$cb.class, "apply",
$DESC);
-
- static MemorySegment allocate(SSL_CTX_set_cert_verify_callback$cb fi,
Arena scope) {
- return RuntimeHelper.upcallStub(UP$MH, fi, $DESC, scope);
- }
- MethodHandle DOWN$MH = RuntimeHelper.downcallHandle($DESC);
-
- static SSL_CTX_set_cert_verify_callback$cb ofAddress(MemorySegment addr,
Arena arena) {
- MemorySegment symbol = addr.reinterpret(arena, null);
- return (MemorySegment __x0, MemorySegment __x1) -> {
- try {
- return (int) DOWN$MH.invokeExact(symbol, __x0, __x1);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- };
- }
-}
-
-
diff --git
a/java/org/apache/tomcat/util/openssl/SSL_CTX_set_tmp_dh_callback$dh.java
b/java/org/apache/tomcat/util/openssl/SSL_CTX_set_tmp_dh_callback$dh.java
deleted file mode 100644
index 6cc1f0605f..0000000000
--- a/java/org/apache/tomcat/util/openssl/SSL_CTX_set_tmp_dh_callback$dh.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Generated by jextract
-
-package org.apache.tomcat.util.openssl;
-
-import java.lang.foreign.*;
-import java.lang.invoke.MethodHandle;
-
-/**
- * {@snippet lang=c :
- * DH* (*SSL_CTX_set_tmp_dh_callback$dh)(SSL*,int,int);
- * }
- */
-@SuppressWarnings("javadoc")
-public interface SSL_CTX_set_tmp_dh_callback$dh {
-
- FunctionDescriptor $DESC = FunctionDescriptor.of(
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- ValueLayout.JAVA_INT,
- ValueLayout.JAVA_INT
- );
- MemorySegment apply(MemorySegment _x0, int _x1, int _x2);
- MethodHandle UP$MH =
RuntimeHelper.upcallHandle(SSL_CTX_set_tmp_dh_callback$dh.class, "apply",
$DESC);
-
- static MemorySegment allocate(SSL_CTX_set_tmp_dh_callback$dh fi, Arena
scope) {
- return RuntimeHelper.upcallStub(UP$MH, fi, $DESC, scope);
- }
- MethodHandle DOWN$MH = RuntimeHelper.downcallHandle($DESC);
-
- static SSL_CTX_set_tmp_dh_callback$dh ofAddress(MemorySegment addr, Arena
arena) {
- MemorySegment symbol = addr.reinterpret(arena, null);
- return (MemorySegment __x0, int __x1, int __x2) -> {
- try {
- return (MemorySegment) DOWN$MH.invokeExact(symbol, __x0, __x1,
__x2);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- };
- }
-}
-
-
diff --git a/java/org/apache/tomcat/util/openssl/SSL_set_info_callback$cb.java
b/java/org/apache/tomcat/util/openssl/SSL_set_info_callback$cb.java
deleted file mode 100644
index 6dfc35262b..0000000000
--- a/java/org/apache/tomcat/util/openssl/SSL_set_info_callback$cb.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// Generated by jextract
-
-package org.apache.tomcat.util.openssl;
-
-import java.lang.foreign.*;
-import java.lang.invoke.MethodHandle;
-
-/**
- * {@snippet lang=c :
- * void (*SSL_set_info_callback$cb)(const SSL*,int,int);
- * }
- */
-@SuppressWarnings("javadoc")
-public interface SSL_set_info_callback$cb {
-
- FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
- RuntimeHelper.POINTER,
- ValueLayout.JAVA_INT,
- ValueLayout.JAVA_INT
- );
- void apply(MemorySegment _x0, int _x1, int _x2);
- MethodHandle UP$MH =
RuntimeHelper.upcallHandle(SSL_set_info_callback$cb.class, "apply", $DESC);
-
- static MemorySegment allocate(SSL_set_info_callback$cb fi, Arena scope) {
- return RuntimeHelper.upcallStub(UP$MH, fi, $DESC, scope);
- }
- MethodHandle DOWN$MH = RuntimeHelper.downcallHandle($DESC);
-
- static SSL_set_info_callback$cb ofAddress(MemorySegment addr, Arena arena)
{
- MemorySegment symbol = addr.reinterpret(arena, null);
- return (MemorySegment __x0, int __x1, int __x2) -> {
- try {
- DOWN$MH.invokeExact(symbol, __x0, __x1, __x2);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- };
- }
-}
-
-
diff --git a/java/org/apache/tomcat/util/openssl/openssl_h.java
b/java/org/apache/tomcat/util/openssl/openssl_h.java
index eded6c3d8b..75ed768320 100644
--- a/java/org/apache/tomcat/util/openssl/openssl_h.java
+++ b/java/org/apache/tomcat/util/openssl/openssl_h.java
@@ -27,6 +27,7 @@ import static java.lang.foreign.ValueLayout.*;
@SuppressWarnings("javadoc")
public class openssl_h {
+ public static final OfBoolean C_BOOL = JAVA_BOOLEAN;
public static final OfByte C_CHAR = JAVA_BYTE;
public static final OfShort C_SHORT = JAVA_SHORT;
public static final OfInt C_INT = JAVA_INT;
@@ -2173,83 +2174,6 @@ public class openssl_h {
throw new AssertionError("should not reach here", ex$);
}
}
- /**
- * {@snippet lang=c :
- * void X509_free(X509* a);
- * }
- */
- public static MethodHandle X509_free$MH() {
- class Holder {
- static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid(
- RuntimeHelper.POINTER
- );
-
- static final MethodHandle MH =
RuntimeHelper.downcallHandle("X509_free", DESC);
- }
- return RuntimeHelper.requireNonNull(Holder.MH, "X509_free");
- }
-
- public static void X509_free(MemorySegment a) {
- var mh$ = X509_free$MH();
- try {
- mh$.invokeExact(a);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- }
- /**
- * {@snippet lang=c :
- * X509* d2i_X509(X509** a, unsigned char** in, long len);
- * }
- */
- public static MethodHandle d2i_X509$MH() {
- class Holder {
- static final FunctionDescriptor DESC = FunctionDescriptor.of(
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- JAVA_LONG
- );
-
- static final MethodHandle MH =
RuntimeHelper.downcallHandle("d2i_X509", DESC);
- }
- return RuntimeHelper.requireNonNull(Holder.MH, "d2i_X509");
- }
-
- public static MemorySegment d2i_X509(MemorySegment a, MemorySegment in,
long len) {
- var mh$ = d2i_X509$MH();
- try {
- return (MemorySegment) mh$.invokeExact(a, in, len);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- }
- /**
- * {@snippet lang=c :
- * int i2d_X509(const X509* a, unsigned char** out);
- * }
- */
- public static MethodHandle i2d_X509$MH() {
- class Holder {
- static final FunctionDescriptor DESC = FunctionDescriptor.of(
- JAVA_INT,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER
- );
-
- static final MethodHandle MH =
RuntimeHelper.downcallHandle("i2d_X509", DESC);
- }
- return RuntimeHelper.requireNonNull(Holder.MH, "i2d_X509");
- }
-
- public static int i2d_X509(MemorySegment a, MemorySegment out) {
- var mh$ = i2d_X509$MH();
- try {
- return (int) mh$.invokeExact(a, out);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- }
/**
* {@snippet lang=c :
* int X509_get_ext_by_NID(const X509* x, int nid, int lastpos);
@@ -2358,120 +2282,6 @@ public class openssl_h {
throw new AssertionError("should not reach here", ex$);
}
}
- /**
- * {@snippet lang=c :
- * X509* PEM_read_bio_X509_AUX(BIO* out, X509** x, pem_password_cb* cb,
void* u);
- * }
- */
- public static MethodHandle PEM_read_bio_X509_AUX$MH() {
- class Holder {
- static final FunctionDescriptor DESC = FunctionDescriptor.of(
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER
- );
-
- static final MethodHandle MH =
RuntimeHelper.downcallHandle("PEM_read_bio_X509_AUX", DESC);
- }
- return RuntimeHelper.requireNonNull(Holder.MH,
"PEM_read_bio_X509_AUX");
- }
-
- public static MemorySegment PEM_read_bio_X509_AUX(MemorySegment out,
MemorySegment x, MemorySegment cb, MemorySegment u) {
- var mh$ = PEM_read_bio_X509_AUX$MH();
- try {
- return (MemorySegment) mh$.invokeExact(out, x, cb, u);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- }
- /**
- * {@snippet lang=c :
- * EC_GROUP* PEM_read_bio_ECPKParameters(BIO* out, EC_GROUP** x,
pem_password_cb* cb, void* u);
- * }
- */
- public static MethodHandle PEM_read_bio_ECPKParameters$MH() {
- class Holder {
- static final FunctionDescriptor DESC = FunctionDescriptor.of(
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER
- );
-
- static final MethodHandle MH =
RuntimeHelper.downcallHandle("PEM_read_bio_ECPKParameters", DESC);
- }
- return RuntimeHelper.requireNonNull(Holder.MH,
"PEM_read_bio_ECPKParameters");
- }
-
- @Deprecated
- public static MemorySegment PEM_read_bio_ECPKParameters(MemorySegment out,
MemorySegment x, MemorySegment cb, MemorySegment u) {
- var mh$ = PEM_read_bio_ECPKParameters$MH();
- try {
- return (MemorySegment) mh$.invokeExact(out, x, cb, u);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- }
- /**
- * {@snippet lang=c :
- * DH* PEM_read_bio_DHparams(BIO* out, DH** x, pem_password_cb* cb, void*
u);
- * }
- */
- public static MethodHandle PEM_read_bio_DHparams$MH() {
- class Holder {
- static final FunctionDescriptor DESC = FunctionDescriptor.of(
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER
- );
-
- static final MethodHandle MH =
RuntimeHelper.downcallHandle("PEM_read_bio_DHparams", DESC);
- }
- return RuntimeHelper.requireNonNull(Holder.MH,
"PEM_read_bio_DHparams");
- }
-
- @Deprecated
- public static MemorySegment PEM_read_bio_DHparams(MemorySegment out,
MemorySegment x, MemorySegment cb, MemorySegment u) {
- var mh$ = PEM_read_bio_DHparams$MH();
- try {
- return (MemorySegment) mh$.invokeExact(out, x, cb, u);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- }
- /**
- * {@snippet lang=c :
- * EVP_PKEY* PEM_read_bio_PrivateKey(BIO* out, EVP_PKEY** x,
pem_password_cb* cb, void* u);
- * }
- */
- public static MethodHandle PEM_read_bio_PrivateKey$MH() {
- class Holder {
- static final FunctionDescriptor DESC = FunctionDescriptor.of(
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER
- );
-
- static final MethodHandle MH =
RuntimeHelper.downcallHandle("PEM_read_bio_PrivateKey", DESC);
- }
- return RuntimeHelper.requireNonNull(Holder.MH,
"PEM_read_bio_PrivateKey");
- }
-
- public static MemorySegment PEM_read_bio_PrivateKey(MemorySegment out,
MemorySegment x, MemorySegment cb, MemorySegment u) {
- var mh$ = PEM_read_bio_PrivateKey$MH();
- try {
- return (MemorySegment) mh$.invokeExact(out, x, cb, u);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- }
/**
* {@snippet lang=c :
* EVP_PKEY* PEM_read_bio_Parameters(BIO* bp, EVP_PKEY** x);
@@ -4495,30 +4305,6 @@ public class openssl_h {
throw new AssertionError("should not reach here", ex$);
}
}
- /**
- * {@snippet lang=c :
- * void PKCS12_free(PKCS12* a);
- * }
- */
- public static MethodHandle PKCS12_free$MH() {
- class Holder {
- static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid(
- RuntimeHelper.POINTER
- );
-
- static final MethodHandle MH =
RuntimeHelper.downcallHandle("PKCS12_free", DESC);
- }
- return RuntimeHelper.requireNonNull(Holder.MH, "PKCS12_free");
- }
-
- public static void PKCS12_free(MemorySegment a) {
- var mh$ = PKCS12_free$MH();
- try {
- mh$.invokeExact(a);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- }
/**
* {@snippet lang=c :
* int PKCS12_parse(PKCS12* p12, char* pass, EVP_PKEY** pkey, X509** cert,
struct stack_st_X509** ca);
@@ -4997,178 +4783,6 @@ public class openssl_h {
throw new AssertionError("should not reach here", ex$);
}
}
- /**
- * {@snippet lang=c :
- * void OCSP_BASICRESP_free(OCSP_BASICRESP* a);
- * }
- */
- public static MethodHandle OCSP_BASICRESP_free$MH() {
- class Holder {
- static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid(
- RuntimeHelper.POINTER
- );
-
- static final MethodHandle MH =
RuntimeHelper.downcallHandle("OCSP_BASICRESP_free", DESC);
- }
- return RuntimeHelper.requireNonNull(Holder.MH, "OCSP_BASICRESP_free");
- }
-
- public static void OCSP_BASICRESP_free(MemorySegment a) {
- var mh$ = OCSP_BASICRESP_free$MH();
- try {
- mh$.invokeExact(a);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- }
- /**
- * {@snippet lang=c :
- * void OCSP_RESPONSE_free(OCSP_RESPONSE* a);
- * }
- */
- public static MethodHandle OCSP_RESPONSE_free$MH() {
- class Holder {
- static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid(
- RuntimeHelper.POINTER
- );
-
- static final MethodHandle MH =
RuntimeHelper.downcallHandle("OCSP_RESPONSE_free", DESC);
- }
- return RuntimeHelper.requireNonNull(Holder.MH, "OCSP_RESPONSE_free");
- }
-
- public static void OCSP_RESPONSE_free(MemorySegment a) {
- var mh$ = OCSP_RESPONSE_free$MH();
- try {
- mh$.invokeExact(a);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- }
- /**
- * {@snippet lang=c :
- * OCSP_RESPONSE* d2i_OCSP_RESPONSE(OCSP_RESPONSE** a, unsigned char** in,
long len);
- * }
- */
- public static MethodHandle d2i_OCSP_RESPONSE$MH() {
- class Holder {
- static final FunctionDescriptor DESC = FunctionDescriptor.of(
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER,
- JAVA_LONG
- );
-
- static final MethodHandle MH =
RuntimeHelper.downcallHandle("d2i_OCSP_RESPONSE", DESC);
- }
- return RuntimeHelper.requireNonNull(Holder.MH, "d2i_OCSP_RESPONSE");
- }
-
- public static MemorySegment d2i_OCSP_RESPONSE(MemorySegment a,
MemorySegment in, long len) {
- var mh$ = d2i_OCSP_RESPONSE$MH();
- try {
- return (MemorySegment) mh$.invokeExact(a, in, len);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- }
- /**
- * {@snippet lang=c :
- * void OCSP_CERTID_free(OCSP_CERTID* a);
- * }
- */
- public static MethodHandle OCSP_CERTID_free$MH() {
- class Holder {
- static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid(
- RuntimeHelper.POINTER
- );
-
- static final MethodHandle MH =
RuntimeHelper.downcallHandle("OCSP_CERTID_free", DESC);
- }
- return RuntimeHelper.requireNonNull(Holder.MH, "OCSP_CERTID_free");
- }
-
- public static void OCSP_CERTID_free(MemorySegment a) {
- var mh$ = OCSP_CERTID_free$MH();
- try {
- mh$.invokeExact(a);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- }
- /**
- * {@snippet lang=c :
- * OCSP_REQUEST* OCSP_REQUEST_new();
- * }
- */
- public static MethodHandle OCSP_REQUEST_new$MH() {
- class Holder {
- static final FunctionDescriptor DESC = FunctionDescriptor.of(
- RuntimeHelper.POINTER );
-
- static final MethodHandle MH =
RuntimeHelper.downcallHandle("OCSP_REQUEST_new", DESC);
- }
- return RuntimeHelper.requireNonNull(Holder.MH, "OCSP_REQUEST_new");
- }
-
- public static MemorySegment OCSP_REQUEST_new() {
- var mh$ = OCSP_REQUEST_new$MH();
- try {
- return (MemorySegment) mh$.invokeExact();
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- }
- /**
- * {@snippet lang=c :
- * void OCSP_REQUEST_free(OCSP_REQUEST* a);
- * }
- */
- public static MethodHandle OCSP_REQUEST_free$MH() {
- class Holder {
- static final FunctionDescriptor DESC = FunctionDescriptor.ofVoid(
- RuntimeHelper.POINTER
- );
-
- static final MethodHandle MH =
RuntimeHelper.downcallHandle("OCSP_REQUEST_free", DESC);
- }
- return RuntimeHelper.requireNonNull(Holder.MH, "OCSP_REQUEST_free");
- }
-
- public static void OCSP_REQUEST_free(MemorySegment a) {
- var mh$ = OCSP_REQUEST_free$MH();
- try {
- mh$.invokeExact(a);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- }
- /**
- * {@snippet lang=c :
- * int i2d_OCSP_REQUEST(const OCSP_REQUEST* a, unsigned char** out);
- * }
- */
- public static MethodHandle i2d_OCSP_REQUEST$MH() {
- class Holder {
- static final FunctionDescriptor DESC = FunctionDescriptor.of(
- JAVA_INT,
- RuntimeHelper.POINTER,
- RuntimeHelper.POINTER
- );
-
- static final MethodHandle MH =
RuntimeHelper.downcallHandle("i2d_OCSP_REQUEST", DESC);
- }
- return RuntimeHelper.requireNonNull(Holder.MH, "i2d_OCSP_REQUEST");
- }
-
- public static int i2d_OCSP_REQUEST(MemorySegment a, MemorySegment out) {
- var mh$ = i2d_OCSP_REQUEST$MH();
- try {
- return (int) mh$.invokeExact(a, out);
- } catch (Throwable ex$) {
- throw new AssertionError("should not reach here", ex$);
- }
- }
/**
* {@snippet lang=c :
* char* OSSL_PROVIDER_get0_name(const OSSL_PROVIDER* prov);
diff --git a/java/org/apache/tomcat/util/openssl/openssl_h_Macros.java
b/java/org/apache/tomcat/util/openssl/openssl_h_Macros.java
index 8605351924..77ab94133d 100644
--- a/java/org/apache/tomcat/util/openssl/openssl_h_Macros.java
+++ b/java/org/apache/tomcat/util/openssl/openssl_h_Macros.java
@@ -17,7 +17,10 @@
package org.apache.tomcat.util.openssl;
+import java.lang.foreign.FunctionDescriptor;
import java.lang.foreign.MemorySegment;
+import java.lang.foreign.ValueLayout;
+import java.lang.invoke.MethodHandle;
import static org.apache.tomcat.util.openssl.openssl_h.*;
@@ -59,7 +62,7 @@ public class openssl_h_Macros {
* Get the session cache size. # define
SSL_CTX_sess_get_cache_size(sslCtx) \ SSL_CTX_ctrl(sslCtx,
* SSL_CTRL_GET_SESS_CACHE_SIZE, 0, NULL)
*
- * @param sslCtx the SSL context
+ * @param sslCtx the SSL context
*
* @return > 0 if successful
*/
@@ -244,5 +247,352 @@ public class openssl_h_Macros {
return X509_LOOKUP_ctrl(x509Lookup, X509_L_FILE_LOAD(), name,
X509_FILETYPE_PEM(), MemorySegment.NULL);
}
+ // Other symbols that have questionable visibility from jextract
+
+ /**
+ * {@snippet lang = c : * void X509_free(X509* a);
+ * }
+ */
+ public static MethodHandle X509_free$MH() {
+ class Holder {
+ static final FunctionDescriptor DESC =
FunctionDescriptor.ofVoid(RuntimeHelper.POINTER);
+
+ static final MethodHandle MH =
RuntimeHelper.downcallHandle("X509_free", DESC);
+ }
+ return RuntimeHelper.requireNonNull(Holder.MH, "X509_free");
+ }
+
+ public static void X509_free(MemorySegment a) {
+ var mh$ = X509_free$MH();
+ try {
+ mh$.invokeExact(a);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+
+ /**
+ * {@snippet lang = c : * X509* d2i_X509(X509** a, unsigned char** in,
long len);
+ * }
+ */
+ public static MethodHandle d2i_X509$MH() {
+ class Holder {
+ static final FunctionDescriptor DESC =
FunctionDescriptor.of(RuntimeHelper.POINTER, RuntimeHelper.POINTER,
+ RuntimeHelper.POINTER, ValueLayout.JAVA_LONG);
+
+ static final MethodHandle MH =
RuntimeHelper.downcallHandle("d2i_X509", DESC);
+ }
+ return RuntimeHelper.requireNonNull(Holder.MH, "d2i_X509");
+ }
+
+ public static MemorySegment d2i_X509(MemorySegment a, MemorySegment in,
long len) {
+ var mh$ = d2i_X509$MH();
+ try {
+ return (MemorySegment) mh$.invokeExact(a, in, len);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+
+ /**
+ * {@snippet lang = c : * int i2d_X509(const X509* a, unsigned char** out);
+ * }
+ */
+ public static MethodHandle i2d_X509$MH() {
+ class Holder {
+ static final FunctionDescriptor DESC =
FunctionDescriptor.of(ValueLayout.JAVA_INT, RuntimeHelper.POINTER,
+ RuntimeHelper.POINTER);
+
+ static final MethodHandle MH =
RuntimeHelper.downcallHandle("i2d_X509", DESC);
+ }
+ return RuntimeHelper.requireNonNull(Holder.MH, "i2d_X509");
+ }
+
+ public static int i2d_X509(MemorySegment a, MemorySegment out) {
+ var mh$ = i2d_X509$MH();
+ try {
+ return (int) mh$.invokeExact(a, out);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+
+ /**
+ * {@snippet lang = c : * X509* PEM_read_bio_X509_AUX(BIO* out, X509** x,
pem_password_cb* cb, void* u);
+ * }
+ */
+ public static MethodHandle PEM_read_bio_X509_AUX$MH() {
+ class Holder {
+ static final FunctionDescriptor DESC =
FunctionDescriptor.of(RuntimeHelper.POINTER, RuntimeHelper.POINTER,
+ RuntimeHelper.POINTER, RuntimeHelper.POINTER,
RuntimeHelper.POINTER);
+
+ static final MethodHandle MH =
RuntimeHelper.downcallHandle("PEM_read_bio_X509_AUX", DESC);
+ }
+ return RuntimeHelper.requireNonNull(Holder.MH,
"PEM_read_bio_X509_AUX");
+ }
+
+ public static MemorySegment PEM_read_bio_X509_AUX(MemorySegment out,
MemorySegment x, MemorySegment cb,
+ MemorySegment u) {
+ var mh$ = PEM_read_bio_X509_AUX$MH();
+ try {
+ return (MemorySegment) mh$.invokeExact(out, x, cb, u);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+
+ /**
+ * {@snippet lang = c
+ * : * EC_GROUP* PEM_read_bio_ECPKParameters(BIO* out, EC_GROUP** x,
pem_password_cb* cb, void* u);
+ * }
+ */
+ public static MethodHandle PEM_read_bio_ECPKParameters$MH() {
+ class Holder {
+ static final FunctionDescriptor DESC =
FunctionDescriptor.of(RuntimeHelper.POINTER, RuntimeHelper.POINTER,
+ RuntimeHelper.POINTER, RuntimeHelper.POINTER,
RuntimeHelper.POINTER);
+
+ static final MethodHandle MH =
RuntimeHelper.downcallHandle("PEM_read_bio_ECPKParameters", DESC);
+ }
+ return RuntimeHelper.requireNonNull(Holder.MH,
"PEM_read_bio_ECPKParameters");
+ }
+
+ @Deprecated
+ public static MemorySegment PEM_read_bio_ECPKParameters(MemorySegment out,
MemorySegment x, MemorySegment cb,
+ MemorySegment u) {
+ var mh$ = PEM_read_bio_ECPKParameters$MH();
+ try {
+ return (MemorySegment) mh$.invokeExact(out, x, cb, u);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+
+ /**
+ * {@snippet lang = c : * DH* PEM_read_bio_DHparams(BIO* out, DH** x,
pem_password_cb* cb, void* u);
+ * }
+ */
+ public static MethodHandle PEM_read_bio_DHparams$MH() {
+ class Holder {
+ static final FunctionDescriptor DESC =
FunctionDescriptor.of(RuntimeHelper.POINTER, RuntimeHelper.POINTER,
+ RuntimeHelper.POINTER, RuntimeHelper.POINTER,
RuntimeHelper.POINTER);
+
+ static final MethodHandle MH =
RuntimeHelper.downcallHandle("PEM_read_bio_DHparams", DESC);
+ }
+ return RuntimeHelper.requireNonNull(Holder.MH,
"PEM_read_bio_DHparams");
+ }
+
+ @Deprecated
+ public static MemorySegment PEM_read_bio_DHparams(MemorySegment out,
MemorySegment x, MemorySegment cb,
+ MemorySegment u) {
+ var mh$ = PEM_read_bio_DHparams$MH();
+ try {
+ return (MemorySegment) mh$.invokeExact(out, x, cb, u);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+
+ /**
+ * {@snippet lang = c : * EVP_PKEY* PEM_read_bio_PrivateKey(BIO* out,
EVP_PKEY** x, pem_password_cb* cb, void* u);
+ * }
+ */
+ public static MethodHandle PEM_read_bio_PrivateKey$MH() {
+ class Holder {
+ static final FunctionDescriptor DESC =
FunctionDescriptor.of(RuntimeHelper.POINTER, RuntimeHelper.POINTER,
+ RuntimeHelper.POINTER, RuntimeHelper.POINTER,
RuntimeHelper.POINTER);
+
+ static final MethodHandle MH =
RuntimeHelper.downcallHandle("PEM_read_bio_PrivateKey", DESC);
+ }
+ return RuntimeHelper.requireNonNull(Holder.MH,
"PEM_read_bio_PrivateKey");
+ }
+
+ public static MemorySegment PEM_read_bio_PrivateKey(MemorySegment out,
MemorySegment x, MemorySegment cb,
+ MemorySegment u) {
+ var mh$ = PEM_read_bio_PrivateKey$MH();
+ try {
+ return (MemorySegment) mh$.invokeExact(out, x, cb, u);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+
+ /**
+ * {@snippet lang = c : * void PKCS12_free(PKCS12* a);
+ * }
+ */
+ public static MethodHandle PKCS12_free$MH() {
+ class Holder {
+ static final FunctionDescriptor DESC =
FunctionDescriptor.ofVoid(RuntimeHelper.POINTER);
+
+ static final MethodHandle MH =
RuntimeHelper.downcallHandle("PKCS12_free", DESC);
+ }
+ return RuntimeHelper.requireNonNull(Holder.MH, "PKCS12_free");
+ }
+
+ public static void PKCS12_free(MemorySegment a) {
+ var mh$ = PKCS12_free$MH();
+ try {
+ mh$.invokeExact(a);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+
+
+ /**
+ * {@snippet lang = c : * void OCSP_BASICRESP_free(OCSP_BASICRESP* a);
+ * }
+ */
+ public static MethodHandle OCSP_BASICRESP_free$MH() {
+ class Holder {
+ static final FunctionDescriptor DESC =
FunctionDescriptor.ofVoid(RuntimeHelper.POINTER);
+
+ static final MethodHandle MH =
RuntimeHelper.downcallHandle("OCSP_BASICRESP_free", DESC);
+ }
+ return RuntimeHelper.requireNonNull(Holder.MH, "OCSP_BASICRESP_free");
+ }
+
+ public static void OCSP_BASICRESP_free(MemorySegment a) {
+ var mh$ = OCSP_BASICRESP_free$MH();
+ try {
+ mh$.invokeExact(a);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+
+ /**
+ * {@snippet lang = c : * void OCSP_RESPONSE_free(OCSP_RESPONSE* a);
+ * }
+ */
+ public static MethodHandle OCSP_RESPONSE_free$MH() {
+ class Holder {
+ static final FunctionDescriptor DESC =
FunctionDescriptor.ofVoid(RuntimeHelper.POINTER);
+
+ static final MethodHandle MH =
RuntimeHelper.downcallHandle("OCSP_RESPONSE_free", DESC);
+ }
+ return RuntimeHelper.requireNonNull(Holder.MH, "OCSP_RESPONSE_free");
+ }
+
+ public static void OCSP_RESPONSE_free(MemorySegment a) {
+ var mh$ = OCSP_RESPONSE_free$MH();
+ try {
+ mh$.invokeExact(a);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+
+ /**
+ * {@snippet lang = c : * OCSP_RESPONSE* d2i_OCSP_RESPONSE(OCSP_RESPONSE**
a, unsigned char** in, long len);
+ * }
+ */
+ public static MethodHandle d2i_OCSP_RESPONSE$MH() {
+ class Holder {
+ static final FunctionDescriptor DESC =
FunctionDescriptor.of(RuntimeHelper.POINTER, RuntimeHelper.POINTER,
+ RuntimeHelper.POINTER, ValueLayout.JAVA_LONG);
+
+ static final MethodHandle MH =
RuntimeHelper.downcallHandle("d2i_OCSP_RESPONSE", DESC);
+ }
+ return RuntimeHelper.requireNonNull(Holder.MH, "d2i_OCSP_RESPONSE");
+ }
+
+ public static MemorySegment d2i_OCSP_RESPONSE(MemorySegment a,
MemorySegment in, long len) {
+ var mh$ = d2i_OCSP_RESPONSE$MH();
+ try {
+ return (MemorySegment) mh$.invokeExact(a, in, len);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+
+ /**
+ * {@snippet lang = c : * void OCSP_CERTID_free(OCSP_CERTID* a);
+ * }
+ */
+ public static MethodHandle OCSP_CERTID_free$MH() {
+ class Holder {
+ static final FunctionDescriptor DESC =
FunctionDescriptor.ofVoid(RuntimeHelper.POINTER);
+
+ static final MethodHandle MH =
RuntimeHelper.downcallHandle("OCSP_CERTID_free", DESC);
+ }
+ return RuntimeHelper.requireNonNull(Holder.MH, "OCSP_CERTID_free");
+ }
+
+ public static void OCSP_CERTID_free(MemorySegment a) {
+ var mh$ = OCSP_CERTID_free$MH();
+ try {
+ mh$.invokeExact(a);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+
+ /**
+ * {@snippet lang = c : * OCSP_REQUEST* OCSP_REQUEST_new();
+ * }
+ */
+ public static MethodHandle OCSP_REQUEST_new$MH() {
+ class Holder {
+ static final FunctionDescriptor DESC =
FunctionDescriptor.of(RuntimeHelper.POINTER);
+
+ static final MethodHandle MH =
RuntimeHelper.downcallHandle("OCSP_REQUEST_new", DESC);
+ }
+ return RuntimeHelper.requireNonNull(Holder.MH, "OCSP_REQUEST_new");
+ }
+
+ public static MemorySegment OCSP_REQUEST_new() {
+ var mh$ = OCSP_REQUEST_new$MH();
+ try {
+ return (MemorySegment) mh$.invokeExact();
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+
+ /**
+ * {@snippet lang = c : * void OCSP_REQUEST_free(OCSP_REQUEST* a);
+ * }
+ */
+ public static MethodHandle OCSP_REQUEST_free$MH() {
+ class Holder {
+ static final FunctionDescriptor DESC =
FunctionDescriptor.ofVoid(RuntimeHelper.POINTER);
+
+ static final MethodHandle MH =
RuntimeHelper.downcallHandle("OCSP_REQUEST_free", DESC);
+ }
+ return RuntimeHelper.requireNonNull(Holder.MH, "OCSP_REQUEST_free");
+ }
+
+ public static void OCSP_REQUEST_free(MemorySegment a) {
+ var mh$ = OCSP_REQUEST_free$MH();
+ try {
+ mh$.invokeExact(a);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
+
+ /**
+ * {@snippet lang = c : * int i2d_OCSP_REQUEST(const OCSP_REQUEST* a,
unsigned char** out);
+ * }
+ */
+ public static MethodHandle i2d_OCSP_REQUEST$MH() {
+ class Holder {
+ static final FunctionDescriptor DESC =
FunctionDescriptor.of(ValueLayout.JAVA_INT, RuntimeHelper.POINTER,
+ RuntimeHelper.POINTER);
+
+ static final MethodHandle MH =
RuntimeHelper.downcallHandle("i2d_OCSP_REQUEST", DESC);
+ }
+ return RuntimeHelper.requireNonNull(Holder.MH, "i2d_OCSP_REQUEST");
+ }
+
+ public static int i2d_OCSP_REQUEST(MemorySegment a, MemorySegment out) {
+ var mh$ = i2d_OCSP_REQUEST$MH();
+ try {
+ return (int) mh$.invokeExact(a, out);
+ } catch (Throwable ex$) {
+ throw new AssertionError("should not reach here", ex$);
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]