Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dnsmasq package to remove, cert generation commands and configura… #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ Replace the hostname discoveryproxy.home.arpa with the actual hostname of the Di

On a linux or MacOS install, you will run the gen_key and cert_write commands:

$HOME/mbedtls/programs/pkey/gen_key type=rsa rsa_keysize=4096 filename=server.key
$HOME/mbedtls/programs/x509/cert_write selfsign=1 issuer_key=server.key issuer_name=CN=discoveryproxy.home.arpa not_before=20190226000000 not_after=20211231235959 is_ca=1 max_pathlen=0 output_file=server.crt
gen_key type=rsa rsa_keysize=4096 filename=server.key
cert_write selfsign=1 issuer_key=server.key issuer_name=CN=discoveryproxy.home.arpa not_before=20190226000000 not_after=20211231235959 is_ca=1 max_pathlen=0 output_file=server.crt
sudo mkdir /etc/dnssd-proxy
sudo mv server.key server.crt /etc/dnssd-proxy

Expand All @@ -305,7 +305,7 @@ The dnssd-proxy operation is controlled by the file
If running on Linux or Mac, create this file with text as illustrated below:

interface en0 service.home.arpa.
my-name discoveryproxy.home.arpa.
#my-name discoveryproxy.home.arpa.
my-ipv4-addr 203.0.113.123
udp-port 53
tcp-port 53
Expand Down
6 changes: 3 additions & 3 deletions mDNSResponder/ServiceRegistration/fromwire.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ dns_label_parse(const uint8_t *buf, unsigned mlen, unsigned *NONNULL offp)
return NULL;
}

rv = calloc(llen + 1 - DNS_MAX_LABEL_SIZE + sizeof *rv, 1);
rv = calloc(1, llen + 1 - DNS_MAX_LABEL_SIZE + sizeof *rv);
if (rv == NULL) {
DEBUG("memory allocation for %u byte label (%.*s) failed.\n",
*offp + llen + 1, *offp + llen + 1, &buf[*offp + 1]);
Expand Down Expand Up @@ -545,7 +545,7 @@ bool
dns_wire_parse(dns_message_t *NONNULL *NULLABLE ret, dns_wire_t *message, unsigned len)
{
unsigned offset = 0;
dns_message_t *rv = calloc(sizeof *rv, 1);
dns_message_t *rv = calloc(1, sizeof *rv);
int i;

if (rv == NULL) {
Expand All @@ -561,7 +561,7 @@ dns_wire_parse(dns_message_t *NONNULL *NULLABLE ret, dns_wire_t *message, unsign
fprintf(stderr, "Section %s, %d records\n", name, rv->count); \
\
if (rv->qdcount != 0) { \
rv->sets = calloc(sizeof *rv->sets, rv->count); \
rv->sets = calloc(rv->count, sizeof *rv->sets); \
if (rv->sets == NULL) { \
dns_message_free(rv); \
return false; \
Expand Down
2 changes: 1 addition & 1 deletion mDNSResponder/ServiceRegistration/sign-mbedtls.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ static srp_key_t *
srp_key_setup(void)
{
int status;
srp_key_t *key = calloc(sizeof *key, 1);
srp_key_t *key = calloc(1, sizeof *key);
char errbuf[64];

if (key == NULL) {
Expand Down
8 changes: 4 additions & 4 deletions mDNSResponder/ServiceRegistration/srp-gw.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ srp_relay(comm_t *comm, dns_message_t *message)
goto out;
}
}
dp = calloc(sizeof *dp, 1);
dp = calloc(1, sizeof *dp);
if (!dp) {
ERROR("srp_relay: no memory.");
goto out;
Expand All @@ -1008,7 +1008,7 @@ srp_relay(comm_t *comm, dns_message_t *message)
else if (rr->type == dns_rrtype_a || rr->type == dns_rrtype_aaaa || rr->type == dns_rrtype_key) {
// Allocate the hostname record
if (!host_description) {
host_description = calloc(sizeof *host_description, 1);
host_description = calloc(1, sizeof *host_description);
if (!host_description) {
ERROR("srp_relay: no memory");
goto out;
Expand Down Expand Up @@ -1079,7 +1079,7 @@ srp_relay(comm_t *comm, dns_message_t *message)
}
}
if (!sip) {
sip = calloc(sizeof *sip, 1);
sip = calloc(1, sizeof *sip);
if (sip == NULL) {
ERROR("srp_relay: no memory");
goto out;
Expand Down Expand Up @@ -1108,7 +1108,7 @@ srp_relay(comm_t *comm, dns_message_t *message)

// Otherwise if it's a PTR entry, that should be a service name
else if (rr->type == dns_rrtype_ptr) {
sp = calloc(sizeof *sp, 1);
sp = calloc(1, sizeof *sp);
if (sp == NULL) {
ERROR("srp_relay: no memory");
goto out;
Expand Down