summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2002-06-22 06:51:45 +0000
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2002-06-22 06:51:45 +0000
commit0645ff56014b339af354ff097dc245c9723e29a0 (patch)
treedf0813e105dfc4109dd897a547bb9c6a912d12c6
parent95f4b016b6993ef17ef476e1c3b8bd697f1fc6e1 (diff)
downloadgnutls-0645ff56014b339af354ff097dc245c9723e29a0.tar.gz
Renamed credential allocation functions from *_sc() to *_cred().
-rw-r--r--doc/TODO1
-rw-r--r--doc/tex/ex1.tex4
-rw-r--r--doc/tex/ex2.tex4
-rw-r--r--doc/tex/ex4.tex4
-rw-r--r--doc/tex/serv1.tex8
-rw-r--r--doc/tex/srp1.tex4
-rw-r--r--includes/gnutls/Makefile.am2
-rw-r--r--includes/gnutls/extra.h14
-rw-r--r--lib/gnutls.h.in.in32
-rw-r--r--lib/gnutls_algorithms.c2
-rw-r--r--lib/gnutls_anon_cred.c16
-rw-r--r--lib/gnutls_cert.c8
-rw-r--r--lib/gnutls_x509.c15
-rw-r--r--lib/gnutls_x509.h2
-rw-r--r--lib/x509_xml.c2
-rw-r--r--libextra/gnutls_openssl.c4
-rw-r--r--libextra/gnutls_srp.c16
-rw-r--r--src/cli.c12
-rw-r--r--src/serv.c12
-rw-r--r--src/tls_test.c12
20 files changed, 102 insertions, 72 deletions
diff --git a/doc/TODO b/doc/TODO
index 5fa67a5b94..20711bcdc6 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -8,6 +8,7 @@ Current list:
* Add PKCS-12 support
* Convert documentation to texinfo format
* Merge common stuff in DHE and DHA key exchange
+* Add GPGSM certificate manager support
- Add Kerberos support
(+) Means high priority
diff --git a/doc/tex/ex1.tex b/doc/tex/ex1.tex
index 69004d5f8b..6360060a77 100644
--- a/doc/tex/ex1.tex
+++ b/doc/tex/ex1.tex
@@ -44,7 +44,7 @@ int main()
exit(1);
}
/* X509 stuff */
- if (gnutls_certificate_allocate_client_sc(&xcred) < 0) {
+ if (gnutls_certificate_allocate_client_cred(&xcred) < 0) {
fprintf(stderr, "memory error\n");
exit(1);
}
@@ -168,7 +168,7 @@ int main()
} /* for() */
- gnutls_certificate_free_client_sc(xcred);
+ gnutls_certificate_free_client_cred(xcred);
gnutls_global_deinit();
diff --git a/doc/tex/ex2.tex b/doc/tex/ex2.tex
index a1dbaf2aec..a79b5f3253 100644
--- a/doc/tex/ex2.tex
+++ b/doc/tex/ex2.tex
@@ -36,7 +36,7 @@ int main()
exit(1);
}
/* X509 stuff */
- if (gnutls_certificate_allocate_client_sc(&xcred) < 0) {
+ if (gnutls_certificate_allocate_client_cred(&xcred) < 0) {
fprintf(stderr, "memory error\n");
exit(1);
}
@@ -138,7 +138,7 @@ int main()
gnutls_deinit(state);
- gnutls_certificate_free_client_sc(xcred);
+ gnutls_certificate_free_client_cred(xcred);
gnutls_global_deinit();
diff --git a/doc/tex/ex4.tex b/doc/tex/ex4.tex
index c19ba0f29b..f23690b8b8 100644
--- a/doc/tex/ex4.tex
+++ b/doc/tex/ex4.tex
@@ -40,7 +40,7 @@ int main()
exit(1);
}
/* X509 stuff */
- if (gnutls_certificate_allocate_client_sc(&xcred) < 0) {
+ if (gnutls_certificate_allocate_client_cred(&xcred) < 0) {
fprintf(stderr, "memory error\n");
exit(1);
}
@@ -150,7 +150,7 @@ int main()
} /* for() */
- gnutls_certificate_free_client_sc(xcred);
+ gnutls_certificate_free_client_cred(xcred);
gnutls_global_deinit();
diff --git a/doc/tex/serv1.tex b/doc/tex/serv1.tex
index ead49227db..a18b501e98 100644
--- a/doc/tex/serv1.tex
+++ b/doc/tex/serv1.tex
@@ -155,7 +155,7 @@ int main()
exit(1);
}
- if (gnutls_certificate_allocate_server_sc(&x509_cred) < 0) {
+ if (gnutls_certificate_allocate_server_cred(&x509_cred) < 0) {
fprintf(stderr, "memory error\n");
exit(1);
}
@@ -171,7 +171,7 @@ int main()
}
/* SRP_PASSWD a password file (created with the included srpcrypt utility)
*/
- gnutls_srp_allocate_server_sc(&srp_cred);
+ gnutls_srp_allocate_server_cred(&srp_cred);
gnutls_srp_set_server_cred_file(srp_cred, SRP_PASSWD, SRP_PASSWD_CONF);
generate_dh_params();
@@ -260,8 +260,8 @@ int main()
}
close(listen_sd);
- gnutls_certificate_free_server_sc(x509_cred);
- gnutls_srp_free_server_sc(srp_cred);
+ gnutls_certificate_free_server_cred(x509_cred);
+ gnutls_srp_free_server_cred(srp_cred);
gnutls_global_deinit();
diff --git a/doc/tex/srp1.tex b/doc/tex/srp1.tex
index 01f5938b91..cf53e6aed7 100644
--- a/doc/tex/srp1.tex
+++ b/doc/tex/srp1.tex
@@ -44,7 +44,7 @@ int main()
exit(1);
}
- if (gnutls_srp_allocate_client_sc(&xcred) < 0) {
+ if (gnutls_srp_allocate_client_cred(&xcred) < 0) {
fprintf(stderr, "memory error\n");
exit(1);
}
@@ -143,7 +143,7 @@ int main()
gnutls_deinit(state);
- gnutls_srp_free_client_sc(xcred);
+ gnutls_srp_free_client_cred(xcred);
gnutls_global_deinit();
diff --git a/includes/gnutls/Makefile.am b/includes/gnutls/Makefile.am
index 78f85f52b4..54d8898cb9 100644
--- a/includes/gnutls/Makefile.am
+++ b/includes/gnutls/Makefile.am
@@ -1 +1 @@
-include_HEADERS = extra.h openssl.h
+include_HEADERS = extra.h openssl.h gnutls.h
diff --git a/includes/gnutls/extra.h b/includes/gnutls/extra.h
index 7929173496..6a4e3756a6 100644
--- a/includes/gnutls/extra.h
+++ b/includes/gnutls/extra.h
@@ -30,12 +30,18 @@
typedef struct DSTRUCT* GNUTLS_SRP_SERVER_CREDENTIALS;
typedef struct DSTRUCT* GNUTLS_SRP_CLIENT_CREDENTIALS;
-void gnutls_srp_free_client_sc( GNUTLS_SRP_CLIENT_CREDENTIALS sc);
-int gnutls_srp_allocate_client_sc( GNUTLS_SRP_CLIENT_CREDENTIALS *sc);
+void gnutls_srp_free_client_cred( GNUTLS_SRP_CLIENT_CREDENTIALS sc);
+int gnutls_srp_allocate_client_cred( GNUTLS_SRP_CLIENT_CREDENTIALS *sc);
+#define gnutls_srp_free_client_sc gnutls_srp_free_client_cred
+#define gnutls_srp_allocate_client_sc gnutls_srp_allocate_client_cred
+
int gnutls_srp_set_client_cred( GNUTLS_SRP_CLIENT_CREDENTIALS res, char *username, char* password);
-void gnutls_srp_free_server_sc( GNUTLS_SRP_SERVER_CREDENTIALS sc);
-int gnutls_srp_allocate_server_sc( GNUTLS_SRP_SERVER_CREDENTIALS *sc);
+void gnutls_srp_free_server_cred( GNUTLS_SRP_SERVER_CREDENTIALS sc);
+int gnutls_srp_allocate_server_cred( GNUTLS_SRP_SERVER_CREDENTIALS *sc);
+#define gnutls_srp_free_server_sc gnutls_srp_free_server_cred
+#define gnutls_srp_allocate_server_sc gnutls_srp_allocate_server_cred
+
int gnutls_srp_set_server_cred_file( GNUTLS_SRP_SERVER_CREDENTIALS res, char *password_file, char* password_conf_file);
const char* gnutls_srp_server_get_username( GNUTLS_STATE state);
diff --git a/lib/gnutls.h.in.in b/lib/gnutls.h.in.in
index d6f1b3a2ba..0684bd285b 100644
--- a/lib/gnutls.h.in.in
+++ b/lib/gnutls.h.in.in
@@ -96,6 +96,9 @@ typedef enum GNUTLS_PKAlgorithm { GNUTLS_PK_RSA = 1, GNUTLS_PK_DSA
typedef const int* GNUTLS_LIST;
+/* STATE is not really descriptive. Think of it as
+ * as session.
+ */
struct GNUTLS_STATE_INT;
typedef struct GNUTLS_STATE_INT* GNUTLS_STATE;
@@ -173,7 +176,7 @@ int gnutls_kx_set_priority( GNUTLS_STATE state, GNUTLS_LIST);
int gnutls_protocol_set_priority( GNUTLS_STATE state, GNUTLS_LIST);
int gnutls_cert_type_set_priority( GNUTLS_STATE state, GNUTLS_LIST);
-/* set our version - 0 for TLS 1.0 and 1 for SSL3 */
+/* get the currently used protocol version */
GNUTLS_Version gnutls_protocol_get_version(GNUTLS_STATE state);
const char *gnutls_protocol_get_name(GNUTLS_Version version);
@@ -209,9 +212,12 @@ void gnutls_handshake_set_max_packet_length( GNUTLS_STATE state, int max);
/* returns libgnutls version */
const char* gnutls_check_version( const char*);
-/* Functions for setting/clearing credentials */
+/* Functions for setting/clearing credentials
+ */
int gnutls_clear_creds( GNUTLS_STATE state);
-/* cred is a structure defined by the kx algorithm */
+
+/* cred is a structure defined by the kx algorithm
+ */
int gnutls_cred_set( GNUTLS_STATE, GNUTLS_CredType type, void* cred);
/* Credential structures for SRP - used in gnutls_set_cred(); */
@@ -224,21 +230,29 @@ typedef GNUTLS_CERTIFICATE_CREDENTIALS GNUTLS_CERTIFICATE_SERVER_CREDENTIALS;
typedef struct DSTRUCT* GNUTLS_ANON_SERVER_CREDENTIALS;
typedef struct DSTRUCT* GNUTLS_ANON_CLIENT_CREDENTIALS;
-void gnutls_anon_free_server_sc( GNUTLS_ANON_SERVER_CREDENTIALS sc);
-int gnutls_anon_allocate_server_sc( GNUTLS_ANON_SERVER_CREDENTIALS *sc);
+void gnutls_anon_free_server_cred( GNUTLS_ANON_SERVER_CREDENTIALS sc);
+int gnutls_anon_allocate_server_cred( GNUTLS_ANON_SERVER_CREDENTIALS *sc);
+#define gnutls_anon_free_server_sc gnutls_anon_free_server_cred
+#define gnutls_anon_allocate_server_sc gnutls_anon_allocate_server_cred
+
int gnutls_anon_set_server_cred( GNUTLS_ANON_SERVER_CREDENTIALS res);
void gnutls_anon_set_server_dh_params( GNUTLS_ANON_SERVER_CREDENTIALS res, GNUTLS_DH_PARAMS);
-void gnutls_anon_free_client_sc( GNUTLS_ANON_SERVER_CREDENTIALS sc);
-int gnutls_anon_allocate_client_sc( GNUTLS_ANON_SERVER_CREDENTIALS *sc);
+void gnutls_anon_free_client_cred( GNUTLS_ANON_SERVER_CREDENTIALS sc);
+int gnutls_anon_allocate_client_cred( GNUTLS_ANON_SERVER_CREDENTIALS *sc);
+#define gnutls_anon_free_client_sc gnutls_anon_free_client_cred
+#define gnutls_anon_allocate_client_sc gnutls_anon_allocate_client_cred
+
int gnutls_anon_set_client_cred( GNUTLS_ANON_SERVER_CREDENTIALS res);
/* CERTFILE is an x509 certificate in PEM form.
* KEYFILE is a pkcs-1 private key in PEM form (for RSA keys).
*/
-void gnutls_certificate_free_sc( GNUTLS_CERTIFICATE_CREDENTIALS sc);
-int gnutls_certificate_allocate_sc( GNUTLS_CERTIFICATE_CREDENTIALS *sc);
+void gnutls_certificate_free_cred( GNUTLS_CERTIFICATE_CREDENTIALS sc);
+int gnutls_certificate_allocate_cred( GNUTLS_CERTIFICATE_CREDENTIALS *sc);
+#define gnutls_certificate_free_sc gnutls_certificate_free_cred
+#define gnutls_certificate_allocate_sc gnutls_certificate_allocate_cred
int gnutls_certificate_set_dh_params(GNUTLS_CERTIFICATE_CREDENTIALS res, GNUTLS_DH_PARAMS);
diff --git a/lib/gnutls_algorithms.c b/lib/gnutls_algorithms.c
index 892a1012e8..67cc817dd1 100644
--- a/lib/gnutls_algorithms.c
+++ b/lib/gnutls_algorithms.c
@@ -563,7 +563,7 @@ int _gnutls_cipher_is_block(BulkCipherAlgorithm algorithm)
* Returns 0 if the given cipher is invalid.
*
**/
-size_t gnutls_cipher_get_key_size(BulkCipherAlgorithm algorithm)
+size_t gnutls_cipher_get_key_size( GNUTLS_BulkCipherAlgorithm algorithm)
{ /* In bytes */
size_t ret = 0;
GNUTLS_ALG_LOOP(ret = p->keysize);
diff --git a/lib/gnutls_anon_cred.c b/lib/gnutls_anon_cred.c
index 00314013ac..a230b42a8f 100644
--- a/lib/gnutls_anon_cred.c
+++ b/lib/gnutls_anon_cred.c
@@ -33,27 +33,27 @@
static int anon_tmp;
/**
- * gnutls_anon_free_server_sc - Used to free an allocated GNUTLS_ANON_SERVER_CREDENTIALS structure
+ * gnutls_anon_free_server_cred - Used to free an allocated GNUTLS_ANON_SERVER_CREDENTIALS structure
* @sc: is an &GNUTLS_ANON_SERVER_CREDENTIALS structure.
*
* This structure is complex enough to manipulate directly thus
* this helper function is provided in order to free (deallocate)
* the structure.
**/
-void gnutls_anon_free_server_sc( GNUTLS_ANON_SERVER_CREDENTIALS sc) {
+void gnutls_anon_free_server_cred( GNUTLS_ANON_SERVER_CREDENTIALS sc) {
gnutls_free( sc);
}
/**
- * gnutls_anon_allocate_server_sc - Used to allocate an GNUTLS_ANON_SERVER CREDENTIALS structure
+ * gnutls_anon_allocate_server_cred - Used to allocate an GNUTLS_ANON_SERVER CREDENTIALS structure
* @sc: is a pointer to an &GNUTLS_ANON_SERVER_CREDENTIALS structure.
*
* This structure is complex enough to manipulate directly thus
* this helper function is provided in order to allocate
* the structure.
**/
-int gnutls_anon_allocate_server_sc( GNUTLS_ANON_SERVER_CREDENTIALS *sc) {
+int gnutls_anon_allocate_server_cred( GNUTLS_ANON_SERVER_CREDENTIALS *sc) {
*sc = gnutls_calloc( 1, sizeof(ANON_SERVER_CREDENTIALS_INT));
(*sc)->dh_params = &_gnutls_dh_default_params;
@@ -63,27 +63,27 @@ int gnutls_anon_allocate_server_sc( GNUTLS_ANON_SERVER_CREDENTIALS *sc) {
/**
- * gnutls_anon_free_client_sc - Used to free an allocated GNUTLS_ANON_CLIENT_CREDENTIALS structure
+ * gnutls_anon_free_client_cred - Used to free an allocated GNUTLS_ANON_CLIENT_CREDENTIALS structure
* @sc: is an &GNUTLS_ANON_CLIENT_CREDENTIALS structure.
*
* This structure is complex enough to manipulate directly thus
* this helper function is provided in order to free (deallocate)
* the structure.
**/
-void gnutls_anon_free_client_sc( GNUTLS_ANON_CLIENT_CREDENTIALS sc) {
+void gnutls_anon_free_client_cred( GNUTLS_ANON_CLIENT_CREDENTIALS sc) {
return;
}
/**
- * gnutls_allocate_anon_client_sc - Used to allocate an GNUTLS_ANON_CLIENT CREDENTIALS structure
+ * gnutls_allocate_anon_client_cred - Used to allocate an GNUTLS_ANON_CLIENT CREDENTIALS structure
* @sc: is a pointer to an &GNUTLS_ANON_CLIENT_CREDENTIALS structure.
*
* This structure is complex enough to manipulate directly thus
* this helper function is provided in order to allocate
* the structure.
**/
-int gnutls_anon_allocate_client_sc( GNUTLS_ANON_CLIENT_CREDENTIALS *sc) {
+int gnutls_anon_allocate_client_cred( GNUTLS_ANON_CLIENT_CREDENTIALS *sc) {
/* anon_tmp is only there for *sc not to be null.
* it is not used at all;
*/
diff --git a/lib/gnutls_cert.c b/lib/gnutls_cert.c
index 4a6b81bc6e..bcc16951f9 100644
--- a/lib/gnutls_cert.c
+++ b/lib/gnutls_cert.c
@@ -90,14 +90,14 @@ void _gnutls_free_cert(gnutls_cert cert)
}
/**
- * gnutls_certificate_free_sc - Used to free an allocated CERTIFICATE CREDENTIALS structure
+ * gnutls_certificate_free_cred - Used to free an allocated CERTIFICATE CREDENTIALS structure
* @sc: is an &GNUTLS_CERTIFICATE_CREDENTIALS structure.
*
* This structure is complex enough to manipulate directly thus
* this helper function is provided in order to free (deallocate)
* the structure.
**/
-void gnutls_certificate_free_sc(GNUTLS_CERTIFICATE_CREDENTIALS sc)
+void gnutls_certificate_free_cred(GNUTLS_CERTIFICATE_CREDENTIALS sc)
{
int i, j;
@@ -130,14 +130,14 @@ void gnutls_certificate_free_sc(GNUTLS_CERTIFICATE_CREDENTIALS sc)
/**
- * gnutls_certificate_allocate_sc - Used to allocate an x509 SERVER CREDENTIALS structure
+ * gnutls_certificate_allocate_cred - Used to allocate an x509 SERVER CREDENTIALS structure
* @res: is a pointer to an &GNUTLS_CERTIFICATE_CREDENTIALS structure.
*
* This structure is complex enough to manipulate directly thus
* this helper function is provided in order to allocate
* the structure.
**/
-int gnutls_certificate_allocate_sc(GNUTLS_CERTIFICATE_CREDENTIALS * res)
+int gnutls_certificate_allocate_cred(GNUTLS_CERTIFICATE_CREDENTIALS * res)
{
*res = gnutls_calloc(1, sizeof(CERTIFICATE_CREDENTIALS_INT));
diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c
index e19e115dd5..a2e63da7f4 100644
--- a/lib/gnutls_x509.c
+++ b/lib/gnutls_x509.c
@@ -119,7 +119,7 @@ int i = 0;
/* This function will convert an attribute value, specified by the OID,
* to a string.
*/
-int _gnutls_x509_attribute_type2string( const char* OID, void* value,
+int _gnutls_x509_oid_data2string( const char* OID, void* value,
int value_size, char * res, int res_size) {
int result;
@@ -134,6 +134,11 @@ ASN1_TYPE tmpasn;
}
res[0] = 0;
+
+ if ( _gnutls_x509_oid_data_printable( OID) == 0) {
+ gnutls_assert();
+ return GNUTLS_E_UNKNOWN_ERROR;
+ }
ANAME = _gnutls_x509_oid2string( OID);
CHOICE = _gnutls_x509_oid_data_choice( OID);
@@ -236,7 +241,7 @@ static int _IREAD(ASN1_TYPE rasn, char* name, const char *OID,
return 1;
}
- result = _gnutls_x509_attribute_type2string( OID, str, len, res, res_size);
+ result = _gnutls_x509_oid_data2string( OID, str, len, res, res_size);
if (result < 0) return 1;
else return 0;
}
@@ -1442,7 +1447,11 @@ static int read_key_mem(GNUTLS_CERTIFICATE_CREDENTIALS res, const char *key, int
gnutls_free(b64);
return ret;
}
- break;
+ break;
+ default:
+ gnutls_assert();
+ gnutls_free(b64);
+ return GNUTLS_E_INTERNAL_ERROR;
}
/* this doesn't hurt in the DER case, since
diff --git a/lib/gnutls_x509.h b/lib/gnutls_x509.h
index 7a53a88586..69e149846d 100644
--- a/lib/gnutls_x509.h
+++ b/lib/gnutls_x509.h
@@ -15,7 +15,7 @@ time_t gnutls_x509_extract_certificate_expiration_time( const gnutls_datum*);
time_t _gnutls_x509_utcTime2gtime(char *ttime);
time_t _gnutls_x509_generalTime2gtime(char *ttime);
-int _gnutls_x509_attribute_type2string( const char* OID, void* value,
+int _gnutls_x509_oid_data2string( const char* OID, void* value,
int value_size, char * res, int res_size);
const char* _gnutls_x509_oid2string( const char* OID);
diff --git a/lib/x509_xml.c b/lib/x509_xml.c
index 7bdf36e5ab..09a937d8bc 100644
--- a/lib/x509_xml.c
+++ b/lib/x509_xml.c
@@ -441,7 +441,7 @@ _gnutls_asn1_get_structure_xml(ASN1_TYPE structure, char *name,
&len3);
if (len2 > 0 && strcmp( p->name, "type")==0) {
- ret = _gnutls_x509_attribute_type2string( up->left->value, up->value+len3, len2, tmp, sizeof(tmp));
+ ret = _gnutls_x509_oid_data2string( up->left->value, up->value+len3, len2, tmp, sizeof(tmp));
if (ret >= 0) {
STR_APPEND( tmp);
diff --git a/libextra/gnutls_openssl.c b/libextra/gnutls_openssl.c
index f286817908..ba3356c6d4 100644
--- a/libextra/gnutls_openssl.c
+++ b/libextra/gnutls_openssl.c
@@ -112,7 +112,7 @@ SSL *SSL_new(SSL_CTX *ctx)
if (!ssl)
return NULL;
- err = gnutls_certificate_allocate_sc(&ssl->gnutls_cred);
+ err = gnutls_certificate_allocate_cred(&ssl->gnutls_cred);
if (err < 0)
{
last_error = err;
@@ -146,7 +146,7 @@ SSL *SSL_new(SSL_CTX *ctx)
void SSL_free(SSL *ssl)
{
- gnutls_certificate_free_sc(ssl->gnutls_cred);
+ gnutls_certificate_free_cred(ssl->gnutls_cred);
gnutls_deinit(ssl->gnutls_state);
free(ssl);
return;
diff --git a/libextra/gnutls_srp.c b/libextra/gnutls_srp.c
index 43874b90a4..f8a232abaf 100644
--- a/libextra/gnutls_srp.c
+++ b/libextra/gnutls_srp.c
@@ -312,28 +312,28 @@ GNUTLS_MPI _gnutls_calc_srp_S2(GNUTLS_MPI B, GNUTLS_MPI g, GNUTLS_MPI x, GNUTLS_
}
/**
- * gnutls_srp_free_server_sc - Used to free an allocated GNUTLS_SRP_CLIENT_CREDENTIALS structure
+ * gnutls_srp_free_server_cred - Used to free an allocated GNUTLS_SRP_CLIENT_CREDENTIALS structure
* @sc: is an &GNUTLS_SRP_CLIENT_CREDENTIALS structure.
*
* This structure is complex enough to manipulate directly thus
* this helper function is provided in order to free (deallocate)
* the structure.
**/
-void gnutls_srp_free_client_sc( GNUTLS_SRP_CLIENT_CREDENTIALS sc) {
+void gnutls_srp_free_client_cred( GNUTLS_SRP_CLIENT_CREDENTIALS sc) {
gnutls_free( sc->username);
gnutls_free( sc->password);
gnutls_free( sc);
}
/**
- * gnutls_srp_allocate_server_sc - Used to allocate an GNUTLS_SRP_SERVER_CREDENTIALS structure
+ * gnutls_srp_allocate_server_cred - Used to allocate an GNUTLS_SRP_SERVER_CREDENTIALS structure
* @sc: is a pointer to an &GNUTLS_SRP_SERVER_CREDENTIALS structure.
*
* This structure is complex enough to manipulate directly thus
* this helper function is provided in order to allocate
* the structure.
**/
-int gnutls_srp_allocate_client_sc( GNUTLS_SRP_CLIENT_CREDENTIALS *sc) {
+int gnutls_srp_allocate_client_cred( GNUTLS_SRP_CLIENT_CREDENTIALS *sc) {
*sc = gnutls_calloc( 1, sizeof(SRP_CLIENT_CREDENTIALS_INT));
if (*sc==NULL) return GNUTLS_E_MEMORY_ERROR;
@@ -368,14 +368,14 @@ int gnutls_srp_set_client_cred( GNUTLS_SRP_CLIENT_CREDENTIALS res, char *usernam
}
/**
- * gnutls_srp_free_server_sc - Used to free an allocated GNUTLS_SRP_SERVER_CREDENTIALS structure
+ * gnutls_srp_free_server_cred - Used to free an allocated GNUTLS_SRP_SERVER_CREDENTIALS structure
* @sc: is an &GNUTLS_SRP_SERVER_CREDENTIALS structure.
*
* This structure is complex enough to manipulate directly thus
* this helper function is provided in order to free (deallocate)
* the structure.
**/
-void gnutls_srp_free_server_sc( GNUTLS_SRP_SERVER_CREDENTIALS sc) {
+void gnutls_srp_free_server_cred( GNUTLS_SRP_SERVER_CREDENTIALS sc) {
int i;
for (i=0;i<sc->password_files;i++) {
gnutls_free( sc->password_file[i]);
@@ -388,14 +388,14 @@ int i;
}
/**
- * gnutls_srp_allocate_server_sc - Used to allocate an GNUTLS_SRP_SERVER_CREDENTIALS structure
+ * gnutls_srp_allocate_server_cred - Used to allocate an GNUTLS_SRP_SERVER_CREDENTIALS structure
* @sc: is a pointer to an &GNUTLS_SRP_SERVER_CREDENTIALS structure.
*
* This structure is complex enough to manipulate directly thus
* this helper function is provided in order to allocate
* the structure.
**/
-int gnutls_srp_allocate_server_sc( GNUTLS_SRP_SERVER_CREDENTIALS *sc) {
+int gnutls_srp_allocate_server_cred( GNUTLS_SRP_SERVER_CREDENTIALS *sc) {
*sc = gnutls_calloc( 1, sizeof(SRP_SERVER_CREDENTIALS_INT));
if (*sc==NULL) return GNUTLS_E_MEMORY_ERROR;
diff --git a/src/cli.c b/src/cli.c
index 0c62fcd93d..c6156792e1 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -141,7 +141,7 @@ int main(int argc, char **argv)
}
/* X509 stuff */
- if (gnutls_certificate_allocate_sc(&xcred) < 0) {
+ if (gnutls_certificate_allocate_cred(&xcred) < 0) {
fprintf(stderr, "Certificate allocation memory error\n");
exit(1);
}
@@ -195,14 +195,14 @@ int main(int argc, char **argv)
/* SRP stuff */
if (srp_username!=NULL) {
- if (gnutls_srp_allocate_client_sc(&cred) < 0) {
+ if (gnutls_srp_allocate_client_cred(&cred) < 0) {
fprintf(stderr, "SRP authentication error\n");
}
gnutls_srp_set_client_cred(cred, srp_username, srp_passwd);
}
/* ANON stuff */
- if (gnutls_anon_allocate_client_sc(&anon_cred) < 0) {
+ if (gnutls_anon_allocate_client_cred(&anon_cred) < 0) {
fprintf(stderr, "Anonymous authentication error\n");
}
@@ -450,9 +450,9 @@ int main(int argc, char **argv)
gnutls_deinit(state);
if (srp_username!=NULL)
- gnutls_srp_free_client_sc(cred);
- gnutls_certificate_free_sc(xcred);
- gnutls_anon_free_client_sc(anon_cred);
+ gnutls_srp_free_client_cred(cred);
+ gnutls_certificate_free_cred(xcred);
+ gnutls_anon_free_client_cred(anon_cred);
gnutls_global_deinit();
diff --git a/src/serv.c b/src/serv.c
index 1d9749b2b1..28997f404c 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -463,7 +463,7 @@ int main(int argc, char **argv)
if (generate != 0)
generate_dh_primes();
- if (gnutls_certificate_allocate_sc(&cert_cred) < 0) {
+ if (gnutls_certificate_allocate_cred(&cert_cred) < 0) {
fprintf(stderr, "memory error\n");
exit(1);
}
@@ -521,7 +521,7 @@ int main(int argc, char **argv)
/* this is a password file (created with the included srpcrypt utility)
* Read README.crypt prior to using SRP.
*/
- gnutls_srp_allocate_server_sc(&srp_cred);
+ gnutls_srp_allocate_server_cred(&srp_cred);
if (srp_passwd!=NULL)
if ((ret=gnutls_srp_set_server_cred_file(srp_cred, srp_passwd, srp_passwd_conf)) < 0) {
@@ -531,7 +531,7 @@ int main(int argc, char **argv)
}
- gnutls_anon_allocate_server_sc(&dh_cred);
+ gnutls_anon_allocate_server_cred(&dh_cred);
if (generate != 0)
gnutls_anon_set_server_dh_params(dh_cred, dh_params);
@@ -759,9 +759,9 @@ int main(int argc, char **argv)
}
- gnutls_certificate_free_sc(cert_cred);
- gnutls_srp_free_server_sc(srp_cred);
- gnutls_anon_free_server_sc(dh_cred);
+ gnutls_certificate_free_cred(cert_cred);
+ gnutls_srp_free_server_cred(srp_cred);
+ gnutls_anon_free_server_cred(dh_cred);
#ifdef HAVE_LIBGDBM
if (nodb==0) wrap_gdbm_deinit();
diff --git a/src/tls_test.c b/src/tls_test.c
index 8100fbd525..086832182c 100644
--- a/src/tls_test.c
+++ b/src/tls_test.c
@@ -146,20 +146,20 @@ int main(int argc, char **argv)
}
/* X509 stuff */
- if (gnutls_certificate_allocate_sc(&xcred) < 0) { /* space for 2 certificates */
+ if (gnutls_certificate_allocate_cred(&xcred) < 0) { /* space for 2 certificates */
fprintf(stderr, "memory error\n");
exit(1);
}
/* SRP stuff */
- if (gnutls_srp_allocate_client_sc(&srp_cred) < 0) {
+ if (gnutls_srp_allocate_client_cred(&srp_cred) < 0) {
fprintf(stderr, "memory error\n");
exit(1);
}
gnutls_srp_set_client_cred( srp_cred, "test", "test");
/* ANON stuff */
- if (gnutls_anon_allocate_client_sc(&anon_cred) < 0) {
+ if (gnutls_anon_allocate_client_cred(&anon_cred) < 0) {
fprintf(stderr, "memory error\n");
exit(1);
}
@@ -197,9 +197,9 @@ int main(int argc, char **argv)
i++;
} while(1);
- gnutls_srp_free_client_sc(srp_cred);
- gnutls_certificate_free_sc(xcred);
- gnutls_anon_free_client_sc(anon_cred);
+ gnutls_srp_free_client_cred(srp_cred);
+ gnutls_certificate_free_cred(xcred);
+ gnutls_anon_free_client_cred(anon_cred);
gnutls_global_deinit();