Skip to content

Commit bb843cf

Browse files
authored
Merge pull request #82 from Geod24/evp-fixes
evp: Add all missing bindings for v1.1.0 and some for later versions
2 parents c363dcd + dba9f9d commit bb843cf

File tree

6 files changed

+634
-226
lines changed

6 files changed

+634
-226
lines changed

source/deimos/openssl/bn.d

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -310,66 +310,6 @@ void BN_with_flags()(BIGNUM* dest, BIGNUM* b, int n) {
310310
| n;
311311
}
312312

313-
/* Already declared in types.h */
314-
version (none) {
315-
alias bignum_st BIGNUM;
316-
/* Used for temp variables (declaration hidden in bn_lcl.h) */
317-
alias bignum_ctx BN_CTX;
318-
alias bn_blinding_st BN_BLINDING;
319-
alias bn_mont_ctx_st BN_MONT_CTX;
320-
alias bn_recp_ctx_st BN_RECP_CTX;
321-
alias bn_gencb_st BN_GENCB;
322-
}
323-
324-
struct bignum_st
325-
{
326-
BN_ULONG* d; /* Pointer to an array of 'BN_BITS2' bit chunks. */
327-
int top; /* Index of last used d +1. */
328-
/* The next are internal book keeping for bn_expand. */
329-
int dmax; /* Size of the d array. */
330-
int neg; /* one if the number is negative */
331-
int flags;
332-
};
333-
334-
/* Used for montgomery multiplication */
335-
struct bn_mont_ctx_st
336-
{
337-
int ri; /* number of bits in R */
338-
BIGNUM RR; /* used to convert to montgomery form */
339-
BIGNUM N; /* The modulus */
340-
BIGNUM Ni; /* R*(1/R mod N) - N*Ni = 1
341-
* (Ni is only stored for bignum algorithm) */
342-
BN_ULONG[2] n0;/* least significant word(s) of Ni;
343-
(type changed with 0.9.9, was "BN_ULONG n0;" before) */
344-
int flags;
345-
};
346-
347-
/* Used for reciprocal division/mod functions
348-
* It cannot be shared between threads
349-
*/
350-
struct bn_recp_ctx_st
351-
{
352-
BIGNUM N; /* the divisor */
353-
BIGNUM Nr; /* the reciprocal */
354-
int num_bits;
355-
int shift;
356-
int flags;
357-
};
358-
359-
/* Used for slow "generation" functions. */
360-
struct bn_gencb_st
361-
{
362-
uint ver; /* To handle binary (in)compatibility */
363-
void* arg; /* callback-specific data */
364-
union cb_
365-
{
366-
/* if(ver==1) - handles old style callbacks */
367-
ExternC!(void function(int, int, void*)) cb_1;
368-
/* if(ver==2) - new callback style */
369-
ExternC!(int function(int, int, BN_GENCB*)) cb_2;
370-
}
371-
cb_ cb;
372-
};
373313
/* Wrapper function to make using BN_GENCB easier, */
374314
int BN_GENCB_call(BN_GENCB* cb, int a, int b);
375315
/* Macro to populate a BN_GENCB structure with an "old"-style callback */

source/deimos/openssl/buffer.d

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,8 @@ nothrow:
6767

6868
import core.stdc.config;
6969

70-
//#if !defined(NO_SYS_TYPES_H)
71-
//#include <sys/types.h>
72-
//#endif
73-
74-
/* Already declared in types.h */
75-
/* typedef buf_mem_st BUF_MEM; */
76-
77-
struct buf_mem_st
78-
{
79-
size_t length; /* current number of bytes */
80-
char* data;
81-
size_t max; /* size of buffer */
82-
};
70+
// Without this, the frontend is unaware of types defined in `static if`.
71+
private enum avoidDMDIssue16666 = __traits(allMembers, deimos.openssl.types);
8372

8473
BUF_MEM* BUF_MEM_new();
8574
void BUF_MEM_free(BUF_MEM* a);

0 commit comments

Comments
 (0)