summaryrefslogtreecommitdiff
path: root/lib/gnutls_anon_cred.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2002-01-19 18:24:28 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2002-01-19 18:24:28 +0000
commit9dbf78a6f96d6d383a5f75a24b6d275e28bc80d9 (patch)
treeaae91f128f19cffb1899dba84b8ce2dba21fe975 /lib/gnutls_anon_cred.c
parent5fe0a8400c1989c8d8700567f49687603508d3e5 (diff)
downloadgnutls-9dbf78a6f96d6d383a5f75a24b6d275e28bc80d9.tar.gz
Combined gnutls_x509pki_(set/get)_dh_bits() and
gnutls_anon_server/client_get to gnutls_dh_(set/get)_bits(). gnutls_anon_set_server_cred() was deprecated by gnutls_dh_set_bits().
Diffstat (limited to 'lib/gnutls_anon_cred.c')
-rw-r--r--lib/gnutls_anon_cred.c24
1 files changed, 4 insertions, 20 deletions
diff --git a/lib/gnutls_anon_cred.c b/lib/gnutls_anon_cred.c
index f74f96f0b7..189b203689 100644
--- a/lib/gnutls_anon_cred.c
+++ b/lib/gnutls_anon_cred.c
@@ -26,6 +26,8 @@
#include "gnutls_num.h"
#include "gnutls_gcry.h"
+const static int anon_tmp;
+
/**
* gnutls_anon_free_server_sc - Used to free an allocated GNUTLS_ANON_SERVER_CREDENTIALS structure
* @sc: is an &GNUTLS_ANON_SERVER_CREDENTIALS structure.
@@ -35,7 +37,7 @@
* the structure.
**/
void gnutls_anon_free_server_sc( GNUTLS_ANON_SERVER_CREDENTIALS sc) {
- gnutls_free(sc);
+ return;
}
/**
@@ -47,26 +49,10 @@ void gnutls_anon_free_server_sc( GNUTLS_ANON_SERVER_CREDENTIALS sc) {
* the structure.
**/
int gnutls_anon_allocate_server_sc( GNUTLS_ANON_SERVER_CREDENTIALS *sc) {
- *sc = gnutls_malloc(sizeof( ANON_SERVER_CREDENTIALS_INT));
-
- if (*sc==NULL) return GNUTLS_E_MEMORY_ERROR;
+ *sc = &anon_tmp;
return 0;
}
-/**
- * gnutls_anon_set_server_cred - Used to set the number of bits to use in DH, in a GNUTLS_ANON_SERVER_CREDENTIALS structure
- * @res: is an &GNUTLS_ANON_SERVER_CREDENTIALS structure.
- * @dh_bits: is the number of bits in DH key exchange
- *
- * Used to set the number of bits to use in an anonymous Diffie-Hellman,
- * key exchange.
- *
- **/
-
-int gnutls_anon_set_server_cred( GNUTLS_ANON_SERVER_CREDENTIALS res, int dh_bits) {
- res->dh_bits = dh_bits;
- return 0;
-}
/**
* gnutls_anon_free_client_sc - Used to free an allocated GNUTLS_ANON_CLIENT_CREDENTIALS structure
@@ -80,7 +66,6 @@ void gnutls_anon_free_client_sc( GNUTLS_ANON_CLIENT_CREDENTIALS sc) {
return;
}
-const static int anon_tmp;
/**
* gnutls_allocate_anon_client_sc - Used to allocate an GNUTLS_ANON_CLIENT CREDENTIALS structure
@@ -96,6 +81,5 @@ int gnutls_anon_allocate_client_sc( GNUTLS_ANON_CLIENT_CREDENTIALS *sc) {
*/
*sc = (void*) &anon_tmp;
- if (*sc==NULL) return GNUTLS_E_MEMORY_ERROR;
return 0;
}