diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2021-01-13 11:47:29 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2021-01-14 14:29:59 +0100 |
commit | 9178c4d56b7270a6b813995f55a4828ce96256d8 (patch) | |
tree | ac6a539983294f42cc2b97d404f95912d2c7a8fe /src/SWIG/_lib.h | |
parent | d93ee3c676929ae1ca9b3acb94a8ce9c3f9c936d (diff) | |
download | m2crypto-9178c4d56b7270a6b813995f55a4828ce96256d8.tar.gz |
Move project to src/ layout
Diffstat (limited to 'src/SWIG/_lib.h')
-rw-r--r-- | src/SWIG/_lib.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/SWIG/_lib.h b/src/SWIG/_lib.h new file mode 100644 index 0000000..f1973b4 --- /dev/null +++ b/src/SWIG/_lib.h @@ -0,0 +1,31 @@ +/* Copyright (c) 1999 Ng Pheng Siong. All rights reserved. */ +/* $Id$ */ + +#include <openssl/bn.h> + +typedef struct _blob { + unsigned char *data; + int len; +} Blob; + +Blob *blob_new(int len, const char *errmsg); +Blob *blob_copy(Blob *from, const char *errmsg); +void blob_free(Blob *blob); + +static int m2_PyObject_AsReadBuffer(PyObject *obj, const void **buffer, + Py_ssize_t *buffer_len); +static int m2_PyObject_AsReadBufferInt(PyObject *obj, const void **buffer, + int *buffer_len); +static int m2_PyString_AsStringAndSizeInt(PyObject *obj, char **s, int *len); + +static BIGNUM* m2_PyObject_AsBIGNUM(PyObject* value, PyObject* _py_exc) ; + +/* Always use these two together, to correctly handle non-memoryview objects. */ +static int m2_PyObject_GetBufferInt(PyObject *obj, Py_buffer *view, int flags); +static void m2_PyBuffer_Release(PyObject *obj, Py_buffer *view); + +int bn_gencb_callback(int p, int n, BN_GENCB *gencb); +int passphrase_callback(char *buf, int num, int v, void *userdata); + +void lib_init(void); + |