mirror of
https://github.com/clearml/dropbear
synced 2025-05-17 10:03:30 +00:00
A few more fixups, make sure that variable declarations are the
first thing in a function --HG-- extra : convert_revision : 5e475ab869513f9ce5baff42838a656f99300487
This commit is contained in:
parent
3cee7b6378
commit
d57a56407b
@ -168,10 +168,10 @@ static void put_termcodes() {
|
|||||||
unsigned int value;
|
unsigned int value;
|
||||||
unsigned int mapcode;
|
unsigned int mapcode;
|
||||||
|
|
||||||
TRACE(("enter put_termcodes"))
|
|
||||||
|
|
||||||
unsigned int bufpos1, bufpos2;
|
unsigned int bufpos1, bufpos2;
|
||||||
|
|
||||||
|
TRACE(("enter put_termcodes"))
|
||||||
|
|
||||||
if (tcgetattr(STDIN_FILENO, &tio) == -1) {
|
if (tcgetattr(STDIN_FILENO, &tio) == -1) {
|
||||||
dropbear_log(LOG_WARNING, "Failed reading termmodes");
|
dropbear_log(LOG_WARNING, "Failed reading termmodes");
|
||||||
buf_putint(ses.writepayload, 1); /* Just the terminator */
|
buf_putint(ses.writepayload, 1); /* Just the terminator */
|
||||||
|
12
random.c
12
random.c
@ -134,7 +134,7 @@ void seedrandom() {
|
|||||||
hash_state hs;
|
hash_state hs;
|
||||||
|
|
||||||
/* initialise so that things won't warn about
|
/* initialise so that things won't warn about
|
||||||
* hashing an undefined buffer */
|
* hashing an undefined buffer */
|
||||||
if (!donerandinit) {
|
if (!donerandinit) {
|
||||||
m_burn(hashpool, sizeof(hashpool));
|
m_burn(hashpool, sizeof(hashpool));
|
||||||
}
|
}
|
||||||
@ -157,17 +157,17 @@ void seedrandom() {
|
|||||||
* the random pools for fork()ed processes. */
|
* the random pools for fork()ed processes. */
|
||||||
void reseedrandom() {
|
void reseedrandom() {
|
||||||
|
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
struct timeval tv;
|
hash_state hs;
|
||||||
|
struct timeval tv;
|
||||||
|
|
||||||
if (!donerandinit) {
|
if (!donerandinit) {
|
||||||
dropbear_exit("seedrandom not done");
|
dropbear_exit("seedrandom not done");
|
||||||
}
|
}
|
||||||
|
|
||||||
pid = getpid();
|
pid = getpid();
|
||||||
gettimeofday(&tv, NULL);
|
gettimeofday(&tv, NULL);
|
||||||
|
|
||||||
hash_state hs;
|
|
||||||
sha1_init(&hs);
|
sha1_init(&hs);
|
||||||
sha1_process(&hs, (void*)hashpool, sizeof(hashpool));
|
sha1_process(&hs, (void*)hashpool, sizeof(hashpool));
|
||||||
sha1_process(&hs, (void*)&pid, sizeof(pid));
|
sha1_process(&hs, (void*)&pid, sizeof(pid));
|
||||||
|
Loading…
Reference in New Issue
Block a user