summaryrefslogtreecommitdiff
path: root/ecp/test
diff options
context:
space:
mode:
Diffstat (limited to 'ecp/test')
-rw-r--r--ecp/test/init.c10
-rw-r--r--ecp/test/init_vconn.c13
2 files changed, 13 insertions, 10 deletions
diff --git a/ecp/test/init.c b/ecp/test/init.c
index 7e39f87..4dff693 100644
--- a/ecp/test/init.c
+++ b/ecp/test/init.c
@@ -6,7 +6,7 @@
static int v_rng(void *buf, size_t bufsize) {
int fd;
-
+
if((fd = open("/dev/urandom", O_RDONLY)) < 0) return -1;
size_t nb = read(fd, buf, bufsize);
close(fd);
@@ -24,13 +24,13 @@ static void conn_free(ECPConnection *conn) {
int ecp_init(ECPContext *ctx) {
int rv;
-
- rv = ecp_ctx_create(ctx);
+
+ rv = ecp_ctx_init(ctx);
if (rv) return rv;
-
+
ctx->rng = v_rng;
ctx->conn_alloc = conn_alloc;
ctx->conn_free = conn_free;
-
+
return ECP_OK;
} \ No newline at end of file
diff --git a/ecp/test/init_vconn.c b/ecp/test/init_vconn.c
index 7e3dd04..b79aa3d 100644
--- a/ecp/test/init_vconn.c
+++ b/ecp/test/init_vconn.c
@@ -7,7 +7,7 @@
static int v_rng(void *buf, size_t bufsize) {
int fd;
-
+
if((fd = open("/dev/urandom", O_RDONLY)) < 0) return -1;
size_t nb = read(fd, buf, bufsize);
close(fd);
@@ -30,13 +30,16 @@ static void conn_free(ECPConnection *conn) {
int ecp_init(ECPContext *ctx) {
int rv;
-
- rv = ecp_ctx_create_vconn(ctx);
+
+ rv = ecp_ctx_init(ctx);
+ if (rv) return rv;
+
+ rv = ecp_vconn_ctx_init(ctx);
if (rv) return rv;
-
+
ctx->rng = v_rng;
ctx->conn_alloc = conn_alloc;
ctx->conn_free = conn_free;
-
+
return ECP_OK;
} \ No newline at end of file