summaryrefslogtreecommitdiffstats
path: root/perl/OpenSSL.xs
blob: 2267168b79a95cea9b4998d17eb54ba0d2b49e4c (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
**  OpenSSL.xs
*/

#include "openssl.h"

SV *
new_ref(type, obj, mort)
  char *type;
  char *obj;
{
    SV *ret;

    if (mort)
        ret = sv_newmortal();
    else
        ret = newSViv(0);
#ifdef DEBUG
    printf(">new_ref %d\n",type);
#endif
    sv_setref_pv(ret, type, (void *)obj);
    return(ret);
}

int 
ex_new(obj, data, ad, idx, argl, argp)
  char *obj;
  SV *data;
  CRYPTO_EX_DATA *ad;
  int idx;
  long argl;
  char *argp;
{
    SV *sv;

#ifdef DEBUG
    printf("ex_new %08X %s\n",obj,argp); 
#endif
    sv = sv_newmortal();
    sv_setref_pv(sv, argp, (void *)obj);
#ifdef DEBUG
    printf("%d>new_ref '%s'\n", sv, argp);
#endif
    CRYPTO_set_ex_data(ad, idx, (char *)sv);
    return(1);
}

void 
ex_cleanup(obj, data, ad, idx, argl, argp)
  char *obj;
  SV *data;
  CRYPTO_EX_DATA *ad;
  int idx;
  long argl;
  char *argp;
{
    pr_name("ex_cleanup");
#ifdef DEBUG
    printf("ex_cleanup %08X %s\n", obj, argp);
#endif
    if (data != NULL)
        SvREFCNT_dec((SV *)data);
}

MODULE = OpenSSL  PACKAGE = OpenSSL

PROTOTYPES: ENABLE

BOOT:
    boot_bio();
    boot_cipher();
    boot_digest();
    boot_err();
    boot_ssl();
    boot_OpenSSL__BN();
    boot_OpenSSL__BIO();
    boot_OpenSSL__Cipher();
    boot_OpenSSL__MD();
    boot_OpenSSL__ERR();
    boot_OpenSSL__SSL();
    boot_OpenSSL__X509();