From: David Woodhouse Date: Fri, 8 Jun 2012 01:56:17 +0000 (+0100) Subject: Bump library soname to libopenconnect.so.2 X-Git-Tag: v3.99~68 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3c4a1a2785a5895667622e754ca81c03f9bcc37c;p=platform%2Fupstream%2Fopenconnect.git Bump library soname to libopenconnect.so.2 With this, the certificates are now an opaque type and callers are not permitted to access them directly. Take the opportunity to also rename openconnect_init_openssl() to openconnect_init_ssl(). Signed-off-by: David Woodhouse --- diff --git a/configure.ac b/configure.ac index 4382dbc..a5aad75 100644 --- a/configure.ac +++ b/configure.ac @@ -245,13 +245,11 @@ case "$ssl_library" in AC_DEFINE(OPENCONNECT_GNUTLS, 1) AC_SUBST(SSL_LIBS, [$GNUTLS_LIBS]) AC_SUBST(SSL_CFLAGS, [$GNUTLS_CFLAGS]) - AC_SUBST(SSL_DEFINE, [-DOPENCONNECT_GNUTLS]) ;; openssl) AC_DEFINE(OPENCONNECT_OPENSSL, 1) AC_SUBST(SSL_LIBS, [$OPENSSL_LIBS]) AC_SUBST(SSL_CFLAGS, [$OPENSSL_CFLAGS]) - AC_SUBST(SSL_DEFINE, [-DOPENCONNECT_OPENSSL]) ;; *) AC_MSG_ERROR([Neither OpenSSL nor GnuTLS selected for SSL.]) @@ -370,7 +368,7 @@ else fi AM_CONDITIONAL(BUILD_WWW, [test -n "${ac_cv_path_PYTHON}"]) -AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/po/LINGUAS $(top_srcdir)/openconnect.h']) +AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/po/LINGUAS $(top_srcdir)/openconnect.h ${top_srcdir}/libopenconnect.map.in']) RAWLINGUAS=`sed -e "/^#/d" -e "s/#.*//" "${srcdir}/po/LINGUAS"` # Remove newlines LINGUAS=`echo $RAWLINGUAS` diff --git a/gnutls.c b/gnutls.c index c988b0b..66b83c9 100644 --- a/gnutls.c +++ b/gnutls.c @@ -1054,7 +1054,7 @@ void openconnect_close_https(struct openconnect_info *vpninfo) } } -void openconnect_init_openssl(void) +void openconnect_init_ssl(void) { gnutls_global_init(); } diff --git a/libopenconnect.map.in b/libopenconnect.map.in index f341e8e..2884ec3 100644 --- a/libopenconnect.map.in +++ b/libopenconnect.map.in @@ -1,4 +1,4 @@ -OPENCONNECT_1.0 { +OPENCONNECT_2.0 { global: openconnect_clear_cookie; openconnect_get_cert_sha1; @@ -8,7 +8,6 @@ OPENCONNECT_1.0 { openconnect_get_port; openconnect_get_urlpath; openconnect_get_version; - openconnect_init_openssl; openconnect_obtain_cookie; openconnect_parse_url; openconnect_passphrase_from_fsid; @@ -21,34 +20,14 @@ OPENCONNECT_1.0 { openconnect_set_urlpath; openconnect_set_xmlsha1; openconnect_vpninfo_new; - local: - *; -}; -OPENCONNECT_1.1 { - global: openconnect_vpninfo_free; -} OPENCONNECT_1.0; - -OPENCONNECT_1.2 { - global: openconnect_vpninfo_new_with_cbdata; -} OPENCONNECT_1.1; - -OPENCONNECT_1.3 { - global: openconnect_set_cert_expiry_warning; -} OPENCONNECT_1.2; - -OPENCONNECT_1.4 { - global: openconnect_set_cancel_fd; -} OPENCONNECT_1.3; - -OPENCONNECT_1.5 { - global: openconnect_get_cert_details; openconnect_get_cert_DER; -} OPENCONNECT_1.4; + openconnect_init_ssl; +}; OPENCONNECT_PRIVATE { global: @SYMVER_TIME@ @SYMVER_ASPRINTF@ @SYMVER_GETLINE@ @@ -62,4 +41,6 @@ OPENCONNECT_PRIVATE { openconnect_report_ssl_errors; openconnect_sha1; openconnect_random; + local: + *; }; diff --git a/main.c b/main.c index 34120bf..6f7f86c 100644 --- a/main.c +++ b/main.c @@ -400,7 +400,7 @@ int main(int argc, char **argv) openconnect_binary_version, openconnect_version_str); } - openconnect_init_openssl(); + openconnect_init_ssl(); vpninfo = malloc(sizeof(*vpninfo)); if (!vpninfo) { diff --git a/openconnect.h b/openconnect.h index e623a9a..4da98b2 100644 --- a/openconnect.h +++ b/openconnect.h @@ -30,10 +30,14 @@ #include #include -#define OPENCONNECT_API_VERSION_MAJOR 1 -#define OPENCONNECT_API_VERSION_MINOR 5 +#define OPENCONNECT_API_VERSION_MAJOR 2 +#define OPENCONNECT_API_VERSION_MINOR 0 /* + * API version 2.0: + * - OPENCONNECT_X509 is now an opaque type. + * - Rename openconnect_init_openssl() -> openconnect_init_ssl() + * * API version 1.5: * - Add openconnect_get_cert_details(), openconnect_get_cert_DER(). * @@ -123,17 +127,7 @@ struct oc_auth_form { struct openconnect_info; -#if defined (OPENCONNECT_OPENSSL) -struct x509_st; -#define OPENCONNECT_X509 struct x509_st -#elif defined (OPENCONNECT_GNUTLS) -struct gnutls_x509_crt_int; -#define OPENCONNECT_X509 struct gnutls_x509_crt_int -#else -#error You are not building correctly using pkg-config. -#endif - - +#define OPENCONNECT_X509 void /* Unless otherwise specified, all functions which set strings will take ownership of those strings and should free them later in openconnect_vpninfo_free() */ @@ -148,7 +142,7 @@ int openconnect_get_cert_DER(struct openconnect_info *vpninfo, int openconnect_set_http_proxy(struct openconnect_info *vpninfo, char *proxy); int openconnect_passphrase_from_fsid(struct openconnect_info *vpninfo); int openconnect_obtain_cookie(struct openconnect_info *vpninfo); -void openconnect_init_openssl(void); +void openconnect_init_ssl(void); char *openconnect_get_vpn_name (struct openconnect_info *); char *openconnect_get_hostname (struct openconnect_info *); diff --git a/openconnect.pc.in b/openconnect.pc.in index d513f3c..69a9e54 100644 --- a/openconnect.pc.in +++ b/openconnect.pc.in @@ -10,4 +10,4 @@ Version: @VERSION@ Requires: @LIBPROXY_PC@ zlib @SSL_LIBRARY@ @P11KIT_PC@ libxml-2.0 Libs: -L${libdir} -lopenconnect Libs.private: @LIBINTL@ -Cflags: -I${includedir} @SSL_DEFINE@ +Cflags: -I${includedir} diff --git a/openssl.c b/openssl.c index be01fde..fedad3d 100644 --- a/openssl.c +++ b/openssl.c @@ -51,7 +51,7 @@ int openconnect_sha1(unsigned char *result, void *data, int len) } int openconnect_get_cert_DER(struct openconnect_info *vpninfo, - struct x509_st *cert, unsigned char **buf) + OPENCONNECT_X509 *cert, unsigned char **buf) { BIO *bp = BIO_new(BIO_s_mem()); BUF_MEM *certinfo; @@ -703,7 +703,7 @@ static int load_certificate(struct openconnect_info *vpninfo) } static int get_cert_fingerprint(struct openconnect_info *vpninfo, - X509 *cert, const EVP_MD *type, + OPENCONNECT_X509 *cert, const EVP_MD *type, char *buf) { unsigned char md[EVP_MAX_MD_SIZE]; @@ -719,13 +719,13 @@ static int get_cert_fingerprint(struct openconnect_info *vpninfo, } int get_cert_md5_fingerprint(struct openconnect_info *vpninfo, - X509 *cert, char *buf) + OPENCONNECT_X509 *cert, char *buf) { return get_cert_fingerprint(vpninfo, cert, EVP_md5(), buf); } int openconnect_get_cert_sha1(struct openconnect_info *vpninfo, - X509 *cert, char *buf) + OPENCONNECT_X509 *cert, char *buf) { return get_cert_fingerprint(vpninfo, cert, EVP_sha1(), buf); } @@ -1302,7 +1302,7 @@ void openconnect_close_https(struct openconnect_info *vpninfo) } } -void openconnect_init_openssl(void) +void openconnect_init_ssl(void) { SSL_library_init (); ERR_clear_error (); @@ -1311,7 +1311,7 @@ void openconnect_init_openssl(void) } char *openconnect_get_cert_details(struct openconnect_info *vpninfo, - struct x509_st *cert) + OPENCONNECT_X509 *cert) { BIO *bp = BIO_new(BIO_s_mem()); BUF_MEM *certinfo;