mirror of https://github.com/D4-project/d4-core
Merge branch 'master' of https://github.com/D4-project/d4-core
commit
8b30947dd1
|
@ -80,14 +80,14 @@ void d4_update_uuid(d4_t* d4)
|
||||||
int d4_check_config(d4_t* d4)
|
int d4_check_config(d4_t* d4)
|
||||||
{
|
{
|
||||||
// TODO implement other sources, file, fifo, unix_socket ...
|
// TODO implement other sources, file, fifo, unix_socket ...
|
||||||
if (strlen(d4->conf[SOURCE]) > strlen(STDIN)) {
|
if (strlen(d4->conf[SOURCE]) >= strlen(STDIN)) {
|
||||||
if (!strncmp(d4->conf[SOURCE],STDIN, strlen(STDIN))) {
|
if (!strncmp(d4->conf[SOURCE],STDIN, strlen(STDIN))) {
|
||||||
d4->source.fd = STDIN_FILENO;
|
d4->source.fd = STDIN_FILENO;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO implement other destinations file, fifo unix_socket ...
|
//TODO implement other destinations file, fifo unix_socket ...
|
||||||
if (strlen(d4->conf[DESTINATION]) > strlen(STDOUT)) {
|
if (strlen(d4->conf[DESTINATION]) >= strlen(STDOUT)) {
|
||||||
if (!strncmp(d4->conf[DESTINATION],STDOUT, strlen(STDOUT))) {
|
if (!strncmp(d4->conf[DESTINATION],STDOUT, strlen(STDOUT))) {
|
||||||
d4->destination.fd = STDOUT_FILENO;
|
d4->destination.fd = STDOUT_FILENO;
|
||||||
}
|
}
|
||||||
|
@ -121,6 +121,7 @@ int d4_load_config(d4_t* d4)
|
||||||
if (fd > 0) {
|
if (fd > 0) {
|
||||||
//FIXME error handling
|
//FIXME error handling
|
||||||
read(fd, d4->conf[i], SZCONFVALUE);
|
read(fd, d4->conf[i], SZCONFVALUE);
|
||||||
|
close(fd);
|
||||||
} else {
|
} else {
|
||||||
d4->errno_copy = errno;
|
d4->errno_copy = errno;
|
||||||
INSERT_ERROR("Failed to load %s", d4params[i]);
|
INSERT_ERROR("Failed to load %s", d4params[i]);
|
||||||
|
@ -190,7 +191,7 @@ void d4_transfert(d4_t* d4)
|
||||||
hmac = calloc(1,SZHMAC);
|
hmac = calloc(1,SZHMAC);
|
||||||
hmaczero = calloc(1,SZHMAC);
|
hmaczero = calloc(1,SZHMAC);
|
||||||
//TODO error handling -> insert error message
|
//TODO error handling -> insert error message
|
||||||
if ((buf == NULL) && (hmac == NULL))
|
if ((buf == NULL) && (hmac == NULL) && (hmaczero == NULL))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
d4_prepare_header(d4);
|
d4_prepare_header(d4);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
openssl genrsa -out server.key 2048
|
openssl genrsa -out server.key 4096
|
||||||
openssl req -sha256 -new -key server.key -out server.csr -subj '/CN=localhost'
|
openssl req -sha256 -new -key server.key -out server.csr -subj '/CN=localhost'
|
||||||
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt
|
openssl x509 -req -sha256 -days 365 -in server.csr -signkey server.key -out server.crt
|
||||||
|
openssl x509 -req -in server.csr -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out server.crt -days 500 -sha256
|
||||||
cat server.crt server.key > server.pem
|
cat server.crt server.key > server.pem
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
openssl genrsa -out rootCA.key 4096
|
||||||
|
openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.crt
|
Loading…
Reference in New Issue