-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
591 additions
and
246 deletions.
There are no files selected for viewing
356 changes: 167 additions & 189 deletions
356
...enssl-foreign/src/main/java/org/apache/tomcat/util/net/openssl/panama/OpenSSLContext.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...l-foreign/src/main/java/org/apache/tomcat/util/openssl/SSL_CTX_set_alpn_select_cb$cb.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* 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.invoke.MethodHandle; | ||
import java.lang.foreign.*; | ||
import static java.lang.foreign.ValueLayout.*; | ||
|
||
/** | ||
* {@snippet lang = c | ||
* : * int (*SSL_CTX_set_alpn_select_cb$cb)(struct ssl_st*,unsigned char**,unsigned char*,unsigned char*,unsigned int,void*); | ||
* } | ||
*/ | ||
public interface SSL_CTX_set_alpn_select_cb$cb { | ||
|
||
FunctionDescriptor $DESC = FunctionDescriptor.of(JAVA_INT, openssl_h.C_POINTER, openssl_h.C_POINTER, | ||
openssl_h.C_POINTER, openssl_h.C_POINTER, JAVA_INT, openssl_h.C_POINTER); | ||
|
||
int apply(MemorySegment _x0, MemorySegment _x1, MemorySegment _x2, MemorySegment _x3, int _x4, MemorySegment _x5); | ||
|
||
MethodHandle UP$MH = openssl_h.upcallHandle(SSL_CTX_set_alpn_select_cb$cb.class, "apply", $DESC); | ||
|
||
static MemorySegment allocate(SSL_CTX_set_alpn_select_cb$cb fi, Arena scope) { | ||
return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, scope); | ||
} | ||
|
||
MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); | ||
|
||
static SSL_CTX_set_alpn_select_cb$cb ofAddress(MemorySegment addr, Arena arena) { | ||
MemorySegment symbol = addr.reinterpret(arena, null); | ||
return (MemorySegment __x0, MemorySegment __x1, MemorySegment __x2, MemorySegment __x3, int __x4, | ||
MemorySegment __x5) -> { | ||
try { | ||
return (int) DOWN$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5); | ||
} catch (Throwable ex$) { | ||
throw new AssertionError("should not reach here", ex$); | ||
} | ||
}; | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...ign/src/main/java/org/apache/tomcat/util/openssl/SSL_CTX_set_cert_verify_callback$cb.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* 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.invoke.MethodHandle; | ||
import java.lang.foreign.*; | ||
import static java.lang.foreign.ValueLayout.*; | ||
|
||
/** | ||
* {@snippet lang = c : * int (*SSL_CTX_set_cert_verify_callback$cb)(struct x509_store_ctx_st*,void*); | ||
* } | ||
*/ | ||
public interface SSL_CTX_set_cert_verify_callback$cb { | ||
|
||
FunctionDescriptor $DESC = FunctionDescriptor.of(JAVA_INT, openssl_h.C_POINTER, openssl_h.C_POINTER); | ||
|
||
int apply(MemorySegment _x0, MemorySegment _x1); | ||
|
||
MethodHandle UP$MH = openssl_h.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 Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, scope); | ||
} | ||
|
||
MethodHandle DOWN$MH = Linker.nativeLinker().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$); | ||
} | ||
}; | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
...oreign/src/main/java/org/apache/tomcat/util/openssl/SSL_CTX_set_default_passwd_cb$cb.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* 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.invoke.MethodHandle; | ||
import java.lang.foreign.*; | ||
import static java.lang.foreign.ValueLayout.*; | ||
|
||
/** | ||
* {@snippet lang = c : * int (*SSL_CTX_set_default_passwd_cb$cb)(char*,int,int,void*); | ||
* } | ||
*/ | ||
public interface SSL_CTX_set_default_passwd_cb$cb { | ||
|
||
FunctionDescriptor $DESC = FunctionDescriptor.of(JAVA_INT, openssl_h.C_POINTER, JAVA_INT, JAVA_INT, | ||
openssl_h.C_POINTER); | ||
|
||
int apply(MemorySegment _x0, int _x1, int _x2, MemorySegment _x3); | ||
|
||
MethodHandle UP$MH = openssl_h.upcallHandle(SSL_CTX_set_default_passwd_cb$cb.class, "apply", $DESC); | ||
|
||
static MemorySegment allocate(SSL_CTX_set_default_passwd_cb$cb fi, Arena scope) { | ||
return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, scope); | ||
} | ||
|
||
MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC); | ||
|
||
static SSL_CTX_set_default_passwd_cb$cb ofAddress(MemorySegment addr, Arena arena) { | ||
MemorySegment symbol = addr.reinterpret(arena, null); | ||
return (MemorySegment __x0, int __x1, int __x2, MemorySegment __x3) -> { | ||
try { | ||
return (int) DOWN$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); | ||
} catch (Throwable ex$) { | ||
throw new AssertionError("should not reach here", ex$); | ||
} | ||
}; | ||
} | ||
} |
Oops, something went wrong.