Changeset 259e835 in mod_gnutls
- Timestamp:
- Apr 4, 2015, 4:57:10 PM (8 years ago)
- Branches:
- asyncio, debian/master, debian/stretch-backports, jessie-backports, main, master, proxy-ticket, upstream
- Children:
- c4a015b
- Parents:
- 1d9cfaf (diff), c32240f (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - git-author:
- Thomas Klute <thomas2.klute@…> (04/04/15 16:54:45)
- git-committer:
- Thomas Klute <thomas2.klute@…> (04/04/15 16:57:10)
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
configure.ac
r1d9cfaf r259e835 10 10 AM_MAINTAINER_MODE 11 11 AC_CANONICAL_TARGET 12 AM_INIT_AUTOMAKE (AC_PACKAGE_NAME, AC_PACKAGE_VERSION)12 AM_INIT_AUTOMAKE 13 13 AM_CONFIG_HEADER(include/mod_gnutls_config.h:config.in) 14 14 … … 42 42 fi 43 43 44 AC_ARG_ENABLE(strict, 45 AS_HELP_STRING([--disable-strict], 46 [Avoid strict compiler warnings and errors]), 47 use_strict=$enableval, use_strict=yes) 48 49 STRICT_CFLAGS="" 50 if test "$use_strict" != "no"; then 51 STRICT_CFLAGS="-Wall -Werror -Wextra" 52 fi 53 44 54 AC_MSG_CHECKING([whether to enable SRP functionality]) 45 55 AC_MSG_RESULT($use_srp) … … 66 76 AC_SUBST(have_apr_memcache) 67 77 68 MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${SRP_CFLAGS} ${MSVA_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES} "78 MODULE_CFLAGS="${LIBGNUTLS_CFLAGS} ${SRP_CFLAGS} ${MSVA_CFLAGS} ${APR_MEMCACHE_CFLAGS} ${APXS_CFLAGS} ${AP_INCLUDES} ${APR_INCLUDES} ${APU_INCLUDES} ${STRICT_CFLAGS}" 69 79 MODULE_LIBS="${APR_MEMCACHE_LIBS} ${LIBGNUTLS_LIBS}" 70 80 -
src/gnutls_config.c
r1d9cfaf r259e835 28 28 #endif 29 29 30 static int pin_callback(void *user, int attempt, const char *token_url, 31 const char *token_label, unsigned int flags, 32 char *pin, size_t pin_max) 30 static int pin_callback(void *user, int attempt __attribute__((unused)), 31 const char *token_url __attribute__((unused)), 32 const char *token_label, unsigned int flags, 33 char *pin, size_t pin_max) 33 34 { 34 35 mgs_srvconf_rec *sc = user; … … 174 175 goto cleanup; 175 176 } 176 177 177 178 178 ret = … … 574 574 575 575 const char *mgs_set_pgpcert_file(cmd_parms * parms, void *dummy __attribute__((unused)), 576 const char *arg) { 576 const char *arg) 577 { 577 578 mgs_srvconf_rec *sc = 578 579 (mgs_srvconf_rec *) ap_get_module_config(parms->server-> … … 839 840 } 840 841 841 const char *mgs_set_priorities(cmd_parms * parms, void *dummy __attribute__((unused)), const char *arg) {842 842 const char *mgs_set_priorities(cmd_parms * parms, void *dummy __attribute__((unused)), const char *arg) 843 { 843 844 mgs_srvconf_rec *sc = (mgs_srvconf_rec *) 844 845 ap_get_module_config(parms->server->module_config, &gnutls_module); … … 849 850 } 850 851 851 const char *mgs_set_pin(cmd_parms * parms, void *dummy, const char *arg) 852 const char *mgs_set_pin(cmd_parms * parms, void *dummy __attribute__((unused)), 853 const char *arg) 852 854 { 853 855 … … 860 862 } 861 863 862 const char *mgs_set_srk_pin(cmd_parms * parms, void *dummy, const char *arg) 864 const char *mgs_set_srk_pin(cmd_parms * parms, 865 void *dummy __attribute__((unused)), 866 const char *arg) 863 867 { 864 868 … … 872 876 873 877 static mgs_srvconf_rec *_mgs_config_server_create(apr_pool_t * p, 874 char **err )878 char **err __attribute__((unused))) 875 879 { 876 880 mgs_srvconf_rec *sc = apr_pcalloc(p, sizeof(*sc)); -
src/gnutls_hooks.c
r1d9cfaf r259e835 44 44 static int mgs_cert_verify(request_rec * r, mgs_handle_t * ctxt); 45 45 /* use side==0 for server and side==1 for client */ 46 static void mgs_add_common_cert_vars(request_rec * r, gnutls_x509_crt_t cert, int side, int export_cert_size); 47 static void mgs_add_common_pgpcert_vars(request_rec * r, gnutls_openpgp_crt_t cert, int side, int export_cert_size); 46 static void mgs_add_common_cert_vars(request_rec * r, gnutls_x509_crt_t cert, int side, size_t export_cert_size); 47 static void mgs_add_common_pgpcert_vars(request_rec * r, gnutls_openpgp_crt_t cert, int side, size_t export_cert_size); 48 static int mgs_status_hook(request_rec *r, int flags); 49 #ifdef ENABLE_MSVA 48 50 static const char* mgs_x509_construct_uid(request_rec * pool, gnutls_x509_crt_t cert); 49 static int mgs_status_hook(request_rec *r, int flags); 51 #endif 50 52 51 53 /* Pool Cleanup Function */ 52 apr_status_t mgs_cleanup_pre_config(void *data ) {54 apr_status_t mgs_cleanup_pre_config(void *data __attribute__((unused))) { 53 55 /* Free all session data */ 54 56 gnutls_free(session_ticket_key.data); … … 83 85 84 86 /* Pre-Configuration HOOK: Runs First */ 85 int mgs_hook_pre_config(apr_pool_t * pconf, apr_pool_t * plog, apr_pool_t * ptemp ) {87 int mgs_hook_pre_config(apr_pool_t * pconf, apr_pool_t * plog, apr_pool_t * ptemp __attribute__((unused))) { 86 88 87 89 /* Maintainer Logging */ … … 169 171 170 172 static int cert_retrieve_fn(gnutls_session_t session, 171 const gnutls_datum_t * req_ca_rdn, int nreqs, 172 const gnutls_pk_algorithm_t * pk_algos, int pk_algos_length, 173 gnutls_pcert_st **pcerts, unsigned int *pcert_length, 173 const gnutls_datum_t * req_ca_rdn __attribute__((unused)), 174 int nreqs __attribute__((unused)), 175 const gnutls_pk_algorithm_t * pk_algos __attribute__((unused)), 176 int pk_algos_length __attribute__((unused)), 177 gnutls_pcert_st **pcerts, 178 unsigned int *pcert_length, 174 179 gnutls_privkey_t *privkey) 175 180 { … … 284 289 } 285 290 286 int mgs_hook_post_config(apr_pool_t * p, apr_pool_t * plog , apr_pool_t * ptemp, server_rec * base_server) {291 int mgs_hook_post_config(apr_pool_t * p, apr_pool_t * plog __attribute__((unused)), apr_pool_t * ptemp __attribute__((unused)), server_rec * base_server) { 287 292 288 293 int rv; … … 535 540 } 536 541 537 static int vhost_cb(void *baton, conn_rec * conn , server_rec * s) {542 static int vhost_cb(void *baton, conn_rec * conn __attribute__((unused)), server_rec * s) { 538 543 mgs_srvconf_rec *tsc; 539 544 vhost_cb_rec *x = baton; … … 675 680 } 676 681 677 int mgs_hook_pre_connection(conn_rec * c, void *csd ) {682 int mgs_hook_pre_connection(conn_rec * c, void *csd __attribute__((unused))) { 678 683 mgs_srvconf_rec *sc; 679 684 … … 847 852 #define MGS_SIDE(suffix) ((side==0) ? "SSL_SERVER" suffix : "SSL_CLIENT" suffix) 848 853 849 static void mgs_add_common_cert_vars(request_rec * r, gnutls_x509_crt_t cert, int side, int export_cert_size) {854 static void mgs_add_common_cert_vars(request_rec * r, gnutls_x509_crt_t cert, int side, size_t export_cert_size) { 850 855 unsigned char sbuf[64]; /* buffer to hold serials */ 851 856 char buf[AP_IOBUFSIZE]; … … 966 971 * to use for the PEM-encoded certificate (0 means do not export) 967 972 */ 968 static void mgs_add_common_pgpcert_vars(request_rec * r, gnutls_openpgp_crt_t cert, int side, int export_cert_size) {973 static void mgs_add_common_pgpcert_vars(request_rec * r, gnutls_openpgp_crt_t cert, int side, size_t export_cert_size) { 969 974 970 975 unsigned char sbuf[64]; /* buffer to hold serials */ … … 1282 1287 exit: 1283 1288 if (gnutls_certificate_type_get(ctxt->session) == GNUTLS_CRT_X509) { 1284 int i;1289 unsigned int i; 1285 1290 for (i = 0; i < ch_size; i++) { 1286 1291 gnutls_x509_crt_deinit(cert.x509[i]); … … 1294 1299 } 1295 1300 1301 #ifdef ENABLE_MSVA 1302 /* this section of code is used only when trying to talk to the MSVA */ 1296 1303 static const char* mgs_x509_leaf_oid_from_dn(apr_pool_t *pool, const char* oid, gnutls_x509_crt_t cert) { 1297 1304 int rv=GNUTLS_E_SUCCESS, i; … … 1330 1337 data = apr_palloc(pool, sz); 1331 1338 rv = gnutls_x509_crt_get_subject_alt_name2(cert, i, data, &sz, &thistype, NULL); 1332 if (rv == target)1339 if (rv >=0 && (thistype == target)) 1333 1340 return data; 1334 1341 } … … 1337 1344 return NULL; 1338 1345 } 1346 1339 1347 1340 1348 /* Create a string representing a candidate User ID from an X.509 … … 1452 1460 return ret; 1453 1461 } 1454 1455 static int mgs_status_hook(request_rec *r, int flags) 1462 #endif /* ENABLE_MSVA */ 1463 1464 static int mgs_status_hook(request_rec *r, int flags __attribute__((unused))) 1456 1465 { 1457 1466 mgs_srvconf_rec *sc; -
src/gnutls_io.c
r1d9cfaf r259e835 510 510 if (ctxt->input_mode == AP_MODE_READBYTES || 511 511 ctxt->input_mode == AP_MODE_SPECULATIVE) { 512 if (readbytes < 0) { 513 /* you're asking us to speculatively read a negative number of bytes! */ 514 return APR_ENOTIMPL; 515 } 512 516 /* Err. This is bad. readbytes *can* be a 64bit int! len.. is NOT */ 513 if ( readbytes < len) {517 if ((apr_size_t) readbytes < len) { 514 518 len = (apr_size_t) readbytes; 515 519 } … … 573 577 574 578 apr_status_t mgs_filter_output(ap_filter_t * f, apr_bucket_brigade * bb) { 575 apr_size_t ret;579 int ret; 576 580 mgs_handle_t *ctxt = (mgs_handle_t *) f->ctx; 577 581 apr_status_t status = APR_SUCCESS; … … 672 676 return ctxt->output_rc; 673 677 } 674 } else if (ret != len) { 678 } else if ((apr_size_t)(ret) != len) { 679 /* we know the above cast is OK because len > 0 and ret >= 0 */ 675 680 /* Not able to send the entire bucket, 676 681 split it and send it again. */ -
src/mod_gnutls.c
r1d9cfaf r259e835 20 20 #include "mod_gnutls.h" 21 21 22 static void gnutls_hooks(apr_pool_t * p ) {22 static void gnutls_hooks(apr_pool_t * p __attribute__((unused))) { 23 23 24 24 /* Try Run Post-Config Hook After mod_proxy */ -
t/Makefile
r1d9cfaf r259e835 62 62 # special cases for the authorities' root certs: 63 63 authority/x509.pem: authority.template authority/secret.key 64 certtool --generate-self-signed --load-privkey =authority/secret.key --template=authority.template > $@64 certtool --generate-self-signed --load-privkey authority/secret.key --template authority.template > $@ 65 65 rogueca/x509.pem: rogueca.template rogueca/secret.key 66 certtool --generate-self-signed --load-privkey =rogueca/secret.key --template=rogueca.template > $@66 certtool --generate-self-signed --load-privkey rogueca/secret.key --template rogueca.template > $@ 67 67 68 68 %/cert-request: %.template %/secret.key 69 certtool --generate-request --load-privkey =$(dir $@)secret.key --template=$< > $@69 certtool --generate-request --load-privkey $(dir $@)secret.key --template $< > $@ 70 70 71 71 %/x509.pem: %.template %/cert-request authority/secret.key authority/x509.pem 72 certtool --generate-certificate --load-ca-certificate =authority/x509.pem --load-ca-privkey=authority/secret.key --load-request=$(dir $@)cert-request --template=$< > $@72 certtool --generate-certificate --load-ca-certificate authority/x509.pem --load-ca-privkey authority/secret.key --load-request $(dir $@)cert-request --template $< > $@ 73 73 74 74 msva.gnupghome/trustdb.gpg: authority/minimal.pgp client/cert.pgp -
t/setup
r1d9cfaf r259e835 38 38 genkey "$PWD/client" "Test User <test0@modgnutls.test>" 39 39 40 certtool -q --load-privkey =server/secret.key --template=server.template > server/server.req40 certtool -q --load-privkey server/secret.key --template server.template > server/server.req 41 41 42 42
Note: See TracChangeset
for help on using the changeset viewer.