Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dhcp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
71
Issues
71
List
Boards
Labels
Service Desk
Milestones
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ISC Open Source Projects
dhcp
Commits
20ae1aff
Commit
20ae1aff
authored
Nov 30, 2007
by
Francis Dupont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
almost editorial stuff
parent
e102ecce
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
104 additions
and
104 deletions
+104
-104
client/dhc6.c
client/dhc6.c
+4
-4
client/dhclient.c
client/dhclient.c
+3
-3
common/options.c
common/options.c
+6
-6
common/packet.c
common/packet.c
+1
-1
common/parse.c
common/parse.c
+1
-1
common/resolv.c
common/resolv.c
+1
-1
common/socket.c
common/socket.c
+1
-1
common/tables.c
common/tables.c
+4
-4
dst/dst_api.c
dst/dst_api.c
+21
-21
dst/dst_internal.h
dst/dst_internal.h
+2
-2
dst/dst_support.c
dst/dst_support.c
+4
-4
dst/hmac_link.c
dst/hmac_link.c
+2
-2
dst/md5.h
dst/md5.h
+1
-1
dst/md5_dgst.c
dst/md5_dgst.c
+1
-1
dst/md5_locl.h
dst/md5_locl.h
+1
-1
dst/prandom.c
dst/prandom.c
+23
-23
includes/dhcpd.h
includes/dhcpd.h
+4
-4
omapip/dispatch.c
omapip/dispatch.c
+1
-1
relay/dhcrelay.c
relay/dhcrelay.c
+1
-1
server/confpars.c
server/confpars.c
+4
-4
server/dhcpd.c
server/dhcpd.c
+1
-1
server/dhcpleasequery.c
server/dhcpleasequery.c
+2
-2
server/dhcpv6.c
server/dhcpv6.c
+8
-8
server/failover.c
server/failover.c
+4
-4
server/mdb.c
server/mdb.c
+3
-3
No files found.
client/dhc6.c
View file @
20ae1aff
...
...
@@ -969,7 +969,7 @@ do_init6(void *input)
else
client
->
elapsed
=
elapsed
*
100
;
log_debug
(
"XMT: Forming Solicit, %u ms elapsed."
,
log_debug
(
"XMT: Forming Solicit, %u
0
ms elapsed."
,
(
unsigned
)
client
->
elapsed
);
client
->
elapsed
=
htons
(
client
->
elapsed
);
...
...
@@ -1144,7 +1144,7 @@ do_confirm6(void *input)
else
client
->
elapsed
=
elapsed
*
100
;
log_debug
(
"XMT: Forming Confirm, %u ms elapsed."
,
log_debug
(
"XMT: Forming Confirm, %u
0
ms elapsed."
,
(
unsigned
)
client
->
elapsed
);
client
->
elapsed
=
htons
(
client
->
elapsed
);
...
...
@@ -2069,7 +2069,7 @@ do_select6(void *input)
else
client
->
elapsed
=
elapsed
*
100
;
log_debug
(
"XMT: Forming Request, %u ms elapsed."
,
log_debug
(
"XMT: Forming Request, %u
0
ms elapsed."
,
(
unsigned
)
client
->
elapsed
);
client
->
elapsed
=
htons
(
client
->
elapsed
);
...
...
@@ -2951,7 +2951,7 @@ do_refresh6(void *input)
else
client
->
elapsed
=
elapsed
*
100
;
log_debug
(
"XMT: Forming %s, %u ms elapsed."
,
log_debug
(
"XMT: Forming %s, %u
0
ms elapsed."
,
dhcpv6_type_names
[
client
->
refresh_type
],
(
unsigned
)
client
->
elapsed
);
...
...
client/dhclient.c
View file @
20ae1aff
...
...
@@ -106,7 +106,7 @@ main(int argc, char **argv) {
/* Make sure that file descriptors 0 (stdin), 1, (stdout), and
2 (stderr) are open. To do this, we assume that when we
open a file the lowest available file decriptor is used. */
open a file the lowest available file de
s
criptor is used. */
fd
=
open
(
"/dev/null"
,
O_RDWR
);
if
(
fd
==
0
)
fd
=
open
(
"/dev/null"
,
O_RDWR
);
...
...
@@ -1201,7 +1201,7 @@ dhcpv6(struct packet *packet) {
}
}
/* XXX: temporary log for debuggin */
/* XXX: temporary log for debuggin
g
*/
log_info
(
"Packet received, but nothing done with it."
);
}
#endif
/* DHCPv6 */
...
...
@@ -3346,7 +3346,7 @@ isc_result_t dhcp_set_control_state (control_object_state_t oldstate,
return
ISC_R_SUCCESS
;
}
/* Schedule updates to retry occa
i
sionally until it no longer times out.
/* Schedule updates to retry occasionally until it no longer times out.
*/
void
dhclient_schedule_updates
(
struct
client_state
*
client
,
struct
iaddr
*
addr
,
...
...
common/options.c
View file @
20ae1aff
...
...
@@ -163,7 +163,7 @@ int parse_option_buffer (options, buffer, length, universe)
* have a length field, unless it's a DHCPv6 zero-length
* options space (eg any of the enterprise-id'd options).
*
* Zero-length-size option spaces basicaly consume the
* Zero-length-size option spaces basical
l
y consume the
* entire options buffer, so have at it.
*/
if
(
universe
->
get_length
!=
NULL
)
...
...
@@ -597,7 +597,7 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket,
* If answering a client message, see whether any relay agent
* options were included with the message. If so, save them
* to copy back in later, and make space in the main buffer
* to accomodate them
* to accom
m
odate them
*/
if
(
client_state
==
NULL
)
{
priority_list
[
0
]
=
DHO_DHCP_AGENT_OPTIONS
;
...
...
@@ -811,7 +811,7 @@ cons_options(struct packet *inpacket, struct dhcp_packet *outpacket,
memcpy
(
&
buffer
[
index
],
agentopts
,
agent_size
);
index
+=
agent_size
;
}
else
log_error
(
"Unable to store relay agent information"
log_error
(
"Unable to store relay agent information
"
"in reply packet."
);
}
...
...
@@ -1326,7 +1326,7 @@ store_options(int *ocount,
length
+=
encapsulation
.
len
;
/* od.len can be nonzero if we got here without an
* oc (cache lookup failed), but did have an en
apc
ulated
* oc (cache lookup failed), but did have an en
caps
ulated
* simple encapsulation space.
*/
if
(
!
od
.
len
)
{
...
...
@@ -2229,7 +2229,7 @@ prepare_option_buffer(struct universe *universe, struct buffer *bp,
break
;
default:
log_fatal
(
"Inconstent universe tag size at %s:%d."
,
MDL
);
log_fatal
(
"Incons
is
tent universe tag size at %s:%d."
,
MDL
);
}
option_code_hash_lookup
(
&
option
,
universe
->
code_hash
,
&
code
,
0
,
MDL
);
...
...
@@ -3313,7 +3313,7 @@ fqdn6_universe_decode(struct option_state *options,
/* Save the contents of the option in a buffer. There are 3
* one-byte values we record from the packet, so we go ahead
* and allocate a bigger buffer to accomodate them. But the
* and allocate a bigger buffer to accom
m
odate them. But the
* 'length' we got (because it is a DNS encoded string) is
* one longer than we need...so we only add two extra octets.
*/
...
...
common/packet.c
View file @
20ae1aff
...
...
@@ -250,7 +250,7 @@ decode_udp_ip_header(struct interface_info *interface,
if
((
upp
+
sizeof
(
udp
))
>
endbuf
)
return
-
1
;
/* Copy the UDP header into a stack alined structure for inspection. */
/* Copy the UDP header into a stack ali
g
ned structure for inspection. */
memcpy
(
&
udp
,
upp
,
sizeof
(
udp
));
#ifdef USERLAND_FILTER
...
...
common/parse.c
View file @
20ae1aff
...
...
@@ -338,7 +338,7 @@ int parse_ip_addr (cfile, addr)
}
/*
* Return true if every character in the string is hex
i
decimal.
* Return true if every character in the string is hex
a
decimal.
*/
static
int
is_hex_string
(
const
char
*
s
)
{
...
...
common/resolv.c
View file @
20ae1aff
...
...
@@ -147,7 +147,7 @@ void read_resolv_conf (parse_time)
/* We can't actually free the name server structure,
because somebody might be hanging on to it. If
your /etc/resolv.conf file changes a lot, this
could be a noticable memory leak. */
could be a notic
e
able memory leak. */
}
else
sl
=
sp
;
}
...
...
common/socket.c
View file @
20ae1aff
...
...
@@ -413,7 +413,7 @@ ssize_t send_packet (interface, packet, raw, len, from, to, hto)
#ifdef DHCPv6
/*
* For both send_packet6() and receive_packet6() we need to use the
* sendmsg()/recvmsg() functions rather than the simpl
i
er send()/recv()
* sendmsg()/recvmsg() functions rather than the simpler send()/recv()
* functions.
*
* In the case of send_packet6(), we need to do this in order to insure
...
...
common/tables.c
View file @
20ae1aff
...
...
@@ -403,7 +403,7 @@ static struct option dhcpv6_options[] = {
* intents and purposes we only need to treat the entire field
* like a globally unique identifier (and if we create such an
* option, ensure the first 4 bytes are our enterprise-id followed
* by a glob
la
ly unique ID so long as you're within that enterprise
* by a glob
al
ly unique ID so long as you're within that enterprise
* id). So we'll use "X" for now unless someone grumbles.
*/
{
"remote-id"
,
"X"
,
&
dhcpv6_universe
,
37
,
1
},
...
...
@@ -469,7 +469,7 @@ struct enumeration_value dhcpv6_message_values[] = {
{
"RECONFIGURE"
,
10
},
{
"INFORMATION-REQUEST"
,
11
},
{
"RELAY-FORW"
,
12
},
{
"RELY-REPL"
,
13
},
{
"REL
A
Y-REPL"
,
13
},
{
NULL
,
0
}
};
...
...
@@ -866,7 +866,7 @@ void initialize_common_option_spaces()
* universe as they're configured - except during startup.
* Since we know how many we put down in .c files, we can
* allocate a more-than-right-sized buffer now, leaving some
* space for user-config
g
ed option spaces.
* space for user-config
ur
ed option spaces.
*
* 1: dhcp_universe (dhcpv4 options)
* 2: nwip_universe (dhcpv4 NWIP option)
...
...
@@ -1341,7 +1341,7 @@ void initialize_common_option_spaces()
&
vsio_universe
,
MDL
);
universe_hash_add
(
universe_hash
,
isc6_universe
.
name
,
0
,
&
isc6_universe
,
MDL
);
/* This should not be nec
c
essary. Listing here just for consistency.
/* This should not be necessary. Listing here just for consistency.
* universe_hash_add(universe_hash, fqdn6_universe.name, 0,
* &fqdn6_universe, MDL);
*/
...
...
dst/dst_api.c
View file @
20ae1aff
#ifndef LINT
static
const
char
rcsid
[]
=
"$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.
5 2007/09/05 17:32:10 dhankins
Exp $"
;
static
const
char
rcsid
[]
=
"$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.
6 2007/11/30 21:51:43 fdupont
Exp $"
;
#endif
/*
...
...
@@ -24,7 +24,7 @@ static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.5 2007
* This is the only file that needs to be changed if the crypto system is
* changed. Exported functions are:
* void dst_init() Initialize the toolkit
* int dst_check_algorithm() Function to determines if alg is suppored.
* int dst_check_algorithm() Function to determines if alg is suppor
t
ed.
* int dst_compare_keys() Function to compare two keys for equality.
* int dst_sign_data() Incremental signing routine.
* int dst_verify_data() Incremental verify routine.
...
...
@@ -35,8 +35,8 @@ static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/dst_api.c,v 1.5 2007
* KEY structure.
* int dst_key_to_dnskey() Function to return a public key in DNS
* format binary
* DST_KEY *dst_buffer_to_key() Conver
s
t a data in buffer to KEY
* int *dst_key_to_buffer() Writes out DST_KEY key mat
t
erial in buffer
* DST_KEY *dst_buffer_to_key() Convert a data in buffer to KEY
* int *dst_key_to_buffer() Writes out DST_KEY key material in buffer
* void dst_free_key() Releases all memory referenced by key structure
*/
...
...
@@ -241,7 +241,7 @@ dst_compare_keys(const DST_KEY *key1, const DST_KEY *key2)
* The location to which the signature will be written.
* sig_len Length of the signature field in bytes.
* Return
* 0 Successful
l
INIT or Update operation
* 0 Successful INIT or Update operation
* >0 success FINAL (sign) operation
* <0 failure
*/
...
...
@@ -320,8 +320,8 @@ dst_verify_data(const int mode, DST_KEY *in_key, void **context,
* in_id The id of the private key.
* options DST_FORCE_READ Read from disk - don't use a previously
* read key.
* DST_CAN_SIGN The key must be us
e
able for signing.
* DST_NO_AUTHEN The key must be us
e
able for authentication.
* DST_CAN_SIGN The key must be usable for signing.
* DST_NO_AUTHEN The key must be usable for authentication.
* DST_STANDARD Return any key
* Returns
* NULL If there is no key found in the current directory or
...
...
@@ -337,7 +337,7 @@ dst_read_key(const char *in_keyname, const unsigned in_id,
DST_KEY
*
dg_key
=
NULL
,
*
pubkey
=
NULL
;
if
(
!
dst_check_algorithm
(
in_alg
))
{
/* make sure alg is available */
EREPORT
((
"dst_read_private_key(): Algorithm %d not suppored
\n
"
,
EREPORT
((
"dst_read_private_key(): Algorithm %d not suppor
t
ed
\n
"
,
in_alg
));
return
(
NULL
);
}
...
...
@@ -377,7 +377,7 @@ dst_write_key(const DST_KEY *key, const int type)
if
(
key
==
NULL
)
return
(
0
);
if
(
!
dst_check_algorithm
(
key
->
dk_alg
))
{
/* make sure alg is available */
EREPORT
((
"dst_write_key(): Algorithm %d not suppored
\n
"
,
EREPORT
((
"dst_write_key(): Algorithm %d not suppor
t
ed
\n
"
,
key
->
dk_alg
));
return
(
UNSUPPORTED_KEYALG
);
}
...
...
@@ -462,7 +462,7 @@ dst_s_write_private_key(const DST_KEY *key)
* filename of the key file to be read.
* Returns
* NULL If the key does not exist or no name is supplied.
* NON-NULL Initalized key structure if the key exists.
* NON-NULL Init
i
alized key structure if the key exists.
*/
static
DST_KEY
*
...
...
@@ -536,7 +536,7 @@ dst_s_read_public_key(const char *in_name, const unsigned in_id, int in_alg)
while
((
c
=
getc
(
fp
))
!=
EOF
)
if
(
!
isspace
(
c
))
break
;
ungetc
(
c
,
fp
);
/* return the charcter to the input field */
ungetc
(
c
,
fp
);
/* return the char
a
cter to the input field */
/* Handle hex!! FIXME. */
if
(
fscanf
(
fp
,
"%d %d %d"
,
&
flags
,
&
proto
,
&
alg
)
!=
3
)
{
...
...
@@ -639,7 +639,7 @@ dst_s_write_public_key(const DST_KEY *key)
* dst_dnskey_to_public_key
* This function converts the contents of a DNS KEY RR into a DST
* key structure.
* Paramters
* Param
e
ters
* len Length of the RDATA of the KEY RR RDATA
* rdata A pointer to the the KEY RR RDATA.
* in_name Key name to be stored in key structure.
...
...
@@ -661,7 +661,7 @@ dst_dnskey_to_key(const char *in_name,
return
(
NULL
);
alg
=
(
u_int8_t
)
rdata
[
DST_KEY_ALG
];
if
(
!
dst_check_algorithm
(
alg
))
{
/* make sure alg is available */
EREPORT
((
"dst_dnskey_to_key(): Algorithm %d not suppored
\n
"
,
EREPORT
((
"dst_dnskey_to_key(): Algorithm %d not suppor
t
ed
\n
"
,
alg
));
return
(
NULL
);
}
...
...
@@ -679,7 +679,7 @@ dst_dnskey_to_key(const char *in_name,
start
+=
2
;
}
/*
* now point to the begining of the data representing the encoding
* now point to the begin
n
ing of the data representing the encoding
* of the key
*/
if
(
key_st
->
dk_func
&&
key_st
->
dk_func
->
from_dns_key
)
{
...
...
@@ -687,7 +687,7 @@ dst_dnskey_to_key(const char *in_name,
len
-
start
)
>
0
)
return
(
key_st
);
}
else
EREPORT
((
"dst_dnskey_to_public_key(): unsuppored alg %d
\n
"
,
EREPORT
((
"dst_dnskey_to_public_key(): unsuppor
t
ed alg %d
\n
"
,
alg
));
SAFE_FREE
(
key_st
);
...
...
@@ -718,7 +718,7 @@ dst_key_to_dnskey(const DST_KEY *key, u_char *out_storage,
return
(
-
1
);
if
(
!
dst_check_algorithm
(
key
->
dk_alg
))
{
/* make sure alg is available */
EREPORT
((
"dst_key_to_dnskey(): Algorithm %d not suppored
\n
"
,
EREPORT
((
"dst_key_to_dnskey(): Algorithm %d not suppor
t
ed
\n
"
,
key
->
dk_alg
));
return
(
UNSUPPORTED_KEYALG
);
}
...
...
@@ -777,7 +777,7 @@ dst_buffer_to_key(const char *key_name, /* name of the key */
DST_KEY
*
dkey
=
NULL
;
if
(
!
dst_check_algorithm
(
alg
))
{
/* make sure alg is available */
EREPORT
((
"dst_buffer_to_key(): Algorithm %d not suppored
\n
"
,
alg
));
EREPORT
((
"dst_buffer_to_key(): Algorithm %d not suppor
t
ed
\n
"
,
alg
));
return
(
NULL
);
}
...
...
@@ -800,7 +800,7 @@ int
dst_key_to_buffer
(
DST_KEY
*
key
,
u_char
*
out_buff
,
unsigned
buf_len
)
{
int
len
;
/* this function will extrac the secret of HMAC into a buffer */
/* this function will extrac
t
the secret of HMAC into a buffer */
if
(
key
==
NULL
)
return
(
0
);
if
(
key
->
dk_func
!=
NULL
&&
key
->
dk_func
!=
NULL
)
{
...
...
@@ -822,7 +822,7 @@ dst_key_to_buffer(DST_KEY *key, u_char *out_buff, unsigned buf_len)
* pk_key Structure that the key is returned in.
* in_id Key identifier (tag)
* Return
* 1 if everthing works
* 1 if ever
y
thing works
* 0 if there is any problem
*/
...
...
@@ -963,7 +963,7 @@ dst_generate_key(const char *name, const int bits, const int exp,
return
(
NULL
);
if
(
!
dst_check_algorithm
(
alg
))
{
/* make sure alg is available */
EREPORT
((
"dst_generate_key(): Algorithm %d not suppored
\n
"
,
alg
));
EREPORT
((
"dst_generate_key(): Algorithm %d not suppor
t
ed
\n
"
,
alg
));
return
(
NULL
);
}
...
...
@@ -1020,7 +1020,7 @@ dst_free_key(DST_KEY *f_key)
/*
* dst_sig_size
* Return the maxim
i
m size of signature from the key specified in bytes
* Return the maxim
u
m size of signature from the key specified in bytes
* Parameters
* key
* Returns
...
...
dst/dst_internal.h
View file @
20ae1aff
...
...
@@ -36,14 +36,14 @@ typedef struct dst_key {
unsigned
dk_flags
;
/* and the flags of the public key */
unsigned
dk_id
;
/* identifier of the key */
void
*
dk_KEY_struct
;
/* pointer to key in crypto pkg fmt */
struct
dst_func
*
dk_func
;
/* point to crypt
t
o pgk specific function table */
struct
dst_func
*
dk_func
;
/* point to crypto pgk specific function table */
}
DST_KEY
;
#define HAS_DST_KEY
#include <isc-dhcp/dst.h>
/*
* define what crypto systems are supported for RSA,
* BSAFE is prefered over RSAREF; only one can be set at any time
* BSAFE is prefer
r
ed over RSAREF; only one can be set at any time
*/
#if defined(BSAFE) && defined(RSAREF)
# error "Cannot have both BSAFE and RSAREF defined"
...
...
dst/dst_support.c
View file @
20ae1aff
static
const
char
rcsid
[]
=
"$Header: /tmp/cvstest/DHCP/dst/dst_support.c,v 1.
2 2007/10/27 19:15:32 each
Exp $"
;
static
const
char
rcsid
[]
=
"$Header: /tmp/cvstest/DHCP/dst/dst_support.c,v 1.
3 2007/11/30 21:51:43 fdupont
Exp $"
;
/*
...
...
@@ -133,7 +133,7 @@ dst_s_verify_str(const char **buf, const char *str)
* byte order conversion.
* Parameters
* buf Pointer to encoded input string. Pointer is updated if
* function is successful
l
.
* function is successful.
* loc Output area.
* loclen Size in bytes of output area.
* Return
...
...
@@ -225,13 +225,13 @@ dst_s_id_calc(const u_char *key, const unsigned keysize)
}
/*
* dst_s_dns_key_id() Function to calculated DNSSEC footprint from KEY re
oc
rd
* dst_s_dns_key_id() Function to calculated DNSSEC footprint from KEY re
co
rd
* rdata (all of record)
* Input:
* dns_key_rdata: the raw data in wire format
* rdata_len: the size of the input data
* Output:
* the key footprint/id calcuated from the key data
* the key footprint/id calcu
l
ated from the key data
*/
u_int16_t
dst_s_dns_key_id
(
const
u_char
*
dns_key_rdata
,
const
unsigned
rdata_len
)
...
...
dst/hmac_link.c
View file @
20ae1aff
#ifdef HMAC_MD5
#ifndef LINT
static
const
char
rcsid
[]
=
"$Header: /tmp/cvstest/DHCP/dst/hmac_link.c,v 1.
1 2001/02/22 07:22:08 mellon
Exp $"
;
static
const
char
rcsid
[]
=
"$Header: /tmp/cvstest/DHCP/dst/hmac_link.c,v 1.
2 2007/11/30 21:51:43 fdupont
Exp $"
;
#endif
/*
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
...
...
@@ -362,7 +362,7 @@ dst_hmac_md5_key_from_file_format(DST_KEY *dkey, const char *buff,
/*
* dst_hmac_md5_to_dns_key()
* function to extract hmac key from DST_KEY structure
* in
t
put:
* input:
* in_key: HMAC-MD5 key
* output:
* out_str: buffer to write ot
...
...
dst/md5.h
View file @
20ae1aff
...
...
@@ -90,7 +90,7 @@ void MD5_Final();
unsigned
char
*
MD5
();
#endif
/* to provide backward compat
abilty
to RSAREF calls ogud@tis.com 1997/11/14 */
/* to provide backward compat
ibleness
to RSAREF calls ogud@tis.com 1997/11/14 */
#define MD5Init(c) MD5_Init(c)
#define MD5Update(c,data, len) MD5_Update(c,data,len)
#define MD5Final(md, c) MD5_Final(md, c)
...
...
dst/md5_dgst.c
View file @
20ae1aff
...
...
@@ -308,7 +308,7 @@ MD5_CTX *c;
static
unsigned
char
end
[
4
]
=
{
0x80
,
0x00
,
0x00
,
0x00
};
unsigned
char
*
cp
=
end
;
/* c->num should definitly have room for at least one more byte. */
/* c->num should definit
e
ly have room for at least one more byte. */
p
=
c
->
data
;
j
=
c
->
num
;
i
=
j
>>
2
;
...
...
dst/md5_locl.h
View file @
20ae1aff
...
...
@@ -153,7 +153,7 @@
*/
/* As pointed out by Wei Dai <weidai@eskimo.com>, the above can be
* simplified to the code below. Wei attributes these optimi
s
ations
* simplified to the code below. Wei attributes these optimi
z
ations
* to Peter Gutmann's SHS code, and he attributes it to Rich Schroeppel.
*/
#define F(x,y,z) ((((y) ^ (z)) & (x)) ^ (z))
...
...
dst/prandom.c
View file @
20ae1aff
#ifndef LINT
static
const
char
rcsid
[]
=
"$Header: /tmp/cvstest/DHCP/dst/prandom.c,v 1.
5 2007/09/05 17:32:10 dhankins
Exp $"
;
static
const
char
rcsid
[]
=
"$Header: /tmp/cvstest/DHCP/dst/prandom.c,v 1.
6 2007/11/30 21:51:43 fdupont
Exp $"
;
#endif
/*
* Portions Copyright (c) 1995-1998 by Trusted Information Systems, Inc.
...
...
@@ -47,8 +47,8 @@ static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/prandom.c,v 1.5 2007
#endif
/*
* the constant below is a prime number to make fixed data structues like
* stat and time wrap over blocks. This adds certain
uncertanty to what is
* the constant below is a prime number to make fixed data structu
r
es like
* stat and time wrap over blocks. This adds certain
randomness to what is
* in each digested block.
* The prime number 2879 has the special property that when
* divided by 2,4 and 6 the result is also a prime numbers
...
...
@@ -59,14 +59,14 @@ static const char rcsid[] = "$Header: /tmp/cvstest/DHCP/dst/prandom.c,v 1.5 2007
#endif
/*
* This constant dictat
at
es how many bits we shift to the right before using a
* This constant dictates how many bits we shift to the right before using a
*/
#ifndef DST_SHIFT
#define DST_SHIFT 9
#endif
/*
* An initalizer that is as bad as any other with half the bits set
* An init
i
alizer that is as bad as any other with half the bits set
*/
#ifndef DST_RANDOM_PATTERN
#define DST_RANDOM_PATTERN 0x8765CA93
...
...
@@ -172,7 +172,7 @@ static const char *files[] = {
/*
* these two data structure are used to process input data into digests,
*
* The first structure
is containt
s a pointer to a DST HMAC key
* The first structure
contain
s a pointer to a DST HMAC key
* the variables accompanying are used for
* step : select every step byte from input data for the hash
* block: number of data elements going into each hash
...
...
@@ -186,7 +186,7 @@ typedef struct hash {
}
prand_hash
;
/*
* This data structure control
l
s number of hashes and keeps track of
* This data structure controls number of hashes and keeps track of
* overall progress in generating correct number of bytes of output.
* output : array to store the output data in
* needed : how many bytes of output are needed
...
...
@@ -228,7 +228,7 @@ static u_int32_t ran_cnt = (DST_RANDOM_PATTERN >> 10);
/*
* setting the quick_random generator to particular values or if both
* input parameters are 0 then set it to initial v
la
ues
* input parameters are 0 then set it to initial v
al
ues
*/
void
...
...
@@ -312,7 +312,7 @@ do_time(dst_work *work)
*
* do_ls() does not visit subdirectories
* if attacker has access to machine it can guess most of the values seen
* thus it is important to only visit directories that are freqently updated
* thus it is important to only visit directories that are freq
u
ently updated
* Attacker that has access to the network can see network traffic
* when NFS mounted directories are accessed and know exactly the data used
* but may not know exactly in what order data is used.
...
...
@@ -375,7 +375,7 @@ do_ls(dst_work *work)
file_name
[
dir_len
+
len
]
=
0x0
;
/* for all entries in dir get the stats */
if
(
stat
(
file_name
,
&
buf
)
==
0
)
{
n
++
;
/* count successful
l
stat calls */
n
++
;
/* count successful stat calls */
/* copy non static fields */
dir_info
.
uid
+=
buf
.
st_uid
;
dir_info
.
gid
+=
buf
.
st_gid
;
...
...
@@ -509,7 +509,7 @@ force_hash(dst_work *work, prand_hash *hash)
/*
* if more than half a block then add data to output
* otherwise add
e
the digest to the next hash
* otherwise add the digest to the next hash
*/
if
((
hash
->
digested
*
2
)
>
hash
->
block
)
{
i
=
dst_sign_data
(
SIG_MODE_FINAL
,
hash
->
key
,
&
hash
->
ctx
,
...
...
@@ -528,7 +528,7 @@ force_hash(dst_work *work, prand_hash *hash)
/*
* This function takes the input data does the selection of data specified
* by the hash control block.
* The step varia
lbe in the work stur
cture determines which 1/step bytes
* The step varia
ble in the work stru
cture determines which 1/step bytes
* are used,
*
*/
...
...
@@ -550,7 +550,7 @@ do_hash(dst_work *work, prand_hash *hash, const u_char *input, unsigned size)
tmp
=
tp
;
for
(
cnt
=
0
,
i
=
hash
->
curr
;
i
<
size
;
i
+=
hash
->
step
,
cnt
++
)
*
(
tp
++
)
=
input
[
i
];
/* calcu
t
ate the starting point in the next input set */
/* calcu
l
ate the starting point in the next input set */
hash
->
curr
=
(
hash
->
step
-
(
i
-
size
))
%
hash
->
step
;
}
/* digest the data in block sizes */
...
...
@@ -604,7 +604,7 @@ my_digest(dst_work *work, const u_char *input, unsigned size)
/*
* this function gets some semi random data and sets that as an HMAC key
* If we get a valid key this function returns that key initalized
* If we get a valid key this function returns that key init
i
alized
* otherwise it returns NULL;
*/
static
prand_hash
*
...
...
@@ -622,7 +622,7 @@ get_hmac_key(int step, int block)
if
(
buff
==
NULL
)
return
(
NULL
);
/* do not memset the allocated memory to get random bytes there */
/* time of day is somewhat random e
xpecia
ly in the last bytes */
/* time of day is somewhat random e
special
ly in the last bytes */
gettimeofday
((
struct
timeval
*
)
&
buff
[
n
],
NULL
);
n
+=
sizeof
(
struct
timeval
);
...
...
@@ -684,7 +684,7 @@ get_hmac_key(int step, int block)
* This function goes out and from various sources tries to generate enough
* semi random data that a hash function can generate a random data.
* This function will iterate between the two main random source sources,
* information from programs and directores in random order.
* information from programs and director
i
es in random order.
* This function return the number of bytes added to the random output buffer.
*/
static
unsigned
...
...
@@ -761,8 +761,8 @@ own_random(dst_work *work)
* of randomness to the caller it will use the best available sources of
* randomness.
* The current order is to use /dev/random, precalculated randomness, and
* final
y use some system calls and programs to generate semi random data that
* is then digested to generate randomness.
* final
ly use some system calls and programs to generate semi random data
*
that
is then digested to generate randomness.
* This function is thread safe as each thread uses its own context, but
* concurrent treads will affect each other as they update shared state
* information.
...
...
@@ -770,7 +770,7 @@ own_random(dst_work *work)
* that is not a multiple of the output of the hash function used.
*
* If /dev/random is not available this function is not suitable to generate
* large am
m
ounts of data, rather it is suitable to seed a pseudo-random
* large amounts of data, rather it is suitable to seed a pseudo-random
* generator
* Returns the number of bytes put in the output buffer
*/
...
...
@@ -872,8 +872,8 @@ dst_s_random(u_char *output, unsigned size)
* counters that is incremented between digest operations
* each increment operation amortizes to 2 bits changed in that value
* for 5 counters thus the input will amortize to have 10 bits changed
* The counters are init
a
ly set using the strong random function above
* the HMAC key is selected by the same metho
l
d as the HMAC keys for the
* The counters are init
ial
ly set using the strong random function above
* the HMAC key is selected by the same method as the HMAC keys for the
* strong random function.
* Each set of counters is used for 2^25 operations
*
...
...
@@ -928,13 +928,13 @@ dst_s_semi_random(u_char *output, unsigned size)
semi_loc
+=
out
;
}
}
/* generate more random
e
stuff */
/* generate more random stuff */
while
(
out
<
size
)
{
/*
* modify at least one bit by incrementing at least one counter
* based on the last bit of the last counter updated update
* the next one.
* minimaly this operation will modify at least 1 bit,
* minimal
l
y this operation will modify at least 1 bit,
* amortized 2 bits
*/
for
(
n
=
0
;
n
<
DST_NUMBER_OF_COUNTERS
;
n
++
)
...
...
includes/dhcpd.h
View file @
20ae1aff
...
...
@@ -102,10 +102,10 @@ typedef time_t TIME;
#include <omapip/omapip_p.h>
#if !defined (BYTE_NAME_HASH_SIZE)
# define BYTE_NAME_HASH_SIZE 401
/* Default would be r
e
diculous. */
# define BYTE_NAME_HASH_SIZE 401
/* Default would be r
i
diculous. */
#endif
#if !defined (BYTE_CODE_HASH_SIZE)
# define BYTE_CODE_HASH_SIZE 254
/* Default would be r
e
diculous. */
# define BYTE_CODE_HASH_SIZE 254
/* Default would be r
i
diculous. */
#endif
/* Although it is highly improbable that a 16-bit option space might
...
...
@@ -121,7 +121,7 @@ typedef time_t TIME;
#endif
/* Not only is it improbable that the 32-bit spaces might actually use 2^32
* defined options, it is infeas
a
ble. It would be best for this kind of
* defined options, it is infeas
i
ble. It would be best for this kind of
* space to be dynamically sized. Instead we size it at the word hash's
* level.
*/
...
...
@@ -146,7 +146,7 @@ typedef time_t TIME;
#endif
#if !defined (FQDN_HASH_SIZE)
# define FQDN_HASH_SIZE 13
/* A r
e
diculously small table. */
# define FQDN_HASH_SIZE 13
/* A r
i
diculously small table. */
#endif
/* I really doubt a given installation is going to have more than a few
...
...