Fix build when use old GnuTLS release (< 3.1)
FossilOrigin-Name: a707b54e17b5c62455abfdc7857ee9b4196f963848ff5401d9099ac8aeaa9eb9
This commit is contained in:
parent
77bbcd8fa4
commit
ec935f3306
@ -117,7 +117,11 @@ struct dtls_gnutls_data *dtls_gnutls_data_create(struct conn *conn,int config)
|
|||||||
|
|
||||||
|
|
||||||
int bits;
|
int bits;
|
||||||
|
#if GNUTLS_VERSION_NUMBER >= 0x030100
|
||||||
bits = gnutls_sec_param_to_pk_bits(GNUTLS_PK_DH, GNUTLS_SEC_PARAM_INSECURE);
|
bits = gnutls_sec_param_to_pk_bits(GNUTLS_PK_DH, GNUTLS_SEC_PARAM_INSECURE);
|
||||||
|
#elseif
|
||||||
|
bits = gnutls_sec_param_to_pk_bits(GNUTLS_PK_DH, GNUTLS_SEC_PARAM_WEAK);
|
||||||
|
#endif
|
||||||
/* Generate Diffie-Hellman parameters - for use with DHE
|
/* Generate Diffie-Hellman parameters - for use with DHE
|
||||||
* kx algorithms. When short bit length is used, it might
|
* kx algorithms. When short bit length is used, it might
|
||||||
* be wise to regenerate parameters often.
|
* be wise to regenerate parameters often.
|
||||||
|
@ -17,9 +17,11 @@ int dtls_gnutls_connect(struct conn *conn)
|
|||||||
d = dtls_gnutls_data_create(conn,GNUTLS_CLIENT | GNUTLS_DATAGRAM | GNUTLS_NONBLOCK);
|
d = dtls_gnutls_data_create(conn,GNUTLS_CLIENT | GNUTLS_DATAGRAM | GNUTLS_NONBLOCK);
|
||||||
|
|
||||||
// gnutls_dh_set_prime_bits(d->session, 512);
|
// gnutls_dh_set_prime_bits(d->session, 512);
|
||||||
gnutls_handshake_set_timeout(d->session,GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT);
|
#if GNUTLS_VERSION_NUMBER >= 0x030100
|
||||||
|
gnutls_handshake_set_timeout(d->session,GNUTLS_DEFAULT_HANDSHAKE_TIMEOUT);
|
||||||
|
|
||||||
gnutls_dtls_set_data_mtu(d->session,1500);
|
gnutls_dtls_set_data_mtu(d->session,1500);
|
||||||
|
#endif
|
||||||
gnutls_dtls_set_mtu(d->session,1500);
|
gnutls_dtls_set_mtu(d->session,1500);
|
||||||
|
|
||||||
int rc;
|
int rc;
|
||||||
|
Loading…
Reference in New Issue
Block a user