Skip to content

Commit

Permalink
run/umurmur: fix run script for openssl 3
Browse files Browse the repository at this point in the history
- fix compilation of app/umurmur
- add missing nic_router and adapt configuration
- increase resources for umurmur

The run script starts without errors but I do not know how to test it.

Issue genodelabs#342
  • Loading branch information
trimpim committed Oct 2, 2023
1 parent 92e90b9 commit c219568
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ports/umurmur.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a194b75e385ebbd429835056c75917373be5b4e1
73d24387365c4cc868cc4026d9c88f83b3565bc5
1 change: 1 addition & 0 deletions ports/umurmur.port
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ SHA(umurmur) := e77b7b6616768f4a1c07442afe49a772692f667b00c23cc85909d4dd0ce206d2
DIR(umurmur) := src/app/umurmur

PATCHES := src/app/umurmur/umurmur.patch
PATCHES := src/app/umurmur/openssl3.patch
PATCH_OPT := -p1 -d src/app/umurmur
40 changes: 35 additions & 5 deletions run/umurmur.run
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import_from_depot [depot_user]/src/[base_src] \
[depot_user]/src/libc \
[depot_user]/src/openssl \
[depot_user]/src/posix \
[depot_user]/src/nic_router \
[depot_user]/src/vfs_lwip \
[depot_user]/src/vfs

Expand All @@ -30,30 +31,59 @@ install_config {
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>

<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>

<start name="drivers" caps="1000" managing_system="yes">
<start name="drivers" caps="1200" managing_system="yes">
<resource name="RAM" quantum="32M"/>
<binary name="init"/>
<route>
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
<service name="Timer"> <child name="timer"/> </service>
<service name="Uplink"> <child name="nic_router"/> </service>
<any-service> <parent/> </any-service>
</route>
<provides> <service name="Nic"/> </provides>
</start>

<start name="umurmur" caps="120">
<resource name="RAM" quantum="4M"/>
<start name="nic_router" caps="400">
<resource name="RAM" quantum="16M"/>
<provides>
<service name="Nic"/>
<service name="Uplink"/>
</provides>
<config verbose_domain_state="yes">
<domain name="uplink">
<nat domain="downlink"
tcp-ports="100"
udp-ports="100"
icmp-ids="100"/>
</domain>

<domain name="downlink" interface="10.0.3.250/24">
<tcp dst="0.0.0.0/0"> <permit-any domain="uplink"/> </tcp>
<udp dst="0.0.0.0/0"> <permit-any domain="uplink"/> </udp>
<dhcp-server ip_first="10.0.3.2"
ip_last="10.0.3.3"
ip_lease_time_sec="600"
dns_config_from="uplink"/>
</domain>

<policy label_prefix="drivers -> " domain="uplink"/>
<policy label_prefix="umurmur -> " domain="downlink"/>
</config>
</start>

<start name="umurmur" caps="350">
<resource name="RAM" quantum="32M"/>
<config>
<vfs>
<dir name="dev">
<log/>
<inline name="rtc">2018-09-24 00:00</inline>
<inline name="random">012345678</inline>
<inline name="random">g0Kof/YMRG8NLASiukpI6f5QQinTPyOpzkreUXr3HCMiRVpn14GkiyQ0ezrN2KAK</inline>
</dir>

<dir name="socket"> <lwip dhcp="yes"/> </dir>
Expand Down
14 changes: 14 additions & 0 deletions src/app/umurmur/openssl3.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/src/ssli_openssl.c b/src/ssli_openssl.c
index 8ff1bcf..872ddf9 100644
--- a/src/ssli_openssl.c
+++ b/src/ssli_openssl.c
@@ -167,9 +167,6 @@ static void SSL_initializeCert() {
if (!rsa || !did_load_cert) {
Log_info("Generating new server certificate.");

-
- CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
-
x509 = X509_new();
pkey = EVP_PKEY_new();
rsa = RSA_generate_key(4096,RSA_F4,NULL,NULL);
1 change: 1 addition & 0 deletions src/app/umurmur/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ SRC_C += dummy.c

INC_DIR += $(UMURMUR_DIR) $(PRG_DIR)

CC_C_OPT += -DCRYPTO_MEM_CHECK_ON=0x1
LIBS += libc libcrypto libssl protobuf-c libconfig posix

vpath %.c $(UMURMUR_DIR)
Expand Down

0 comments on commit c219568

Please sign in to comment.