Jean-Paul Calderone | 897bc25 | 2008-02-18 20:50:23 -0500 | [diff] [blame^] | 1 | /* |
| 2 | * context.h |
| 3 | * |
| 4 | * Copyright (C) AB Strakt 2001, All rights reserved |
| 5 | * |
| 6 | * Export SSL Context object data structures and functions. |
| 7 | * See the file RATIONALE for a short explanation of why this module was written. |
| 8 | * |
| 9 | * Reviewed 2001-07-23 |
| 10 | * |
| 11 | * @(#) $Id: context.h,v 1.6 2002/09/04 22:24:59 iko Exp $ |
| 12 | */ |
| 13 | #ifndef PyOpenSSL_SSL_CONTEXT_H_ |
| 14 | #define PyOpenSSL_SSL_CONTEXT_H_ |
| 15 | |
| 16 | #include <Python.h> |
| 17 | #include <openssl/ssl.h> |
| 18 | |
| 19 | extern int init_ssl_context (PyObject *); |
| 20 | |
| 21 | extern PyTypeObject ssl_Context_Type; |
| 22 | |
| 23 | #define ssl_Context_Check(v) ((v)->ob_type == &ssl_Context_Type) |
| 24 | |
| 25 | typedef struct { |
| 26 | PyObject_HEAD |
| 27 | SSL_CTX *ctx; |
| 28 | PyObject *passphrase_callback, |
| 29 | *passphrase_userdata, |
| 30 | *verify_callback, |
| 31 | *info_callback, |
| 32 | *app_data; |
| 33 | PyThreadState *tstate; |
| 34 | } ssl_ContextObj; |
| 35 | |
| 36 | #define ssl_SSLv2_METHOD (1) |
| 37 | #define ssl_SSLv3_METHOD (2) |
| 38 | #define ssl_SSLv23_METHOD (3) |
| 39 | #define ssl_TLSv1_METHOD (4) |
| 40 | |
| 41 | |
| 42 | #endif |