View | Details | Raw Unified | Return to bug 1701 | Differences between
and this patch

Collapse All | Expand All

(-)openssh-5.4p1/clean_rand.c.randclean (+35 lines)
Line 0 Link Here
1
/*
2
 * Copyright (c) 2010 Jan F. Chadima.  All rights reserved.
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23
 */
24
25
#include "includes.h"
26
27
int do_cleanup_rand = 0;
28
29
void
30
cleanup_random_prng(void)
31
{
32
	if (do_cleanup_rand)
33
	    RAND_cleanup ();
34
}
35
(-)openssh-5.4p1/cleanup.c.randclean (+1 lines)
Lines 28-32 Link Here
28
void
28
void
29
cleanup_exit(int i)
29
cleanup_exit(int i)
30
{
30
{
31
	cleanup_random_prng();
31
	_exit(i);
32
	_exit(i);
32
}
33
}
(-)openssh-5.4p1/clientloop.c.randclean (+1 lines)
Lines 2070-2074 cleanup_exit(int i) Link Here
2070
	leave_non_blocking();
2070
	leave_non_blocking();
2071
	if (options.control_path != NULL && muxserver_sock != -1)
2071
	if (options.control_path != NULL && muxserver_sock != -1)
2072
		unlink(options.control_path);
2072
		unlink(options.control_path);
2073
	cleanup_random_prng();
2073
	_exit(i);
2074
	_exit(i);
2074
}
2075
}
(-)openssh-5.4p1/entropy.c.randclean (+1 lines)
Lines 163-168 init_rng(void) Link Here
163
	original_uid = getuid();
163
	original_uid = getuid();
164
	original_euid = geteuid();
164
	original_euid = geteuid();
165
#endif
165
#endif
166
	do_cleanup_rand = 1;
166
}
167
}
167
168
168
#ifndef OPENSSL_PRNG_ONLY
169
#ifndef OPENSSL_PRNG_ONLY
(-)openssh-5.4p1/entropy.h.randclean (+4 lines)
Lines 29-38 Link Here
29
29
30
#include "buffer.h"
30
#include "buffer.h"
31
31
32
extern int do_cleanup_rand;
33
32
void seed_rng(void);
34
void seed_rng(void);
33
void init_rng(void);
35
void init_rng(void);
34
36
35
void rexec_send_rng_seed(Buffer *);
37
void rexec_send_rng_seed(Buffer *);
36
void rexec_recv_rng_seed(Buffer *);
38
void rexec_recv_rng_seed(Buffer *);
37
39
40
void cleanup_random_prng(void);
41
38
#endif /* _RANDOMS_H */
42
#endif /* _RANDOMS_H */
(-)openssh-5.4p1/Makefile.in.randclean (-1 / +1 lines)
Lines 66-72 TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-a Link Here
66
66
67
LIBSSH_OBJS=acss.o authfd.o authfile.o bufaux.o bufbn.o buffer.o \
67
LIBSSH_OBJS=acss.o authfd.o authfile.o bufaux.o bufbn.o buffer.o \
68
	canohost.o channels.o cipher.o cipher-acss.o cipher-aes.o \
68
	canohost.o channels.o cipher.o cipher-acss.o cipher-aes.o \
69
	cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \
69
	cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o clean_rand.o \
70
	compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \
70
	compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \
71
	log.o match.o md-sha256.o moduli.o nchan.o packet.o \
71
	log.o match.o md-sha256.o moduli.o nchan.o packet.o \
72
	readpass.o rsa.o ttymodes.o xmalloc.o addrmatch.o \
72
	readpass.o rsa.o ttymodes.o xmalloc.o addrmatch.o \
(-)openssh-5.4p1/ssh-agent.c.randclean (+1 lines)
Lines 1019-1024 void Link Here
1019
cleanup_exit(int i)
1019
cleanup_exit(int i)
1020
{
1020
{
1021
	cleanup_socket();
1021
	cleanup_socket();
1022
	cleanup_random_prng();
1022
	_exit(i);
1023
	_exit(i);
1023
}
1024
}
1024
1025
(-)openssh-5.4p1/sshd.c.randclean (+1 lines)
Lines 2466-2470 cleanup_exit(int i) Link Here
2466
	if (!use_privsep || mm_is_monitor())
2466
	if (!use_privsep || mm_is_monitor())
2467
		audit_event(SSH_CONNECTION_ABANDON);
2467
		audit_event(SSH_CONNECTION_ABANDON);
2468
#endif
2468
#endif
2469
	cleanup_random_prng();
2469
	_exit(i);
2470
	_exit(i);
2470
}
2471
}
(-)openssh-5.4p1/ssh-rand-helper.c.randclean (+1 lines)
Lines 865-870 main(int argc, char **argv) Link Here
865
		exit(1);
865
		exit(1);
866
	}
866
	}
867
867
868
	do_cleanup_rand = 1;
868
#ifdef USE_SEED_FILES
869
#ifdef USE_SEED_FILES
869
	prng_read_seedfile();
870
	prng_read_seedfile();
870
#endif
871
#endif

Return to bug 1701