Skip to content

Commit

Permalink
support elliptic curve key exchange for DTLS-SRTP
Browse files Browse the repository at this point in the history
fixes #130
  • Loading branch information
rfuchs committed Jul 8, 2015
1 parent 5ba8e2e commit 21e1fb6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions daemon/dtls.c
Expand Up @@ -520,6 +520,13 @@ int dtls_connection_init(struct packet_stream *ps, int active, struct dtls_cert
SSL_set_bio(d->ssl, d->r_bio, d->w_bio);
SSL_set_mode(d->ssl, SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);

EC_KEY* ecdh = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1);
if (ecdh == NULL)
goto error;
SSL_set_options(d->ssl, SSL_OP_SINGLE_ECDH_USE);
SSL_set_tmp_ecdh(d->ssl, ecdh);
EC_KEY_free(ecdh);

d->init = 1;
d->active = active ? -1 : 0;

Expand Down

0 comments on commit 21e1fb6

Please sign in to comment.