From: Nikos Mavrogiannopoulos Date: Wed, 28 Jul 2004 10:28:48 +0000 (+0000) Subject: SRP ciphersuites were moved to the gnutls (lgpl) library. X-Git-Tag: gnutls_1_1_12~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=131a588a720c2f0d3193bd70e8495eda21f58ad0;p=thirdparty%2Fgnutls.git SRP ciphersuites were moved to the gnutls (lgpl) library. --- diff --git a/NEWS b/NEWS index 90e28bd138..1960ff64e0 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ Version 1.1.12 latest (yet unreleased) draft. Unfortunately this breaks compatibility with previous versions. - Changed the makefiles to be more portable. +- SRP ciphersuites were moved to the gnutls library. Version 1.1.11 (16/07/2004) - Added the '_t' suffix to all exported symbols. diff --git a/includes/gnutls/extra.h b/includes/gnutls/extra.h index fb3900874a..b948becc7d 100644 --- a/includes/gnutls/extra.h +++ b/includes/gnutls/extra.h @@ -28,54 +28,6 @@ #define LIBGNUTLS_EXTRA_VERSION LIBGNUTLS_VERSION -/* SRP */ - -typedef struct DSTRUCT* gnutls_srp_server_credentials_t; -typedef struct DSTRUCT* gnutls_srp_client_credentials_t; - -void gnutls_srp_free_client_credentials( gnutls_srp_client_credentials_t sc); -int gnutls_srp_allocate_client_credentials( gnutls_srp_client_credentials_t *sc); -int gnutls_srp_set_client_credentials( gnutls_srp_client_credentials_t res, char *username, char* password); - -void gnutls_srp_free_server_credentials( gnutls_srp_server_credentials_t sc); -int gnutls_srp_allocate_server_credentials( gnutls_srp_server_credentials_t *sc); -int gnutls_srp_set_server_credentials_file( gnutls_srp_server_credentials_t res, - const char *password_file, const char* password_conf_file); - -const char* gnutls_srp_server_get_username( gnutls_session_t state); - -int gnutls_srp_verifier( const char* username, const char* password, const gnutls_datum_t *salt, - const gnutls_datum_t* g, const gnutls_datum_t* n, - gnutls_datum_t * res); - -/* The static parameters defined in draft-ietf-tls-srp-05 - * Those should be used as input to gnutls_srp_verifier(). - */ -extern const gnutls_datum_t gnutls_srp_2048_group_prime; -extern const gnutls_datum_t gnutls_srp_2048_group_generator; - -extern const gnutls_datum_t gnutls_srp_1536_group_prime; -extern const gnutls_datum_t gnutls_srp_1536_group_generator; - -extern const gnutls_datum_t gnutls_srp_1024_group_prime; -extern const gnutls_datum_t gnutls_srp_1024_group_generator; - -typedef int gnutls_srp_server_credentials_function( - gnutls_session_t, - const char* username, gnutls_datum_t* salt, - gnutls_datum_t* verifier, gnutls_datum_t* generator, - gnutls_datum_t* prime -); -void gnutls_srp_set_server_credentials_function( - gnutls_srp_server_credentials_t, - gnutls_srp_server_credentials_function *); - -typedef int gnutls_srp_client_credentials_function(gnutls_session_t, unsigned int, - char **, char**); -void gnutls_srp_set_client_credentials_function( gnutls_srp_client_credentials_t, - gnutls_srp_client_credentials_function *); - - /* Openpgp certificate stuff */ diff --git a/lib/Makefile.am b/lib/Makefile.am index f4dbe60d71..9882ceb832 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -35,7 +35,8 @@ EXTRA_DIST = debug.h gnutls_compress.h defines.h gnutls.asn pkix.asn \ gnutls_sig.h gnutls_mem.h gnutls_ui.h \ io_debug.h ext_max_record.h gnutls_session_pack.h \ gnutls_alert.h gnutls_str.h gnutls_state.h gnutls_x509.h \ - ext_cert_type.h gnutls_rsa_export.h ext_server_name.h auth_dh_common.h + ext_cert_type.h gnutls_rsa_export.h ext_server_name.h auth_dh_common.h \ + ext_srp.h gnutls_srp.h auth_srp.h auth_srp_passwd.h lib_LTLIBRARIES = libgnutls.la X509_COBJECTS = x509/crl.c x509/dn.c x509/common.c x509/x509.c x509/extensions.c \ @@ -44,6 +45,9 @@ X509_COBJECTS = x509/crl.c x509/dn.c x509/common.c x509/x509.c x509/extensions.c x509/privkey_pkcs8.c x509/pkcs12.c x509/pkcs12_bag.c x509/pkcs12_encr.c \ x509/x509_write.c x509/crl_write.c x509/compat.c +SRP_COBJECTS = ext_srp.c gnutls_srp.c auth_srp.c auth_srp_passwd.c \ + auth_srp_sb64.c auth_srp_rsa.c + COBJECTS = gnutls_record.c gnutls_compress.c debug.c \ gnutls_cipher.c gnutls_buffers.c gnutls_handshake.c gnutls_num.c \ gnutls_errors.c gnutls_algorithms.c gnutls_dh.c gnutls_kx.c \ @@ -63,7 +67,7 @@ COBJECTS = gnutls_record.c gnutls_compress.c debug.c \ # Separate so we can create the documentation -libgnutls_la_SOURCES = $(COBJECTS) $(X509_COBJECTS) $(MINITASN1_COBJECTS) +libgnutls_la_SOURCES = $(COBJECTS) $(X509_COBJECTS) $(MINITASN1_COBJECTS) $(SRP_COBJECTS) libgnutls_la_LDFLAGS = $(LIBTASN1_LIBS) $(LIBGCRYPT_LIBS) \ $(libgnutls_version_script_cmd) \ diff --git a/libextra/auth_srp.c b/lib/auth_srp.c similarity index 96% rename from libextra/auth_srp.c rename to lib/auth_srp.c index 1ede38fefc..671ec20fa0 100644 --- a/libextra/auth_srp.c +++ b/lib/auth_srp.c @@ -4,22 +4,23 @@ * * This file is part of GNUTLS. * - * GNUTLS-EXTRA is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * The GNUTLS library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * GNUTLS-EXTRA is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnutls_int.h" +#include #ifdef ENABLE_SRP diff --git a/libextra/auth_srp.h b/lib/auth_srp.h similarity index 100% rename from libextra/auth_srp.h rename to lib/auth_srp.h diff --git a/libextra/auth_srp_passwd.c b/lib/auth_srp_passwd.c similarity index 90% rename from libextra/auth_srp_passwd.c rename to lib/auth_srp_passwd.c index 26021c581b..56af4f0d85 100644 --- a/libextra/auth_srp_passwd.c +++ b/lib/auth_srp_passwd.c @@ -1,33 +1,34 @@ /* - * Copyright (C) 2001,2003 Nikos Mavroyanopoulos + * Copyright (C) 2001,2002,2003 Nikos Mavroyanopoulos * Copyright (C) 2004 Free Software Foundation * * This file is part of GNUTLS. * - * GNUTLS-EXTRA is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * The GNUTLS library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * GNUTLS-EXTRA is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ /* Functions for operating in an SRP passwd file are included here */ -#include "gnutls_int.h" +#include #ifdef ENABLE_SRP #include "x509_b64.h" #include "gnutls_errors.h" -#include "auth_srp_passwd.h" +#include #include "auth_srp.h" #include "gnutls_auth_int.h" #include "gnutls_srp.h" diff --git a/libextra/auth_srp_passwd.h b/lib/auth_srp_passwd.h similarity index 100% rename from libextra/auth_srp_passwd.h rename to lib/auth_srp_passwd.h diff --git a/libextra/auth_srp_rsa.c b/lib/auth_srp_rsa.c similarity index 83% rename from libextra/auth_srp_rsa.c rename to lib/auth_srp_rsa.c index 5bccdb268e..00f853060c 100644 --- a/libextra/auth_srp_rsa.c +++ b/lib/auth_srp_rsa.c @@ -4,22 +4,23 @@ * * This file is part of GNUTLS. * - * GNUTLS-EXTRA is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * The GNUTLS library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * GNUTLS-EXTRA is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnutls_int.h" +#include #ifdef ENABLE_SRP diff --git a/libextra/auth_srp_sb64.c b/lib/auth_srp_sb64.c similarity index 92% rename from libextra/auth_srp_sb64.c rename to lib/auth_srp_sb64.c index 975ebf5ca1..c446508fe6 100644 --- a/libextra/auth_srp_sb64.c +++ b/lib/auth_srp_sb64.c @@ -1,22 +1,23 @@ /* - * Copyright (C) 2001,2002 Nikos Mavroyanopoulos + * Copyright (C) 2001,2002,2003 Nikos Mavroyanopoulos * Copyright (C) 2004 Free Software Foundation * * This file is part of GNUTLS. * - * GNUTLS-EXTRA is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * The GNUTLS library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * GNUTLS-EXTRA is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include diff --git a/libextra/ext_srp.c b/lib/ext_srp.c similarity index 79% rename from libextra/ext_srp.c rename to lib/ext_srp.c index 990c810847..8bb1cbc7de 100644 --- a/libextra/ext_srp.c +++ b/lib/ext_srp.c @@ -1,25 +1,26 @@ /* - * Copyright (C) 2001,2002 Nikos Mavroyanopoulos + * Copyright (C) 2001,2002,2003 Nikos Mavroyanopoulos * Copyright (C) 2004 Free Software Foundation * * This file is part of GNUTLS. * - * GNUTLS-EXTRA is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * The GNUTLS library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * GNUTLS-EXTRA is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ -#include "gnutls_int.h" +#include #include #ifdef ENABLE_SRP diff --git a/libextra/ext_srp.h b/lib/ext_srp.h similarity index 100% rename from libextra/ext_srp.h rename to lib/ext_srp.h diff --git a/lib/gnutls.h.in.in b/lib/gnutls.h.in.in index 26b6b7bb01..a391345413 100644 --- a/lib/gnutls.h.in.in +++ b/lib/gnutls.h.in.in @@ -497,3 +497,52 @@ void gnutls_openpgp_send_key(gnutls_session_t session, gnutls_openpgp_key_status int gnutls_fingerprint(gnutls_digest_algorithm_t algo, const gnutls_datum_t* data, void* result, size_t* result_size); + +/* SRP + */ + +typedef struct DSTRUCT* gnutls_srp_server_credentials_t; +typedef struct DSTRUCT* gnutls_srp_client_credentials_t; + +void gnutls_srp_free_client_credentials( gnutls_srp_client_credentials_t sc); +int gnutls_srp_allocate_client_credentials( gnutls_srp_client_credentials_t *sc); +int gnutls_srp_set_client_credentials( gnutls_srp_client_credentials_t res, char *username, char* password); + +void gnutls_srp_free_server_credentials( gnutls_srp_server_credentials_t sc); +int gnutls_srp_allocate_server_credentials( gnutls_srp_server_credentials_t *sc); +int gnutls_srp_set_server_credentials_file( gnutls_srp_server_credentials_t res, + const char *password_file, const char* password_conf_file); + +const char* gnutls_srp_server_get_username( gnutls_session_t state); + +int gnutls_srp_verifier( const char* username, const char* password, const gnutls_datum_t *salt, + const gnutls_datum_t* g, const gnutls_datum_t* n, + gnutls_datum_t * res); + +/* The static parameters defined in draft-ietf-tls-srp-05 + * Those should be used as input to gnutls_srp_verifier(). + */ +extern const gnutls_datum_t gnutls_srp_2048_group_prime; +extern const gnutls_datum_t gnutls_srp_2048_group_generator; + +extern const gnutls_datum_t gnutls_srp_1536_group_prime; +extern const gnutls_datum_t gnutls_srp_1536_group_generator; + +extern const gnutls_datum_t gnutls_srp_1024_group_prime; +extern const gnutls_datum_t gnutls_srp_1024_group_generator; + +typedef int gnutls_srp_server_credentials_function( + gnutls_session_t, + const char* username, gnutls_datum_t* salt, + gnutls_datum_t* verifier, gnutls_datum_t* generator, + gnutls_datum_t* prime +); +void gnutls_srp_set_server_credentials_function( + gnutls_srp_server_credentials_t, + gnutls_srp_server_credentials_function *); + +typedef int gnutls_srp_client_credentials_function(gnutls_session_t, unsigned int, + char **, char**); +void gnutls_srp_set_client_credentials_function( gnutls_srp_client_credentials_t, + gnutls_srp_client_credentials_function *); + diff --git a/lib/gnutls_algorithms.c b/lib/gnutls_algorithms.c index e0ee6000db..2c8d181ce7 100644 --- a/lib/gnutls_algorithms.c +++ b/lib/gnutls_algorithms.c @@ -217,6 +217,9 @@ extern mod_auth_st rsa_export_auth_struct; extern mod_auth_st dhe_rsa_auth_struct; extern mod_auth_st dhe_dss_auth_struct; extern mod_auth_st anon_auth_struct; +extern mod_auth_st srp_auth_struct; +extern mod_auth_st srp_rsa_auth_struct; +extern mod_auth_st srp_dss_auth_struct; #define MAX_KX_ALGOS 10 @@ -230,6 +233,10 @@ gnutls_kx_algo_entry _gnutls_kx_algorithms[MAX_KX_ALGOS] = { {"RSA EXPORT", GNUTLS_KX_RSA_EXPORT, &rsa_export_auth_struct, 0, 1}, {"DHE RSA", GNUTLS_KX_DHE_RSA, &dhe_rsa_auth_struct, 1, 0}, {"DHE DSS", GNUTLS_KX_DHE_DSS, &dhe_dss_auth_struct, 1, 0}, + + {"SRP DSS", GNUTLS_KX_SRP_DSS, &srp_dss_auth_struct, 0, 0}, + {"SRP RSA", GNUTLS_KX_SRP_RSA, &srp_rsa_auth_struct, 0, 0}, + {"SRP", GNUTLS_KX_SRP, &srp_auth_struct, 0, 0}, /* other algorithms are appended here by gnutls-extra * initialization function. */ diff --git a/lib/gnutls_extensions.c b/lib/gnutls_extensions.c index adfd109552..ee1cf1e86c 100644 --- a/lib/gnutls_extensions.c +++ b/lib/gnutls_extensions.c @@ -31,7 +31,8 @@ #include "ext_max_record.h" #include #include -#include "gnutls_num.h" +#include +#include /* Key Exchange Section */ #define GNUTLS_EXTENSION_ENTRY(type, ext_func_recv, ext_func_send) \ @@ -51,6 +52,9 @@ gnutls_extension_entry _gnutls_extensions[MAX_EXT_SIZE] = { GNUTLS_EXTENSION_ENTRY(GNUTLS_EXTENSION_SERVER_NAME, _gnutls_server_name_recv_params, _gnutls_server_name_send_params), + GNUTLS_EXTENSION_ENTRY(GNUTLS_EXTENSION_SRP, + _gnutls_srp_recv_params, + _gnutls_srp_send_params), {0, 0, 0, 0} }; diff --git a/libextra/gnutls_srp.c b/lib/gnutls_srp.c similarity index 95% rename from libextra/gnutls_srp.c rename to lib/gnutls_srp.c index 3442bd1020..e1374f4bac 100644 --- a/libextra/gnutls_srp.c +++ b/lib/gnutls_srp.c @@ -1,22 +1,23 @@ /* - * Copyright (C) 2001,2003 Nikos Mavroyanopoulos + * Copyright (C) 2001,2002,2003 Nikos Mavroyanopoulos * Copyright (C) 2004 Free Software Foundation * * This file is part of GNUTLS. * - * GNUTLS-EXTRA is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * The GNUTLS library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. * - * GNUTLS-EXTRA is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #include diff --git a/libextra/gnutls_srp.h b/lib/gnutls_srp.h similarity index 100% rename from libextra/gnutls_srp.h rename to lib/gnutls_srp.h diff --git a/libextra/Makefile.am b/libextra/Makefile.am index 43786c9f86..3d524d80dc 100644 --- a/libextra/Makefile.am +++ b/libextra/Makefile.am @@ -12,9 +12,8 @@ else libgnutls_extra_version_script_cmd = endif -EXTRA_DIST = ext_srp.h gnutls_srp.h libgnutls-extra.vers \ - auth_srp.h auth_srp_passwd.h openssl_compat.h \ - gnutls-extra-api.tex gnutls_extra.h libgnutls-extra-config.in \ +EXTRA_DIST = libgnutls-extra.vers \ + openssl_compat.h gnutls-extra-api.tex gnutls_extra.h libgnutls-extra-config.in \ libgnutls-extra.m4 lzoconf.h minilzo.h @@ -62,9 +61,8 @@ LZO_OBJECTS = endif -COBJECTS_EXTRA = ext_srp.c \ - gnutls_srp.c auth_srp.c auth_srp_passwd.c auth_srp_sb64.c \ - gnutls_extra.c auth_srp_rsa.c +COBJECTS_EXTRA = \ + gnutls_extra.c libgnutls_extra_la_LDFLAGS = $(libgnutls_extra_version_script_cmd) \ diff --git a/libextra/gnutls_extra.c b/libextra/gnutls_extra.c index 4c44e91e4c..a842ebe4e7 100644 --- a/libextra/gnutls_extra.c +++ b/libextra/gnutls_extra.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -30,96 +29,6 @@ # include #endif -extern gnutls_extension_entry _gnutls_extensions[]; -extern const int _gnutls_extensions_size; - -extern const int _gnutls_kx_algorithms_size; -extern gnutls_kx_algo_entry _gnutls_kx_algorithms[]; - -#define TOSTR(x) #x - -#ifdef ENABLE_SRP -static int _gnutls_add_srp_extension(void) -{ - int i; - - /* find the last element */ - for (i = 0; i < _gnutls_extensions_size; i++) { - if (_gnutls_extensions[i].name == NULL) - break; - } - - if (_gnutls_extensions[i].name == NULL - && (i < _gnutls_extensions_size - 1)) { - _gnutls_extensions[i].name = TOSTR(GNUTLS_EXTENSION_SRP); - _gnutls_extensions[i].type = GNUTLS_EXTENSION_SRP; - _gnutls_extensions[i].gnutls_ext_func_recv = - _gnutls_srp_recv_params; - _gnutls_extensions[i].gnutls_ext_func_send = - _gnutls_srp_send_params; - - _gnutls_extensions[i + 1].name = 0; - - return 0; /* ok */ - } - - return GNUTLS_E_MEMORY_ERROR; -} - -extern mod_auth_st srp_auth_struct; -extern mod_auth_st srp_rsa_auth_struct; -extern mod_auth_st srp_dss_auth_struct; - - -static int _gnutls_add_srp_auth_struct(void) -{ - int i; - - /* find the last element */ - for (i = 0; i < _gnutls_kx_algorithms_size; i++) { - if (_gnutls_kx_algorithms[i].name == NULL) - break; - } - - if (_gnutls_kx_algorithms[i].name == NULL - && (i < _gnutls_kx_algorithms_size - 1)) { - _gnutls_kx_algorithms[i].name = "SRP"; - _gnutls_kx_algorithms[i].algorithm = GNUTLS_KX_SRP; - _gnutls_kx_algorithms[i].auth_struct = &srp_auth_struct; - _gnutls_kx_algorithms[i].needs_dh_params = 0; - _gnutls_kx_algorithms[i].needs_rsa_params = 0; - _gnutls_kx_algorithms[i + 1].name = 0; - } - i++; - - if (_gnutls_kx_algorithms[i].name == NULL - && (i < _gnutls_kx_algorithms_size - 1)) { - _gnutls_kx_algorithms[i].name = "SRP RSA"; - _gnutls_kx_algorithms[i].algorithm = GNUTLS_KX_SRP_RSA; - _gnutls_kx_algorithms[i].auth_struct = &srp_rsa_auth_struct; - _gnutls_kx_algorithms[i].needs_dh_params = 0; - _gnutls_kx_algorithms[i].needs_rsa_params = 0; - _gnutls_kx_algorithms[i + 1].name = 0; - } - i++; - - if (_gnutls_kx_algorithms[i].name == NULL - && (i < _gnutls_kx_algorithms_size - 1)) { - _gnutls_kx_algorithms[i].name = "SRP DSS"; - _gnutls_kx_algorithms[i].algorithm = GNUTLS_KX_SRP_DSS; - _gnutls_kx_algorithms[i].auth_struct = &srp_dss_auth_struct; - _gnutls_kx_algorithms[i].needs_dh_params = 0; - _gnutls_kx_algorithms[i].needs_rsa_params = 0; - _gnutls_kx_algorithms[i + 1].name = 0; - - return 0; /* ok */ - } - - return GNUTLS_E_MEMORY_ERROR; -} - -#endif - /* the number of the compression algorithms available in the compression * structure. @@ -252,25 +161,6 @@ int gnutls_global_init_extra(void) } #endif -#ifdef ENABLE_SRP - /* Add the SRP authentication to the list of authentication - * methods. - */ - ret = _gnutls_add_srp_auth_struct(); - if (ret < 0) { - gnutls_assert(); - return ret; - } - - /* Do the same of the extension - */ - ret = _gnutls_add_srp_extension(); - if (ret < 0) { - gnutls_assert(); - return ret; - } -#endif - /* Register the openpgp functions. This is because some * of them are defined to be NULL in the main library. */ diff --git a/libgcrypt.m4 b/libgcrypt.m4 index e5f2a43c06..20bd105561 100644 --- a/libgcrypt.m4 +++ b/libgcrypt.m4 @@ -20,7 +20,7 @@ dnl version of libgcrypt is at least 1.2.5 *and* the API number is 1. Using dnl this features allows to prevent build against newer versions of libgcrypt dnl with a changed API. dnl -AC_DEFUN(AM_PATH_LIBGCRYPT, +AC_DEFUN([AM_PATH_LIBGCRYPT], [ AC_ARG_WITH(libgcrypt-prefix, AC_HELP_STRING([--with-libgcrypt-prefix=PFX], [prefix where LIBGCRYPT is installed (optional)]), diff --git a/opencdk.m4 b/opencdk.m4 index ca51e8075a..1957e51225 100644 --- a/opencdk.m4 +++ b/opencdk.m4 @@ -10,7 +10,7 @@ dnl $id$ dnl AM_PATH_LIBOPENCDK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]]) dnl Test for libopencdk, and define CDK_CFLAGS and CDK_LIBS dnl -AC_DEFUN(AM_PATH_LIBOPENCDK, +AC_DEFUN([AM_PATH_LIBOPENCDK], [dnl dnl Get the cflags and libraries from the opencdk-config script dnl