## Process this file with automake to produce Makefile.in
EXTRA_DIST = ChangeLog NEWS INSTALL README THANKS COPYING PGPKEYS COPYING.LIB
-SUBDIRS = $(LIBASN1_DIR) lib libextra src doc tests
+SUBDIRS = $(LIBASN1_DIR) includes lib libextra src doc tests
ChangeLog:
cvs2cl --utc -U .cvsusers --fsf -t -S --prune
AC_CONFIG_FILES(lib/gnutls.h.in)
-AC_CONFIG_COMMANDS([lib/gnutls.h],[[
- test -f lib/gnutls.h.in || (echo "Could not generate lib/gnutls.h" && exit 1)
- cat lib/gnutls.h.in > lib/gnutls.h
- cat lib/gnutls_ui.h >> lib/gnutls.h
- echo "" >> lib/gnutls.h
- cat lib/gnutls_errors_int.h | grep -v _INT_ >> lib/gnutls.h
- echo "" >> lib/gnutls.h
- echo "#ifdef __cplusplus" >> lib/gnutls.h
- echo "}" >> lib/gnutls.h
- echo "#endif" >> lib/gnutls.h
- echo "#endif /* GNUTLS_H */" >> lib/gnutls.h
- echo "" >> lib/gnutls.h
+AC_CONFIG_COMMANDS([includes/gnutls/gnutls.h],[[
+ test -f lib/gnutls.h.in || (echo "Could not generate includes/gnutls/gnutls.h" && exit 1)
+ cat lib/gnutls.h.in > includes/gnutls/gnutls.h
+ cat lib/gnutls_ui.h >> includes/gnutls/gnutls.h
+ echo "" >> includes/gnutls/gnutls.h
+ cat lib/gnutls_errors_int.h | grep -v _INT_ >> includes/gnutls/gnutls.h
+ echo "" >> includes/gnutls/gnutls.h
+ echo "#ifdef __cplusplus" >> includes/gnutls/gnutls.h
+ echo "}" >> includes/gnutls/gnutls.h
+ echo "#endif" >> includes/gnutls/gnutls.h
+ echo "#endif /* GNUTLS_H */" >> includes/gnutls/gnutls.h
+ echo "" >> includes/gnutls/gnutls.h
chmod +x lib/libgnutls-config
chmod +x libextra/libgnutls-extra-config
]],[[]])
lib/libgnutls-config libextra/libgnutls-extra-config \
doc/Makefile src/x509/Makefile src/srp/Makefile src/openpgp/Makefile \
doc/tex/Makefile doc/tex/cover.tex doc/scripts/Makefile \
-tests/Makefile])
+tests/Makefile includes/Makefile includes/gnutls/Makefile])
AC_OUTPUT
-INCLUDES = -I../libextra -I../libtasn1/lib/
-include_HEADERS = gnutls.h
+INCLUDES = -I../libextra -I../libtasn1/lib/ -I../includes
bin_SCRIPTS = libgnutls-config
m4datadir = $(datadir)/aclocal
GNUTLS_CompressionMethod gnutls_compression_get( GNUTLS_STATE state);
GNUTLS_CertificateType gnutls_cert_type_get( GNUTLS_STATE state);
-size_t gnutls_cipher_get_key_size(BulkCipherAlgorithm algorithm);
+size_t gnutls_cipher_get_key_size( GNUTLS_BulkCipherAlgorithm algorithm);
/* the name of the specified algorithms */
const char *gnutls_cipher_get_name( GNUTLS_BulkCipherAlgorithm);
* @algorithm: is an encryption algorithm
*
* Returns the length (in bytes) of the given cipher's key size.
+ * Returns 0 if the given cipher is invalid.
+ *
**/
size_t gnutls_cipher_get_key_size(BulkCipherAlgorithm algorithm)
{ /* In bytes */
-#include "gnutls.h"
+#include <gnutls/gnutls.h>
/* This file contains functions needed only for binary compatibility
* with previous versions.
{NULL}
};
+/* Returns 1 if the data defined by the OID are printable.
+ */
int _gnutls_x509_oid_data_printable( const char* OID) {
int i = 0;
return 0;
}
+/* Returns 1 if the data defined by the OID are of a choice
+ * type.
+ */
int _gnutls_x509_oid_data_choice( const char* OID) {
int i = 0;
-INCLUDES = -I../lib -I../libtasn1/lib/
-include_HEADERS = extra.h openssl.h
+INCLUDES = -I../lib -I../libtasn1/lib/ -I../includes
bin_SCRIPTS = libgnutls-extra-config
m4datadir = $(datadir)/aclocal
+++ /dev/null
-/*
- * Copyright (C) 2002 Nikos Mavroyanopoulos
- *
- * 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.
- *
- * 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.
- *
- * 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
- */
-
-/* Note the libgnutls-extra is not a standalone library. It requires
- * to link also against libgnutls.
- */
-
-#ifndef GNUTLS_EXTRA_H
-# define GNUTLS_EXTRA_H
-
-#include <gnutls/gnutls.h>
-
-/* SRP */
-
-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);
-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);
-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);
-
-typedef int gnutls_srp_server_select_function(GNUTLS_STATE, char **, char**, int);
-
-void gnutls_srp_server_set_select_function( GNUTLS_STATE, gnutls_srp_server_select_function *);
-
-/* Openpgp certificate stuff */
-int gnutls_openpgp_fingerprint( const gnutls_datum* data, char* result, size_t* result_size);
-
-int gnutls_openpgp_get_key_xml( const gnutls_datum *cert, int ext,
- gnutls_datum *xmlkey);
-
-int gnutls_openpgp_extract_key_name( const gnutls_datum *cert,
- int idx,
- gnutls_openpgp_name *dn );
-
-int gnutls_openpgp_extract_key_pk_algorithm(const gnutls_datum *cert,
- int *r_bits);
-
-int gnutls_openpgp_extract_key_version( const gnutls_datum *cert );
-
-time_t gnutls_openpgp_extract_key_creation_time( const gnutls_datum *cert );
-time_t gnutls_openpgp_extract_key_expiration_time( const gnutls_datum *cert );
-
-int gnutls_openpgp_verify_key( const gnutls_datum* keyring,
- const gnutls_datum* key_list,
- int key_list_length);
-
-int gnutls_certificate_set_openpgp_key_file( GNUTLS_CERTIFICATE_CREDENTIALS res, char *CERTFILE, char* KEYFILE);
-int gnutls_certificate_set_openpgp_key_mem( GNUTLS_CERTIFICATE_CREDENTIALS res,
- const gnutls_datum* CERT, const gnutls_datum* KEY);
-
-int gnutls_certificate_set_openpgp_keyserver(GNUTLS_CERTIFICATE_CREDENTIALS res,
- char* keyserver, int port);
-
-int gnutls_certificate_set_openpgp_trustdb(GNUTLS_CERTIFICATE_CREDENTIALS res,
- char* trustdb);
-
-int gnutls_certificate_set_openpgp_keyring_mem(
- GNUTLS_CERTIFICATE_CREDENTIALS c,
- const unsigned char *data, size_t dlen );
-
-int gnutls_certificate_set_openpgp_keyring_file( GNUTLS_CERTIFICATE_CREDENTIALS res, const char *name);
-
-int gnutls_global_init_extra(void);
-
-#endif
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-#include <gnutls.h>
+#include <gnutls/gnutls.h>
#include <gcrypt.h>
#include <stdio.h>
#include <stdlib.h>
-#include "openssl.h"
+#include <gnutls/openssl.h>
static int last_error = 0;
+++ /dev/null
-/*
- * Copyright (c) 2002 Andrew McDonald <andrew@mcdonald.org.uk>
- *
- * 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.
- *
- * 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.
- *
- * 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.
- */
-
-
-/* FIXME FIXME FIXME
- Things to fix:
- error handling
- SSL->options
-*/
-
-#ifndef GNUTLS_OPENSSL_H
-#define GNUTLS_OPENSSL_H
-#include <gnutls/gnutls.h>
-#include <gcrypt.h>
-
-#define OPENSSL_VERSION_NUMBER (0x0090604F)
-#define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER
-#define OPENSSL_VERSION_TEXT ("GNUTLS " LIBGNUTLS_VERSION " ")
-
-#define SSL_ERROR_NONE (0)
-#define SSL_ERROR_SSL (1)
-#define SSL_ERROR_WANT_READ (2)
-#define SSL_ERROR_WANT_WRITE (3)
-#define SSL_ERROR_SYSCALL (5)
-#define SSL_ERROR_ZERO_RETURN (6)
-
-#define SSL_FILETYPE_PEM (GNUTLS_X509_FMT_PEM)
-
-#define SSL_VERIFY_NONE (0)
-
-#define SSL_ST_OK (1)
-
-#define X509_V_ERR_CERT_NOT_YET_VALID (1)
-#define X509_V_ERR_CERT_HAS_EXPIRED (2)
-#define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT (3)
-
-#define SSL_OP_ALL (0x000FFFFF)
-#define SSL_OP_NO_TLSv1 (0x0400000)
-
-typedef gnutls_x509_dn X509_NAME;
-typedef gnutls_datum X509;
-
-struct _SSL;
-
-typedef struct
-{
- int protocol_priority[GNUTLS_MAX_ALGORITHM_NUM];
- int cipher_priority[GNUTLS_MAX_ALGORITHM_NUM];
- int comp_priority[GNUTLS_MAX_ALGORITHM_NUM];
- int kx_priority[GNUTLS_MAX_ALGORITHM_NUM];
- int mac_priority[GNUTLS_MAX_ALGORITHM_NUM];
-} SSL_METHOD;
-
-
-typedef struct
-{
- GNUTLS_Version version;
- GNUTLS_BulkCipherAlgorithm cipher;
- GNUTLS_KXAlgorithm kx;
- GNUTLS_MACAlgorithm mac;
- GNUTLS_CompressionMethod compression;
- GNUTLS_CertificateType cert;
-} SSL_CIPHER;
-
-typedef struct
-{
- struct _SSL *ssl;
- int error;
- gnutls_datum *cert_list;
-#define current_cert cert_list
-} X509_STORE_CTX;
-
-typedef struct _SSL_CTX
-{
- SSL_METHOD *method;
- char *certfile;
- int certfile_type;
- char *keyfile;
- int keyfile_type;
- unsigned long options;
-
- int (*verify_callback)(int, X509_STORE_CTX *);
- int verify_mode;
-
-} SSL_CTX;
-
-typedef struct _SSL
-{
- GNUTLS_STATE gnutls_state;
-#define rbio gnutls_state
- GNUTLS_CERTIFICATE_CLIENT_CREDENTIALS gnutls_cred;
-
- SSL_CTX *ctx;
- SSL_CIPHER ciphersuite;
-
- int last_error;
- int shutdown;
- int state;
- unsigned long options;
-
- int (*verify_callback)(int, X509_STORE_CTX *);
- int verify_mode;
-} SSL;
-
-typedef struct
-{
- GCRY_MD_HD handle;
-} MD_CTX;
-
-#define MD5_CTX MD_CTX
-#define RIPEMD160_CTX MD_CTX
-
-#define OpenSSL_add_ssl_algorithms() SSL_library_init()
-#define SSLeay_add_ssl_algorithms() SSL_library_init()
-#define SSLeay_add_all_algorithms() OpenSSL_add_all_algorithms()
-
-#define SSL_get_cipher_name(ssl) SSL_CIPHER_get_name(SSL_get_current_cipher(ssl))
-#define SSL_get_cipher(ssl) SSL_get_cipher_name(ssl)
-#define SSL_get_cipher_bits(ssl,bp) SSL_CIPHER_get_bits(SSL_get_current_cipher(ssl),(bp))
-#define SSL_get_cipher_version(ssl) SSL_CIPHER_get_version(SSL_get_current_cipher(ssl))
-
-
-/* Library initialisation functions */
-
-int SSL_library_init(void);
-void OpenSSL_add_all_algorithms(void);
-
-
-/* SSL_CTX structure handling */
-
-SSL_CTX *SSL_CTX_new(SSL_METHOD *method);
-void SSL_CTX_free(SSL_CTX *ctx);
-int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx);
-int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *certfile, int type);
-int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *keyfile, int type);
-void SSL_CTX_set_verify(SSL_CTX *ctx, int verify_mode,
- int (*verify_callback)(int, X509_STORE_CTX *));
-unsigned long SSL_CTX_set_options(SSL_CTX *ssl, unsigned long options);
-
-
-/* SSL structure handling */
-
-SSL *SSL_new(SSL_CTX *ctx);
-void SSL_free(SSL *ssl);
-void SSL_load_error_strings(void);
-int SSL_get_error(SSL *ssl, int ret);
-int SSL_set_fd(SSL *ssl, int fd);
-void SSL_set_connect_state(SSL *ssl);
-int SSL_pending(SSL *ssl);
-void SSL_set_verify(SSL *ssl, int verify_mode,
- int (*verify_callback)(int, X509_STORE_CTX *));
-
-
-/* SSL connection open/close/read/write functions */
-
-int SSL_connect(SSL *ssl);
-int SSL_shutdown(SSL *ssl);
-int SSL_read(SSL *ssl, const void *buf, int len);
-int SSL_write(SSL *ssl, const void *buf, int len);
-
-
-/* SSL_METHOD functions */
-
-SSL_METHOD *SSLv23_client_method(void);
-
-
-/* SSL_CIPHER functions */
-
-SSL_CIPHER *SSL_get_current_cipher(SSL *ssl);
-const char *SSL_CIPHER_get_name(SSL_CIPHER *cipher);
-int SSL_CIPHER_get_bits(SSL_CIPHER *cipher, int *bits);
-const char *SSL_CIPHER_get_version(SSL_CIPHER *cipher);
-
-
-/* X509 functions */
-
-X509_NAME *X509_get_subject_name(X509 *cert);
-char *X509_NAME_oneline(gnutls_x509_dn *name, char *buf, int len);
-
-
-/* BIO functions */
-
-void BIO_get_fd(GNUTLS_STATE gnutls_state, int *fd);
-
-
-/* error handling */
-
-unsigned long ERR_get_error(void);
-char *ERR_error_string(unsigned long e, char *buf);
-
-
-/* RAND functions */
-
-int RAND_status(void);
-void RAND_seed(const void *buf, int num);
-int RAND_bytes(unsigned char *buf, int num);
-const char *RAND_file_name(char *buf, size_t len);
-int RAND_load_file(const char *name, long maxbytes);
-int RAND_write_file(const char *name);
-
-
-/* message digest functions */
-
-void MD5_Init(MD5_CTX *ctx);
-void MD5_Update(MD5_CTX *ctx, const void *buf, int len);
-void MD5_Final(unsigned char *md, MD5_CTX *ctx);
-unsigned char *MD5(const unsigned char *buf, unsigned long len,
- unsigned char *md);
-
-void RIPEMD160_Init(RIPEMD160_CTX *ctx);
-void RIPEMD160_Update(RIPEMD160_CTX *ctx, const void *buf, int len);
-void RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *ctx);
-unsigned char *RIPEMD160(const unsigned char *buf, unsigned long len,
- unsigned char *md);
-#endif
tls_test-gaa.h tests.h gnutls-http-serv list.h
SUBDIRS = srp x509 openpgp
-INCLUDES = -I../lib -I../libtasn1/lib
+INCLUDES = -I../lib -I../libtasn1/lib -I../includes
bin_PROGRAMS = gnutls-serv gnutls-cli gnutls-srpcrypt gnutls-cli-debug
gnutls_serv_SOURCES = serv-gaa.c serv.c common.c
#include <arpa/inet.h>
#include <string.h>
#include <unistd.h>
-#include "../lib/gnutls.h"
-#include "../libextra/extra.h"
+#include <gnutls/gnutls.h>
+#include <gnutls/extra.h>
#include <sys/time.h>
#include <signal.h>
#include <netdb.h>
#include <stdio.h>
-#include "../lib/gnutls.h"
-#include "../libextra/extra.h"
+#include <gnutls/gnutls.h>
+#include <gnutls/extra.h>
#include <time.h>
#define PRINTX(x,y) if (y[0]!=0) printf(" # %s %s\n", x, y)
time_t expiret = gnutls_certificate_expiration_time_peers(state);
time_t activet = gnutls_certificate_activation_time_peers(state);
-/* gnutls_datum xml; */
+// gnutls_datum xml;
cert_list = gnutls_certificate_get_peers(state, &cert_list_size);
if (cert_list_size <= 0)
return;
-/*
-gnutls_x509_get_certificate_xml( &cert_list[0], 0, &xml);
-fprintf(stderr, "%s\n", xml.data);
-return 0;*/
+
+//gnutls_x509_get_certificate_xml( &cert_list[0], 0, &xml);
+//fprintf(stderr, "%s\n", xml.data);
+//return 0;
printf(" - Certificate info:\n");
#include <unistd.h>
#include "prime-gaa.h"
#include <gcrypt.h>
-#include "../lib/gnutls.h"
+#include <gnutls/gnutls.h>
#include "../lib/defines.h"
MPI _gcry_generate_elg_prime( int mode, unsigned pbits, unsigned qbits,
#include <arpa/inet.h>
#include <string.h>
#include <unistd.h>
-#include "../lib/gnutls.h"
-#include "../libextra/extra.h"
+#include <gnutls/gnutls.h>
+#include <gnutls/extra.h>
#include "common.h"
#include <signal.h>
#include "serv-gaa.h"
time_t tt;
char* ctt;
- int yes = 1;
/* new list entry for the connection */
lappend (listener_list);
j = listener_list.tail;
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-#include "../lib/gnutls.h"
-#include "../libextra/extra.h"
+#include <gnutls/gnutls.h>
+#include <gnutls/extra.h>
#include <tests.h>
#include <unistd.h>
#include <signal.h>
#include <arpa/inet.h>
#include <string.h>
#include <unistd.h>
-#include "../lib/gnutls.h"
-#include "../libextra/extra.h"
+#include <gnutls/gnutls.h>
+#include <gnutls/extra.h>
#include <sys/time.h>
#include <signal.h>
#include <netdb.h>
## Process this file with automake to produce Makefile.in
-INCLUDES= -I../lib/ -I../libtasn1/lib/
+INCLUDES= -I../lib/ -I../libtasn1/lib/ -I../includes
noinst_PROGRAMS = x509test
x509test_SOURCES = x509_test.c