/* If our certificate supports signing
*/
- if ( apr_cert_list[0].keyUsage != 0)
+ if ( apr_cert_list != NULL)
+ if ( apr_cert_list[0].keyUsage != 0)
if ( !(apr_cert_list[0].keyUsage & X509KEY_DIGITAL_SIGNATURE)) {
gnutls_assert();
return GNUTLS_E_X509_KEY_USAGE_VIOLATION;
#define LIBGNUTLS_VERSION "@VERSION@"
+#include <sys/types.h>
+
#define GNUTLS_AES GNUTLS_RIJNDAEL
typedef enum BulkCipherAlgorithm { GNUTLS_NULL_CIPHER=1, GNUTLS_ARCFOUR, GNUTLS_3DES_CBC, GNUTLS_RIJNDAEL_CBC, GNUTLS_TWOFISH_CBC, GNUTLS_RIJNDAEL256_CBC } BulkCipherAlgorithm;
typedef enum CertificateStatus { GNUTLS_CERT_TRUSTED=1, GNUTLS_CERT_NOT_TRUSTED, GNUTLS_CERT_EXPIRED, GNUTLS_CERT_INVALID } CertificateStatus;
typedef enum CertificateRequest { GNUTLS_CERT_REQUEST=1, GNUTLS_CERT_REQUIRE } CertificateRequest;
-typedef enum CloseRequest { GNUTLS_SHUT_WR=0, GNUTLS_SHUT_W=1 } CloseRequest;
+typedef enum CloseRequest { GNUTLS_SHUT_RDWR=0, GNUTLS_SHUT_WR=1 } CloseRequest;
typedef enum GNUTLS_Version { GNUTLS_SSL3=1, GNUTLS_TLS1 } GNUTLS_Version;
} AlertDescription;
typedef enum CertificateStatus { GNUTLS_CERT_TRUSTED=1, GNUTLS_CERT_NOT_TRUSTED, GNUTLS_CERT_EXPIRED, GNUTLS_CERT_INVALID } CertificateStatus;
typedef enum CertificateRequest { GNUTLS_CERT_REQUEST=1, GNUTLS_CERT_REQUIRE } CertificateRequest;
-typedef enum CloseRequest { GNUTLS_SHUT_WR=0, GNUTLS_SHUT_W=1 } CloseRequest;
+typedef enum CloseRequest { GNUTLS_SHUT_RDWR=0, GNUTLS_SHUT_WR=1 } CloseRequest;
typedef enum HandshakeType { GNUTLS_HELLO_REQUEST, GNUTLS_CLIENT_HELLO, GNUTLS_SERVER_HELLO,
GNUTLS_CERTIFICATE=11, GNUTLS_SERVER_KEY_EXCHANGE,
*
* Terminates the current TLS/SSL connection. The connection should
* have been initiated using gnutls_handshake().
- * 'how' should be one of GNUTLS_SHUT_WR, GNUTLS_SHUT_W.
+ * 'how' should be one of GNUTLS_SHUT_RDWR, GNUTLS_SHUT_WR.
*
- * in case of GNUTLS_SHUT_WR then the connection gets terminated and
+ * in case of GNUTLS_SHUT_RDWR then the connection gets terminated and
* further receives and sends will be disallowed. If the return
* value is zero you may continue using the TCP connection.
*
- * in case of GNUTLS_SHUT_W then the connection gets terminated and
+ * in case of GNUTLS_SHUT_WR then the connection gets terminated and
* further sends will be disallowed. In order to reuse the TCP connection
* you should wait for an EOF from the peer.
*
ret = gnutls_send_alert(cd, state, GNUTLS_WARNING, GNUTLS_CLOSE_NOTIFY);
- if ( how == GNUTLS_SHUT_WR && ret == 0) {
+ if ( how == GNUTLS_SHUT_RDWR && ret == 0) {
ret2 = gnutls_recv_int(cd, state, GNUTLS_ALERT, -1, NULL, 0, 0);
state->gnutls_internals.may_read = 1;
}
* not call close().
*/
if (type != GNUTLS_ALERT)
- gnutls_bye( cd, state, GNUTLS_SHUT_W);
+ gnutls_bye( cd, state, GNUTLS_SHUT_WR);
gnutls_free(tmpdata);
print_info( state);
printf("- Disconnecting\n");
- gnutls_bye(sd, state, GNUTLS_SHUT_WR);
+ gnutls_bye(sd, state, GNUTLS_SHUT_RDWR);
shutdown( sd, SHUT_WR);
close(sd);
gnutls_deinit( state);
if (FD_ISSET(fileno(stdin), &rset)) {
if( fgets(buffer, MAX_BUF, stdin) == NULL) {
- gnutls_bye(sd, state, GNUTLS_SHUT_W);
+ gnutls_bye(sd, state, GNUTLS_SHUT_WR);
user_term = 1;
continue;
}
}
}
- if (user_term!=0) gnutls_bye(sd, state, GNUTLS_SHUT_WR);
+ if (user_term!=0) gnutls_bye(sd, state, GNUTLS_SHUT_RDWR);
shutdown( sd, SHUT_RDWR); /* no more receptions */
close(sd);
}
}
printf("\n");
- gnutls_bye(sd, state, 1); /* do not wait for
+ gnutls_bye(sd, state, GNUTLS_SHUT_WR); /* do not wait for
* the peer to close the connection.
*/
close(sd);