Skip to content

Commit

Permalink
Add Session functions, necessary to implement new features in Python …
Browse files Browse the repository at this point in the history
…3.6. (#4205)
  • Loading branch information
amauryfa authored and reaperhulk committed Apr 24, 2018
1 parent 31808de commit c81df6b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/_cffi_src/openssl/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@
SSL_SESSION *SSL_get_session(const SSL *);
const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *, unsigned int *);
long SSL_SESSION_get_time(const SSL_SESSION *);
long SSL_SESSION_get_timeout(const SSL_SESSION *);
int SSL_SESSION_has_ticket(const SSL_SESSION *);
long SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *);
/* not a macro, but older OpenSSLs don't pass the args as const */
char *SSL_CIPHER_description(const SSL_CIPHER *, char *, int);
Expand Down Expand Up @@ -570,6 +574,16 @@
memcpy(out, session->master_key, outlen);
return outlen;
}
/* from ssl/ssl_sess.c */
int SSL_SESSION_has_ticket(const SSL_SESSION *s)
{
return (s->tlsext_ticklen > 0) ? 1 : 0;
}
/* from ssl/ssl_sess.c */
unsigned long SSL_SESSION_get_ticket_lifetime_hint(const SSL_SESSION *s)
{
return s->tlsext_tick_lifetime_hint;
}
#endif
static const long Cryptography_HAS_SECURE_RENEGOTIATION = 1;
Expand Down

0 comments on commit c81df6b

Please sign in to comment.