-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
125 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,90 @@ | ||
2022-03-31 17:27 naddy | ||
|
||
* usr.sbin/dhcpd/: dhcp-options.5, dhcpd.8, dhcpd.conf.5: man | ||
pages: add missing commas between subordinate and main clauses | ||
|
||
jmc@ dislikes a comma before "then" in a conditional, so leave | ||
those untouched. | ||
|
||
ok jmc@ | ||
|
||
2022-01-28 06:33 guenther | ||
|
||
* usr.sbin/dhcpd/memory.c: When it's the possessive of 'it', it's | ||
spelled "its", without the apostrophe. | ||
|
||
2022-01-16 21:20 naddy | ||
|
||
* usr.sbin/dhcpd/parse.c: dhcpd: fix -Wunused-but-set-variable | ||
warning | ||
|
||
ok krw@ | ||
|
||
2022-01-05 11:01 tb | ||
|
||
* usr.sbin/dhcpd/sync.c: dhcpd: straightforward conversion to | ||
HMAC_CTX on the heap, similar to what was done in spamd a while | ||
back. | ||
|
||
ok florian | ||
|
||
2021-12-13 18:28 deraadt | ||
|
||
* usr.sbin/dhcpd/log.h: including sys/cdefs.h manually started as a | ||
result of netbsd trying to macro-build a replacement for sccsid, | ||
and was done without any concern for namespace damage. | ||
Unfortunately this practice started infecting other code as | ||
others were unaware they didn't need the file. ok millert | ||
guenther | ||
|
||
2021-11-20 11:47 kn | ||
|
||
* usr.sbin/dhcpd/dispatch.c: Start on DOWN interfaces | ||
|
||
Do not skip interfaces during startup because they're not UP. | ||
|
||
dhcpd(8) can start listening on such interfaces just fine (given | ||
suitable IPs on them) and interfaces may come UP later in time. | ||
|
||
Otherwise dhcpd would fail to start completely if it didn't find | ||
any interface that would be UP early on and administrators had to | ||
restart dhcpd. | ||
|
||
Other daemons and nc(1)'s `-l' listen just fine on DOWN | ||
interfaces as well. | ||
|
||
Noticed while switching a bridge(4)/vether(4) setup to | ||
veb(4)/vport(4) and hostname.vport without explicit "up" (vport | ||
does not implicitly pulls itself UP when configuring an address). | ||
|
||
OK dlg florian | ||
|
||
2021-10-24 21:24 deraadt | ||
|
||
* usr.sbin/dhcpd/pfutils.c: For open/openat, if the flags parameter | ||
does not contain O_CREAT, the 3rd (variadic) mode_t parameter is | ||
irrelevant. Many developers in the past have passed mode_t (0, | ||
044, 0644, or such), which might lead future people to copy this | ||
broken idiom, and perhaps even believe this parameter has some | ||
meaning or implication or application. Delete them all. This | ||
comes out of a conversation where tb@ noticed that a strange (but | ||
intentional) pledge behaviour is to always knock-out high-bits | ||
from mode_t on a number of system calls as a safety factor, and | ||
his bewilderment that this appeared to be happening against valid | ||
modes (at least visually), but no sorry, they are all irrelevant | ||
junk. They could all be 0xdeafbeef. ok millert | ||
|
||
2021-07-12 15:09 beck | ||
|
||
* usr.sbin/dhcpd/pfutils.c: Change the error reporting pattern | ||
throughout the tree when unveil fails to report the path that the | ||
failure occured on. Suggested by deraadt@ after some tech | ||
discussion. | ||
|
||
Work done and verified by Ashton Fagg <[email protected]> | ||
|
||
ok deraadt@ semarie@ claudio@ | ||
|
||
2020-11-10 16:42 krw | ||
|
||
* usr.sbin/dhcpd/: dhcpd.h, hash.c, memory.c: Remove prototypes for | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: log.h,v 1.1 2017/02/13 19:13:14 krw Exp $ */ | ||
/* $OpenBSD: log.h,v 1.2 2021/12/13 18:28:40 deraadt Exp $ */ | ||
|
||
/* | ||
* Copyright (c) 2003, 2004 Henning Brauer <[email protected]> | ||
|
@@ -20,7 +20,6 @@ | |
#define LOG_H | ||
|
||
#include <stdarg.h> | ||
#include <sys/cdefs.h> | ||
|
||
void log_init(int, int); | ||
void log_procinit(const char *); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: pfutils.c,v 1.21 2019/08/08 06:59:44 mestre Exp $ */ | ||
/* $OpenBSD: pfutils.c,v 1.23 2021/10/24 21:24:18 deraadt Exp $ */ | ||
/* | ||
* Copyright (c) 2006 Chris Kuethe <[email protected]> | ||
* | ||
|
@@ -52,7 +52,7 @@ pftable_handler() | |
struct pollfd pfd[1]; | ||
int l, r, fd, nfds; | ||
|
||
if ((fd = open(_PATH_DEV_PF, O_RDWR|O_NOFOLLOW, 0660)) == -1) | ||
if ((fd = open(_PATH_DEV_PF, O_RDWR|O_NOFOLLOW)) == -1) | ||
fatal("can't open pf device"); | ||
|
||
if (setgroups(1, &pw->pw_gid) || | ||
|
@@ -62,7 +62,7 @@ pftable_handler() | |
|
||
/* no filesystem visibility */ | ||
if (unveil("/", "") == -1) | ||
fatal("unveil"); | ||
fatal("unveil /"); | ||
if (unveil(NULL, NULL) == -1) | ||
fatal("unveil"); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: sync.c,v 1.23 2017/02/13 23:04:05 krw Exp $ */ | ||
/* $OpenBSD: sync.c,v 1.24 2022/01/05 11:01:59 tb Exp $ */ | ||
|
||
/* | ||
* Copyright (c) 2008 Bob Beck <[email protected]> | ||
|
@@ -393,7 +393,7 @@ sync_lease(struct lease *lease) | |
char pad[DHCP_ALIGNBYTES]; | ||
u_int16_t leaselen, padlen; | ||
int i = 0; | ||
HMAC_CTX ctx; | ||
HMAC_CTX *ctx; | ||
u_int hmac_len; | ||
|
||
if (sync_key == NULL) | ||
|
@@ -403,8 +403,10 @@ sync_lease(struct lease *lease) | |
memset(&lv, 0, sizeof(lv)); | ||
memset(&pad, 0, sizeof(pad)); | ||
|
||
HMAC_CTX_init(&ctx); | ||
HMAC_Init(&ctx, sync_key, strlen(sync_key), EVP_sha1()); | ||
if ((ctx = HMAC_CTX_new()) == NULL) | ||
goto bad; | ||
if (!HMAC_Init_ex(ctx, sync_key, strlen(sync_key), EVP_sha1(), NULL)) | ||
goto bad; | ||
|
||
leaselen = sizeof(lv); | ||
padlen = DHCP_ALIGN(leaselen) - leaselen; | ||
|
@@ -416,7 +418,8 @@ sync_lease(struct lease *lease) | |
hdr.sh_length = htons(sizeof(hdr) + sizeof(lv) + padlen + sizeof(end)); | ||
iov[i].iov_base = &hdr; | ||
iov[i].iov_len = sizeof(hdr); | ||
HMAC_Update(&ctx, iov[i].iov_base, iov[i].iov_len); | ||
if (!HMAC_Update(ctx, iov[i].iov_base, iov[i].iov_len)) | ||
goto bad; | ||
i++; | ||
|
||
/* Add single DHCP sync address entry */ | ||
|
@@ -434,25 +437,31 @@ sync_lease(struct lease *lease) | |
piaddr(lease->ip_addr), ntohl(lv.lv_starts), ntohl(lv.lv_ends)); | ||
iov[i].iov_base = &lv; | ||
iov[i].iov_len = sizeof(lv); | ||
HMAC_Update(&ctx, iov[i].iov_base, iov[i].iov_len); | ||
if (!HMAC_Update(ctx, iov[i].iov_base, iov[i].iov_len)) | ||
goto bad; | ||
i++; | ||
|
||
iov[i].iov_base = pad; | ||
iov[i].iov_len = padlen; | ||
HMAC_Update(&ctx, iov[i].iov_base, iov[i].iov_len); | ||
if (!HMAC_Update(ctx, iov[i].iov_base, iov[i].iov_len)) | ||
goto bad; | ||
i++; | ||
|
||
/* Add end marker */ | ||
end.st_type = htons(DHCP_SYNC_END); | ||
end.st_length = htons(sizeof(end)); | ||
iov[i].iov_base = &end; | ||
iov[i].iov_len = sizeof(end); | ||
HMAC_Update(&ctx, iov[i].iov_base, iov[i].iov_len); | ||
if (!HMAC_Update(ctx, iov[i].iov_base, iov[i].iov_len)) | ||
goto bad; | ||
i++; | ||
|
||
HMAC_Final(&ctx, hdr.sh_hmac, &hmac_len); | ||
if (!HMAC_Final(ctx, hdr.sh_hmac, &hmac_len)) | ||
goto bad; | ||
|
||
/* Send message to the target hosts */ | ||
sync_send(iov, i); | ||
HMAC_CTX_cleanup(&ctx); | ||
|
||
bad: | ||
HMAC_CTX_free(ctx); | ||
} |