]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl: remove static keyword in some SSL utility functions
authorWilliam Lallemand <wlallemand@haproxy.com>
Fri, 15 May 2020 07:52:16 +0000 (09:52 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 15 May 2020 12:11:54 +0000 (14:11 +0200)
In order to move the the sample fetches to another file, remove the
static keyword of some utility functions in the SSL fetches.

include/proto/ssl_sock.h
src/ssl_sock.c

index ccdb1988e8b56933315d5e5055dca8b54109b197..a01e29ef619828a27981c6a4ccec96239277f906 100644 (file)
@@ -114,6 +114,12 @@ void ssl_free_global_issuers(void);
 int ssl_sock_load_cert_list_file(char *file, int dir, struct bind_conf *bind_conf, struct proxy *curproxy, char **err);
 int ssl_init_single_engine(const char *engine_id, const char *def_algorithms);
 int ssl_store_load_locations_file(char *path);
+int ssl_sock_crt2der(X509 *crt, struct buffer *out);
+int ssl_sock_get_time(ASN1_TIME *tm, struct buffer *out);
+int ssl_sock_get_dn_formatted(X509_NAME *a, const struct buffer *format, struct buffer *out);
+int ssl_sock_get_dn_entry(X509_NAME *a, const struct buffer *entry, int pos,
+                          struct buffer *out);
+
 /* ssl shctx macro */
 
 #define sh_ssl_sess_tree_delete(s)     ebmb_delete(&(s)->key);
index b4c56045b086bcdfabcf10249d23f49817f756de..e0326c03730127efad651dca15c1d424885c38be 100644 (file)
@@ -6005,8 +6005,7 @@ int ssl_sock_get_serial(X509 *crt, struct buffer *out)
  * Returns 1 if the cert is found and copied, 0 on der conversion failure
  * and -1 if the output is not large enough.
  */
-static int
-ssl_sock_crt2der(X509 *crt, struct buffer *out)
+int ssl_sock_crt2der(X509 *crt, struct buffer *out)
 {
        int len;
        unsigned char *p = (unsigned char *) out->area;;
@@ -6028,8 +6027,7 @@ ssl_sock_crt2der(X509 *crt, struct buffer *out)
  * Returns 1 if serial is found and copied, 0 if no valid time found
  * and -1 if output is not large enough.
  */
-static int
-ssl_sock_get_time(ASN1_TIME *tm, struct buffer *out)
+int ssl_sock_get_time(ASN1_TIME *tm, struct buffer *out)
 {
        if (tm->type == V_ASN1_GENERALIZEDTIME) {
                ASN1_GENERALIZEDTIME *gentm = (ASN1_GENERALIZEDTIME *)tm;
@@ -6066,9 +6064,8 @@ ssl_sock_get_time(ASN1_TIME *tm, struct buffer *out)
 /* Extract an entry from a X509_NAME and copy its value to an output chunk.
  * Returns 1 if entry found, 0 if entry not found, or -1 if output not large enough.
  */
-static int
-ssl_sock_get_dn_entry(X509_NAME *a, const struct buffer *entry, int pos,
-                     struct buffer *out)
+int ssl_sock_get_dn_entry(X509_NAME *a, const struct buffer *entry, int pos,
+                          struct buffer *out)
 {
        X509_NAME_ENTRY *ne;
        ASN1_OBJECT *obj;
@@ -6129,8 +6126,7 @@ ssl_sock_get_dn_entry(X509_NAME *a, const struct buffer *entry, int pos,
  * Currently supports rfc2253 for returning LDAP V3 DNs.
  * Returns 1 if dn entries exist, 0 if no dn entry was found.
  */
-static int
-ssl_sock_get_dn_formatted(X509_NAME *a, const struct buffer *format, struct buffer *out)
+int ssl_sock_get_dn_formatted(X509_NAME *a, const struct buffer *format, struct buffer *out)
 {
        BIO *bio = NULL;
        int ret = 0;