From acb89df41ab799db61a1eaeb2814b514fde65d32 Mon Sep 17 00:00:00 2001 From: reyk Date: Thu, 18 Dec 2014 20:55:01 +0000 Subject: Update relayd to use siphash instead of sys/hash. The source-hash, loadbalance and hash modes use a random key by default that can be forced to be a static key with a new configuration argument. With input from Max Fillinger. ok tedu@ --- usr.sbin/relayd/relay_http.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'usr.sbin/relayd/relay_http.c') diff --git a/usr.sbin/relayd/relay_http.c b/usr.sbin/relayd/relay_http.c index 96aca504ee4..82820ccf420 100644 --- a/usr.sbin/relayd/relay_http.c +++ b/usr.sbin/relayd/relay_http.c @@ -1,4 +1,4 @@ -/* $OpenBSD: relay_http.c,v 1.35 2014/10/25 03:23:49 lteo Exp $ */ +/* $OpenBSD: relay_http.c,v 1.36 2014/12/18 20:55:01 reyk Exp $ */ /* * Copyright (c) 2006 - 2014 Reyk Floeter @@ -23,7 +23,6 @@ #include #include #include -#include #include #include @@ -1487,12 +1486,8 @@ relay_apply_actions(struct ctl_relay_event *cre, struct kvlist *actions) value = match->kv_value; break; } - if (!con->se_hashkeyset) - con->se_hashkey = HASHINIT; - con->se_hashkey = hash32_str(value, con->se_hashkey); - con->se_hashkeyset = 1; - log_debug("%s: hashkey 0x%04x", __func__, - con->se_hashkey); + SipHash24_Update(&con->se_siphashctx, + value, strlen(value)); break; case KEY_OPTION_LOG: /* perform this later */ -- cgit v1.2.3-59-g8ed1b