-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathutils.h
More file actions
38 lines (28 loc) · 894 Bytes
/
Copy pathutils.h
File metadata and controls
38 lines (28 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef UTILS_H
#define UTILS_H
#include <openssl/bn.h>
/*
Global context of the drown search.
At the beginning, we need to know :
* c, the ciphertext we are trying to decrypt ;
* hostport, the address for the oracle to connect, in the form "host:port" ;
* n, the modulus of the public key ;
* e, the exponent of the private key ;
*/
typedef struct
{
char *hostport;
BIGNUM *n;
BIGNUM *e;
BIGNUM *c;
BIGNUM *s;
BIGNUM *mt;
BN_CTX *ctx;
} drown_ctx;
void drown_new(drown_ctx * dctx);
void drown_free(drown_ctx * dctx);
void read_public_key(drown_ctx * dctx, char *filename);
void dump_wireshark(char *c_hex, BIGNUM *mt);
#define SSL_ASSERT(cond) if(!(cond)) { ERR_print_errors_fp(stderr); exit(EXIT_FAILURE); }
#define MY_ASSERT(cond, error) if(!(cond)) { fprintf(stderr, "ERROR : " error "\n"); exit(EXIT_FAILURE); }
#endif