- stevesk@cvs.openbsd.org 2001/12/29 21:56:01
[authfile.c channels.c compress.c packet.c sftp-server.c ssh-agent.c ssh-keygen.c] remove unneeded casts and some char->u_char cleanup; ok markus@
This commit is contained in:
parent
dc9e067614
commit
708d21c802
|
@ -78,6 +78,10 @@
|
|||
- stevesk@cvs.openbsd.org 2001/12/28 22:37:48
|
||||
[ssh.1 sshd.8]
|
||||
document LogLevel DEBUG[123]; ok markus@
|
||||
- stevesk@cvs.openbsd.org 2001/12/29 21:56:01
|
||||
[authfile.c channels.c compress.c packet.c sftp-server.c]
|
||||
[ssh-agent.c ssh-keygen.c]
|
||||
remove unneeded casts and some char->u_char cleanup; ok markus@
|
||||
|
||||
|
||||
20020121
|
||||
|
@ -7226,4 +7230,4 @@
|
|||
- Wrote replacements for strlcpy and mkdtemp
|
||||
- Released 1.0pre1
|
||||
|
||||
$Id: ChangeLog,v 1.1745 2002/01/22 12:17:51 djm Exp $
|
||||
$Id: ChangeLog,v 1.1746 2002/01/22 12:18:15 djm Exp $
|
||||
|
|
14
authfile.c
14
authfile.c
|
@ -36,7 +36,7 @@
|
|||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: authfile.c,v 1.44 2001/12/27 18:26:13 markus Exp $");
|
||||
RCSID("$OpenBSD: authfile.c,v 1.45 2001/12/29 21:56:01 stevesk Exp $");
|
||||
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/evp.h>
|
||||
|
@ -68,7 +68,7 @@ key_save_private_rsa1(Key *key, const char *filename, const char *passphrase,
|
|||
const char *comment)
|
||||
{
|
||||
Buffer buffer, encrypted;
|
||||
char buf[100], *cp;
|
||||
u_char buf[100], *cp;
|
||||
int fd, i;
|
||||
CipherContext ciphercontext;
|
||||
Cipher *cipher;
|
||||
|
@ -132,8 +132,8 @@ key_save_private_rsa1(Key *key, const char *filename, const char *passphrase,
|
|||
cp = buffer_append_space(&encrypted, buffer_len(&buffer));
|
||||
|
||||
cipher_set_key_string(&ciphercontext, cipher, passphrase);
|
||||
cipher_encrypt(&ciphercontext, (u_char *) cp,
|
||||
(u_char *) buffer_ptr(&buffer), buffer_len(&buffer));
|
||||
cipher_encrypt(&ciphercontext, cp,
|
||||
buffer_ptr(&buffer), buffer_len(&buffer));
|
||||
memset(&ciphercontext, 0, sizeof(ciphercontext));
|
||||
|
||||
/* Destroy temporary data. */
|
||||
|
@ -314,7 +314,7 @@ key_load_private_rsa1(int fd, const char *filename, const char *passphrase,
|
|||
int i, check1, check2, cipher_type;
|
||||
off_t len;
|
||||
Buffer buffer, decrypted;
|
||||
char *cp;
|
||||
u_char *cp;
|
||||
CipherContext ciphercontext;
|
||||
Cipher *cipher;
|
||||
Key *prv = NULL;
|
||||
|
@ -381,8 +381,8 @@ key_load_private_rsa1(int fd, const char *filename, const char *passphrase,
|
|||
|
||||
/* Rest of the buffer is encrypted. Decrypt it using the passphrase. */
|
||||
cipher_set_key_string(&ciphercontext, cipher, passphrase);
|
||||
cipher_decrypt(&ciphercontext, (u_char *) cp,
|
||||
(u_char *) buffer_ptr(&buffer), buffer_len(&buffer));
|
||||
cipher_decrypt(&ciphercontext, cp,
|
||||
buffer_ptr(&buffer), buffer_len(&buffer));
|
||||
memset(&ciphercontext, 0, sizeof(ciphercontext));
|
||||
buffer_free(&buffer);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: channels.c,v 1.154 2001/12/28 15:06:00 markus Exp $");
|
||||
RCSID("$OpenBSD: channels.c,v 1.155 2001/12/29 21:56:01 stevesk Exp $");
|
||||
|
||||
#include "ssh.h"
|
||||
#include "ssh1.h"
|
||||
|
@ -786,7 +786,7 @@ x11_open_helper(Buffer *b)
|
|||
return 0;
|
||||
|
||||
/* Parse the lengths of variable-length fields. */
|
||||
ucp = (u_char *) buffer_ptr(b);
|
||||
ucp = buffer_ptr(b);
|
||||
if (ucp[0] == 0x42) { /* Byte order MSB first. */
|
||||
proto_len = 256 * ucp[6] + ucp[7];
|
||||
data_len = 256 * ucp[8] + ucp[9];
|
||||
|
|
14
compress.c
14
compress.c
|
@ -12,7 +12,7 @@
|
|||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: compress.c,v 1.16 2001/12/19 07:18:56 deraadt Exp $");
|
||||
RCSID("$OpenBSD: compress.c,v 1.17 2001/12/29 21:56:01 stevesk Exp $");
|
||||
|
||||
#include "log.h"
|
||||
#include "buffer.h"
|
||||
|
@ -80,7 +80,7 @@ buffer_compress_uninit(void)
|
|||
void
|
||||
buffer_compress(Buffer * input_buffer, Buffer * output_buffer)
|
||||
{
|
||||
char buf[4096];
|
||||
u_char buf[4096];
|
||||
int status;
|
||||
|
||||
/* This case is not handled below. */
|
||||
|
@ -88,13 +88,13 @@ buffer_compress(Buffer * input_buffer, Buffer * output_buffer)
|
|||
return;
|
||||
|
||||
/* Input is the contents of the input buffer. */
|
||||
outgoing_stream.next_in = (u_char *) buffer_ptr(input_buffer);
|
||||
outgoing_stream.next_in = buffer_ptr(input_buffer);
|
||||
outgoing_stream.avail_in = buffer_len(input_buffer);
|
||||
|
||||
/* Loop compressing until deflate() returns with avail_out != 0. */
|
||||
do {
|
||||
/* Set up fixed-size output buffer. */
|
||||
outgoing_stream.next_out = (u_char *)buf;
|
||||
outgoing_stream.next_out = buf;
|
||||
outgoing_stream.avail_out = sizeof(buf);
|
||||
|
||||
/* Compress as much data into the buffer as possible. */
|
||||
|
@ -124,15 +124,15 @@ buffer_compress(Buffer * input_buffer, Buffer * output_buffer)
|
|||
void
|
||||
buffer_uncompress(Buffer * input_buffer, Buffer * output_buffer)
|
||||
{
|
||||
char buf[4096];
|
||||
u_char buf[4096];
|
||||
int status;
|
||||
|
||||
incoming_stream.next_in = (u_char *) buffer_ptr(input_buffer);
|
||||
incoming_stream.next_in = buffer_ptr(input_buffer);
|
||||
incoming_stream.avail_in = buffer_len(input_buffer);
|
||||
|
||||
for (;;) {
|
||||
/* Set up fixed-size output buffer. */
|
||||
incoming_stream.next_out = (u_char *) buf;
|
||||
incoming_stream.next_out = buf;
|
||||
incoming_stream.avail_out = sizeof(buf);
|
||||
|
||||
status = inflate(&incoming_stream, Z_PARTIAL_FLUSH);
|
||||
|
|
20
packet.c
20
packet.c
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: packet.c,v 1.82 2001/12/28 14:50:54 markus Exp $");
|
||||
RCSID("$OpenBSD: packet.c,v 1.83 2001/12/29 21:56:01 stevesk Exp $");
|
||||
|
||||
#include "xmalloc.h"
|
||||
#include "buffer.h"
|
||||
|
@ -399,7 +399,7 @@ packet_send1(void)
|
|||
buffer_consume(&outgoing_packet, 8 - padding);
|
||||
|
||||
/* Add check bytes. */
|
||||
checksum = ssh_crc32((u_char *) buffer_ptr(&outgoing_packet),
|
||||
checksum = ssh_crc32(buffer_ptr(&outgoing_packet),
|
||||
buffer_len(&outgoing_packet));
|
||||
PUT_32BIT(buf, checksum);
|
||||
buffer_append(&outgoing_packet, buf, 4);
|
||||
|
@ -505,7 +505,7 @@ packet_send2(void)
|
|||
}
|
||||
block_size = enc ? enc->cipher->block_size : 8;
|
||||
|
||||
ucp = (u_char *) buffer_ptr(&outgoing_packet);
|
||||
ucp = buffer_ptr(&outgoing_packet);
|
||||
type = ucp[5];
|
||||
|
||||
#ifdef PACKET_DEBUG
|
||||
|
@ -561,7 +561,7 @@ packet_send2(void)
|
|||
}
|
||||
/* packet_length includes payload, padding and padding length field */
|
||||
packet_length = buffer_len(&outgoing_packet) - 4;
|
||||
ucp = (u_char *)buffer_ptr(&outgoing_packet);
|
||||
ucp = buffer_ptr(&outgoing_packet);
|
||||
PUT_32BIT(ucp, packet_length);
|
||||
ucp[4] = padlen;
|
||||
DBG(debug("send: len %d (includes padlen %d)", packet_length+4, padlen));
|
||||
|
@ -569,7 +569,7 @@ packet_send2(void)
|
|||
/* compute MAC over seqnr and packet(length fields, payload, padding) */
|
||||
if (mac && mac->enabled) {
|
||||
macbuf = mac_compute(mac, seqnr,
|
||||
(u_char *) buffer_ptr(&outgoing_packet),
|
||||
buffer_ptr(&outgoing_packet),
|
||||
buffer_len(&outgoing_packet));
|
||||
DBG(debug("done calc MAC out #%d", seqnr));
|
||||
}
|
||||
|
@ -708,7 +708,7 @@ packet_read_poll1(void)
|
|||
if (buffer_len(&input) < 4 + 8)
|
||||
return SSH_MSG_NONE;
|
||||
/* Get length of incoming packet. */
|
||||
ucp = (u_char *) buffer_ptr(&input);
|
||||
ucp = buffer_ptr(&input);
|
||||
len = GET_32BIT(ucp);
|
||||
if (len < 1 + 2 + 2 || len > 256 * 1024)
|
||||
packet_disconnect("Bad packet length %d.", len);
|
||||
|
@ -745,7 +745,7 @@ packet_read_poll1(void)
|
|||
#endif
|
||||
|
||||
/* Compute packet checksum. */
|
||||
checksum = ssh_crc32((u_char *) buffer_ptr(&incoming_packet),
|
||||
checksum = ssh_crc32(buffer_ptr(&incoming_packet),
|
||||
buffer_len(&incoming_packet) - 4);
|
||||
|
||||
/* Skip padding. */
|
||||
|
@ -756,7 +756,7 @@ packet_read_poll1(void)
|
|||
packet_disconnect("packet_read_poll1: len %d != buffer_len %d.",
|
||||
len, buffer_len(&incoming_packet));
|
||||
|
||||
ucp = (u_char *) buffer_ptr(&incoming_packet) + len - 4;
|
||||
ucp = (u_char *)buffer_ptr(&incoming_packet) + len - 4;
|
||||
stored_checksum = GET_32BIT(ucp);
|
||||
if (checksum != stored_checksum)
|
||||
packet_disconnect("Corrupted check bytes on input.");
|
||||
|
@ -805,7 +805,7 @@ packet_read_poll2(u_int32_t *seqnr_p)
|
|||
cp = buffer_append_space(&incoming_packet, block_size);
|
||||
cipher_decrypt(&receive_context, cp, buffer_ptr(&input),
|
||||
block_size);
|
||||
ucp = (u_char *) buffer_ptr(&incoming_packet);
|
||||
ucp = buffer_ptr(&incoming_packet);
|
||||
packet_length = GET_32BIT(ucp);
|
||||
if (packet_length < 1 + 4 || packet_length > 256 * 1024) {
|
||||
buffer_dump(&incoming_packet);
|
||||
|
@ -840,7 +840,7 @@ packet_read_poll2(u_int32_t *seqnr_p)
|
|||
*/
|
||||
if (mac && mac->enabled) {
|
||||
macbuf = mac_compute(mac, seqnr,
|
||||
(u_char *) buffer_ptr(&incoming_packet),
|
||||
buffer_ptr(&incoming_packet),
|
||||
buffer_len(&incoming_packet));
|
||||
if (memcmp(macbuf, buffer_ptr(&input), mac->mac_len) != 0)
|
||||
packet_disconnect("Corrupted MAC on input.");
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: sftp-server.c,v 1.31 2001/12/19 07:18:56 deraadt Exp $");
|
||||
RCSID("$OpenBSD: sftp-server.c,v 1.32 2001/12/29 21:56:01 stevesk Exp $");
|
||||
|
||||
#include "buffer.h"
|
||||
#include "bufaux.h"
|
||||
|
@ -951,7 +951,7 @@ process(void)
|
|||
|
||||
if (buffer_len(&iqueue) < 5)
|
||||
return; /* Incomplete message. */
|
||||
cp = (u_char *) buffer_ptr(&iqueue);
|
||||
cp = buffer_ptr(&iqueue);
|
||||
msg_len = GET_32BIT(cp);
|
||||
if (msg_len > 256 * 1024) {
|
||||
error("bad message ");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: ssh-agent.c,v 1.76 2001/12/27 18:22:16 markus Exp $ */
|
||||
/* $OpenBSD: ssh-agent.c,v 1.77 2001/12/29 21:56:01 stevesk Exp $ */
|
||||
|
||||
/*
|
||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||
|
@ -36,7 +36,7 @@
|
|||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: ssh-agent.c,v 1.76 2001/12/27 18:22:16 markus Exp $");
|
||||
RCSID("$OpenBSD: ssh-agent.c,v 1.77 2001/12/29 21:56:01 stevesk Exp $");
|
||||
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/md5.h>
|
||||
|
@ -566,7 +566,7 @@ process_message(SocketEntry *e)
|
|||
u_char *cp;
|
||||
if (buffer_len(&e->input) < 5)
|
||||
return; /* Incomplete message. */
|
||||
cp = (u_char *) buffer_ptr(&e->input);
|
||||
cp = buffer_ptr(&e->input);
|
||||
msg_len = GET_32BIT(cp);
|
||||
if (msg_len > 256 * 1024) {
|
||||
shutdown(e->fd, SHUT_RDWR);
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: ssh-keygen.c,v 1.88 2001/12/27 18:10:29 markus Exp $");
|
||||
RCSID("$OpenBSD: ssh-keygen.c,v 1.89 2001/12/29 21:56:01 stevesk Exp $");
|
||||
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/pem.h>
|
||||
|
@ -187,7 +187,7 @@ buffer_get_bignum_bits(Buffer *b, BIGNUM *value)
|
|||
if (buffer_len(b) < bytes)
|
||||
fatal("buffer_get_bignum_bits: input buffer too small: "
|
||||
"need %d have %d", bytes, buffer_len(b));
|
||||
BN_bin2bn((u_char *)buffer_ptr(b), bytes, value);
|
||||
BN_bin2bn(buffer_ptr(b), bytes, value);
|
||||
buffer_consume(b, bytes);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue