Skip to content

Commit

Permalink
Same but avoiding the visibility hack
Browse files Browse the repository at this point in the history
  • Loading branch information
rmaucher committed Feb 23, 2024
1 parent fe073bc commit 0d51ce7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ private boolean addCertificate(SSLHostConfigCertificate certificate, Arena local
// Set callback for DH parameters
SSL_CTX_set_tmp_dh_callback(state.sslCtx, SSL_CTX_set_tmp_dh_callback$dh.allocate(new TmpDHCallback(), contextArena));
} else {
var d2i_ECPKParameters = openssl_h_Macros.findOrThrow("d2i_ECPKParameters");
var d2i_ECPKParameters = openssl_h_Macros.d2i_ECPKParameters$SYMBOL();
var ecparams = PEM_ASN1_read_bio(d2i_ECPKParameters,
PEM_STRING_ECPARAMETERS(), certificateBIO, MemorySegment.NULL, MemorySegment.NULL, MemorySegment.NULL);
if (!MemorySegment.NULL.equals(ecparams)) {
Expand Down
20 changes: 10 additions & 10 deletions java/org/apache/tomcat/util/openssl/openssl_h_Macros.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@
public class openssl_h_Macros {


/**
* Publicly accessible find.
* @param symbol the symbol to find
* @return the symbol
*/
public static MemorySegment findOrThrow(String symbol) {
return openssl_h.findOrThrow(symbol);
}


/**
* Set maximum protocol version on the given context.
* {@snippet lang = c : # define SSL_CTX_set_max_proto_version(sslCtx, version) \
Expand Down Expand Up @@ -273,6 +263,7 @@ public static long X509_LOOKUP_add_dir(MemorySegment x509Lookup, MemorySegment n
return X509_LOOKUP_ctrl(x509Lookup, X509_L_ADD_DIR(), name, X509_FILETYPE_PEM(), MemorySegment.NULL);
}


/**
* Pass a file which will be loaded into the store.
* {@snippet lang = c : # define X509_LOOKUP_load_file(x,name,type) \
Expand All @@ -289,5 +280,14 @@ public static long X509_LOOKUP_load_file(MemorySegment x509Lookup, MemorySegment
return X509_LOOKUP_ctrl(x509Lookup, X509_L_FILE_LOAD(), name, X509_FILETYPE_PEM(), MemorySegment.NULL);
}


/**
* Return the d2i_ECPKParameters symbol.
* @return the symbol
*/
public static MemorySegment d2i_ECPKParameters$SYMBOL() {
return openssl_h.findOrThrow("d2i_ECPKParameters");
}

}

0 comments on commit 0d51ce7

Please sign in to comment.