This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
struct list_t *connection_list = NULL;
bool send_meta(void *c, const char *msg , int len) { return false; }
char *logfilename = NULL;
struct list_t *connection_list = NULL;
bool send_meta(void *c, const char *msg , int len) { return false; }
char *logfilename = NULL;
-static bool send_data(void *handle, uint8_t type, const char *data, size_t len) {
+static bool send_data(void *handle, uint8_t type, const void *data, size_t len) {
-static bool receive_record(void *handle, uint8_t type, const char *data, uint16_t len) {
+static bool receive_record(void *handle, uint8_t type, const void *data, uint16_t len) {
int fd = *(int *)sptps->handle;
size_t len = recv(fd, buf, sizeof buf, 0);
int fd = *(int *)sptps->handle;
size_t len = recv(fd, buf, sizeof buf, 0);
- ecdsa_sign(key1, buf1, 256, buf2);
+ if(!ecdsa_sign(key1, buf1, 256, buf2))
+ return 1;
- ecdsa_verify(key1, buf1, 256, buf2);
+ if(!ecdsa_verify(key1, buf1, 256, buf2)) {
+ fprintf(stderr, "Signature verification failed\n");
+ return 1;
+ }
fprintf(stderr, "%20.2lf op/s\n", rate);
ecdh1 = ecdh_generate_public(buf1);
fprintf(stderr, "ECDH for %lg seconds: ", duration);
for(clock_start(); clock_countto(duration);) {
ecdh2 = ecdh_generate_public(buf2);
fprintf(stderr, "%20.2lf op/s\n", rate);
ecdh1 = ecdh_generate_public(buf1);
fprintf(stderr, "ECDH for %lg seconds: ", duration);
for(clock_start(); clock_countto(duration);) {
ecdh2 = ecdh_generate_public(buf2);
int fd[2];
if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd)) {
int fd[2];
if(socketpair(AF_UNIX, SOCK_STREAM, 0, fd)) {
close(fd[1]);
if(socketpair(AF_UNIX, SOCK_DGRAM, 0, fd)) {
close(fd[1]);
if(socketpair(AF_UNIX, SOCK_DGRAM, 0, fd)) {