aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-07-24 21:56:11 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2009-07-24 21:56:11 +0200
commit91d0660cc3b0f72b690678862bb21cbe0328a186 (patch)
tree023c86ea3cbbcfa9a86d8fe887ff03730ff86571 /libssh
parentfb5769b4be79943b7c53ebc0d5adb86ed77b9925 (diff)
downloadlibssh-91d0660cc3b0f72b690678862bb21cbe0328a186.tar.gz
libssh-91d0660cc3b0f72b690678862bb21cbe0328a186.tar.xz
libssh-91d0660cc3b0f72b690678862bb21cbe0328a186.zip
Changed all occurences of BUFFER * to ssh_buffer
Diffstat (limited to 'libssh')
-rw-r--r--libssh/agent.c4
-rw-r--r--libssh/base64.c4
-rw-r--r--libssh/channels.c24
-rw-r--r--libssh/crypt.c2
-rw-r--r--libssh/dh.c6
-rw-r--r--libssh/gzip.c16
-rw-r--r--libssh/kex.c2
-rw-r--r--libssh/keyfiles.c26
-rw-r--r--libssh/keys.c22
-rw-r--r--libssh/sftp.c44
-rw-r--r--libssh/sftpserver.c14
-rw-r--r--libssh/socket.c4
12 files changed, 84 insertions, 84 deletions
diff --git a/libssh/agent.c b/libssh/agent.c
index 98a583c0..ecc9b4df 100644
--- a/libssh/agent.c
+++ b/libssh/agent.c
@@ -263,8 +263,8 @@ static int agent_talk(struct ssh_session *session,
}
int agent_get_ident_count(struct ssh_session *session) {
- BUFFER *request = NULL;
- BUFFER *reply = NULL;
+ ssh_buffer request = NULL;
+ ssh_buffer reply = NULL;
unsigned int type = 0;
unsigned int c1 = 0, c2 = 0;
u8 buf[4] = {0};
diff --git a/libssh/base64.c b/libssh/base64.c
index 0ba548e4..f4d64fb7 100644
--- a/libssh/base64.c
+++ b/libssh/base64.c
@@ -55,8 +55,8 @@ static int get_equals(char *string);
* @returns A buffer containing the decoded string, NULL if something went
* wrong (e.g. incorrect char).
*/
-BUFFER *base64_to_bin(const char *source) {
- BUFFER *buffer = NULL;
+ssh_buffer base64_to_bin(const char *source) {
+ ssh_buffer buffer = NULL;
unsigned char block[3];
char *base64;
char *ptr;
diff --git a/libssh/channels.c b/libssh/channels.c
index 701fc445..e78aa40c 100644
--- a/libssh/channels.c
+++ b/libssh/channels.c
@@ -107,7 +107,7 @@ u32 ssh_channel_new_id(SSH_SESSION *session) {
}
static int channel_open(CHANNEL *channel, const char *type_c, int window,
- int maxpacket, BUFFER *payload) {
+ int maxpacket, ssh_buffer payload) {
SSH_SESSION *session = channel->session;
ssh_string type = NULL;
u32 tmp = 0;
@@ -673,7 +673,7 @@ int channel_open_session(CHANNEL *channel) {
int channel_open_forward(CHANNEL *channel, const char *remotehost,
int remoteport, const char *sourcehost, int localport) {
SSH_SESSION *session = channel->session;
- BUFFER *payload = NULL;
+ ssh_buffer payload = NULL;
ssh_string str = NULL;
int rc = SSH_ERROR;
@@ -1005,7 +1005,7 @@ void channel_set_blocking(CHANNEL *channel, int blocking) {
}
static int channel_request(CHANNEL *channel, const char *request,
- BUFFER *buffer, int reply) {
+ ssh_buffer buffer, int reply) {
SSH_SESSION *session = channel->session;
ssh_string req = NULL;
int rc = SSH_ERROR;
@@ -1086,7 +1086,7 @@ int channel_request_pty_size(CHANNEL *channel, const char *terminal,
int col, int row) {
SSH_SESSION *session = channel->session;
ssh_string term = NULL;
- BUFFER *buffer = NULL;
+ ssh_buffer buffer = NULL;
int rc = SSH_ERROR;
enter_function();
@@ -1154,7 +1154,7 @@ int channel_request_pty(CHANNEL *channel) {
*/
int channel_change_pty_size(CHANNEL *channel, int cols, int rows) {
SSH_SESSION *session = channel->session;
- BUFFER *buffer = NULL;
+ ssh_buffer buffer = NULL;
int rc = SSH_ERROR;
enter_function();
@@ -1215,7 +1215,7 @@ int channel_request_shell(CHANNEL *channel) {
* @warning You normally don't have to call it for sftp, see sftp_new().
*/
int channel_request_subsystem(CHANNEL *channel, const char *sys) {
- BUFFER *buffer = NULL;
+ ssh_buffer buffer = NULL;
ssh_string subsystem = NULL;
int rc = SSH_ERROR;
@@ -1259,7 +1259,7 @@ int channel_request_sftp( CHANNEL *channel){
* @warning Some environement variables may be refused by security reasons.
* */
int channel_request_env(CHANNEL *channel, const char *name, const char *value) {
- BUFFER *buffer = NULL;
+ ssh_buffer buffer = NULL;
ssh_string str = NULL;
int rc = SSH_ERROR;
@@ -1310,7 +1310,7 @@ error:
* @see channel_request_shell()
*/
int channel_request_exec(CHANNEL *channel, const char *cmd) {
- BUFFER *buffer = NULL;
+ ssh_buffer buffer = NULL;
ssh_string command = NULL;
int rc = SSH_ERROR;
@@ -1359,10 +1359,10 @@ error:
*
* @return The number of bytes read, 0 on end of file or SSH_ERROR on error.
*/
-int channel_read_buffer(CHANNEL *channel, BUFFER *buffer, u32 count,
+int channel_read_buffer(CHANNEL *channel, ssh_buffer buffer, u32 count,
int is_stderr) {
SSH_SESSION *session=channel->session;
- BUFFER *stdbuf = channel->stdout_buffer;
+ ssh_buffer stdbuf = channel->stdout_buffer;
u32 maxread = count;
u32 len;
@@ -1470,7 +1470,7 @@ int channel_read_buffer(CHANNEL *channel, BUFFER *buffer, u32 count,
*/
int channel_read(CHANNEL *channel, void *dest, u32 count, int is_stderr) {
SSH_SESSION *session = channel->session;
- BUFFER *stdbuf = channel->stdout_buffer;
+ ssh_buffer stdbuf = channel->stdout_buffer;
u32 len;
enter_function();
@@ -1606,7 +1606,7 @@ int channel_read_nonblocking(CHANNEL *channel, void *dest, u32 count,
*/
int channel_poll(CHANNEL *channel, int is_stderr){
SSH_SESSION *session = channel->session;
- BUFFER *stdbuf = channel->stdout_buffer;
+ ssh_buffer stdbuf = channel->stdout_buffer;
enter_function();
diff --git a/libssh/crypt.c b/libssh/crypt.c
index 3e9a8525..655bcfab 100644
--- a/libssh/crypt.c
+++ b/libssh/crypt.c
@@ -174,7 +174,7 @@ unsigned char *packet_encrypt(SSH_SESSION *session, void *data, u32 len) {
* @return 0 if hmac and mac are equal, < 0 if not or an error
* occured.
*/
-int packet_hmac_verify(SSH_SESSION *session, BUFFER *buffer,
+int packet_hmac_verify(SSH_SESSION *session, ssh_buffer buffer,
unsigned char *mac) {
unsigned char hmacbuf[EVP_MAX_MD_SIZE] = {0};
HMACCTX ctx;
diff --git a/libssh/dh.c b/libssh/dh.c
index 23e2d631..1bf663d9 100644
--- a/libssh/dh.c
+++ b/libssh/dh.c
@@ -477,9 +477,9 @@ int make_sessionid(SSH_SESSION *session) {
SHACTX ctx;
ssh_string num = NULL;
ssh_string str = NULL;
- BUFFER *server_hash = NULL;
- BUFFER *client_hash = NULL;
- BUFFER *buf = NULL;
+ ssh_buffer server_hash = NULL;
+ ssh_buffer client_hash = NULL;
+ ssh_buffer buf = NULL;
u32 len;
int rc = SSH_ERROR;
diff --git a/libssh/gzip.c b/libssh/gzip.c
index fde821ba..0b2638c2 100644
--- a/libssh/gzip.c
+++ b/libssh/gzip.c
@@ -54,11 +54,11 @@ static z_stream *initcompress(SSH_SESSION *session, int level) {
return stream;
}
-static BUFFER *gzip_compress(SSH_SESSION *session,BUFFER *source,int level){
+static ssh_buffer gzip_compress(SSH_SESSION *session,ssh_buffer source,int level){
z_stream *zout = session->current_crypto->compress_out_ctx;
void *in_ptr = buffer_get(source);
unsigned long in_size = buffer_get_len(source);
- BUFFER *dest = NULL;
+ ssh_buffer dest = NULL;
static unsigned char out_buf[BLOCKSIZE] = {0};
unsigned long len;
int status;
@@ -98,8 +98,8 @@ static BUFFER *gzip_compress(SSH_SESSION *session,BUFFER *source,int level){
return dest;
}
-int compress_buffer(SSH_SESSION *session, BUFFER *buf) {
- BUFFER *dest = NULL;
+int compress_buffer(SSH_SESSION *session, ssh_buffer buf) {
+ ssh_buffer dest = NULL;
dest = gzip_compress(session, buf, 9);
if (dest == NULL) {
@@ -143,12 +143,12 @@ static z_stream *initdecompress(SSH_SESSION *session) {
return stream;
}
-static BUFFER *gzip_decompress(SSH_SESSION *session, BUFFER *source) {
+static ssh_buffer gzip_decompress(SSH_SESSION *session, ssh_buffer source) {
z_stream *zin = session->current_crypto->compress_in_ctx;
void *in_ptr = buffer_get_rest(source);
unsigned long in_size = buffer_get_rest_len(source);
static unsigned char out_buf[BLOCKSIZE] = {0};
- BUFFER *dest = NULL;
+ ssh_buffer dest = NULL;
unsigned long len;
int status;
@@ -190,8 +190,8 @@ static BUFFER *gzip_decompress(SSH_SESSION *session, BUFFER *source) {
return dest;
}
-int decompress_buffer(SSH_SESSION *session,BUFFER *buf){
- BUFFER *dest = NULL;
+int decompress_buffer(SSH_SESSION *session,ssh_buffer buf){
+ ssh_buffer dest = NULL;
dest = gzip_decompress(session,buf);
if (dest == NULL) {
diff --git a/libssh/kex.c b/libssh/kex.c
index a9bfdefa..ae9c9a5a 100644
--- a/libssh/kex.c
+++ b/libssh/kex.c
@@ -445,7 +445,7 @@ int verify_existing_algo(int algo, const char *name){
/* makes a STRING contating 3 strings : ssh-rsa1,e and n */
/* this is a public key in openssh's format */
static ssh_string make_rsa1_string(ssh_string e, ssh_string n){
- BUFFER *buffer = NULL;
+ ssh_buffer buffer = NULL;
ssh_string rsa = NULL;
ssh_string ret = NULL;
diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c
index 37d898d5..be927ba7 100644
--- a/libssh/keyfiles.c
+++ b/libssh/keyfiles.c
@@ -96,7 +96,7 @@ static u32 char_to_u32(unsigned char *data, u32 size) {
return ret;
}
-static u32 asn1_get_len(BUFFER *buffer) {
+static u32 asn1_get_len(ssh_buffer buffer) {
u32 len;
unsigned char tmp[4];
@@ -120,7 +120,7 @@ static u32 asn1_get_len(BUFFER *buffer) {
return len;
}
-static ssh_string asn1_get_int(BUFFER *buffer) {
+static ssh_string asn1_get_int(ssh_buffer buffer) {
ssh_string str;
unsigned char type;
u32 size;
@@ -146,7 +146,7 @@ static ssh_string asn1_get_int(BUFFER *buffer) {
return str;
}
-static int asn1_check_sequence(BUFFER *buffer) {
+static int asn1_check_sequence(ssh_buffer buffer) {
unsigned char *j = NULL;
unsigned char tmp;
int i;
@@ -228,7 +228,7 @@ static int passphrase_to_key(char *data, unsigned int datalen,
static int privatekey_decrypt(int algo, int mode, unsigned int key_len,
unsigned char *iv, unsigned int iv_len,
- BUFFER *data, ssh_auth_callback cb,
+ ssh_buffer data, ssh_auth_callback cb,
void *userdata,
const char *desc)
{
@@ -329,10 +329,10 @@ static int privatekey_dek_header(char *header, unsigned int header_len,
return load_iv(header + iv_pos, *iv, *iv_len);
}
-static BUFFER *privatekey_file_to_buffer(FILE *fp, int type,
+static ssh_buffer privatekey_file_to_buffer(FILE *fp, int type,
ssh_auth_callback cb, void *userdata, const char *desc) {
- BUFFER *buffer = NULL;
- BUFFER *out = NULL;
+ ssh_buffer buffer = NULL;
+ ssh_buffer out = NULL;
char buf[MAXLINESIZE] = {0};
unsigned char *iv = NULL;
const char *header_begin;
@@ -452,7 +452,7 @@ static int read_rsa_privatekey(FILE *fp, gcry_sexp_t *r,
ssh_string unused2 = NULL;
ssh_string u = NULL;
ssh_string v = NULL;
- BUFFER *buffer = NULL;
+ ssh_buffer buffer = NULL;
int rc = 1;
buffer = privatekey_file_to_buffer(fp, TYPE_RSA, cb, userdata, desc);
@@ -515,7 +515,7 @@ error:
static int read_dsa_privatekey(FILE *fp, gcry_sexp_t *r, ssh_auth_callback cb,
void *userdata, const char *desc) {
- BUFFER *buffer = NULL;
+ ssh_buffer buffer = NULL;
ssh_string p = NULL;
ssh_string q = NULL;
ssh_string g = NULL;
@@ -855,7 +855,7 @@ void privatekey_free(PRIVATE_KEY *prv) {
*/
ssh_string publickey_from_file(SSH_SESSION *session, const char *filename,
int *type) {
- BUFFER *buffer = NULL;
+ ssh_buffer buffer = NULL;
char buf[4096] = {0};
ssh_string str = NULL;
char *ptr = NULL;
@@ -1138,7 +1138,7 @@ static char **ssh_get_knownhost_line(SSH_SESSION *session, FILE **file,
*/
static int check_public_key(SSH_SESSION *session, char **tokens) {
ssh_string pubkey = session->current_crypto->server_pubkey;
- BUFFER *pubkey_buffer;
+ ssh_buffer pubkey_buffer;
char *pubkey_64;
/* ok we found some public key in known hosts file. now un-base64it */
@@ -1243,8 +1243,8 @@ static int match_hashed_host(SSH_SESSION *session, const char *host,
* hash := HMAC_SHA1(key=salt,data=host)
*/
unsigned char buffer[256] = {0};
- BUFFER *salt;
- BUFFER *hash;
+ ssh_buffer salt;
+ ssh_buffer hash;
HMACCTX mac;
char *source;
char *b64hash;
diff --git a/libssh/keys.c b/libssh/keys.c
index b8d9c9ce..7faa80bd 100644
--- a/libssh/keys.c
+++ b/libssh/keys.c
@@ -65,7 +65,7 @@ int ssh_type_from_name(const char *name) {
return -1;
}
-PUBLIC_KEY *publickey_make_dss(SSH_SESSION *session, BUFFER *buffer) {
+PUBLIC_KEY *publickey_make_dss(SSH_SESSION *session, ssh_buffer buffer) {
ssh_string p = NULL;
ssh_string q = NULL;
ssh_string g = NULL;
@@ -151,7 +151,7 @@ error:
return NULL;
}
-PUBLIC_KEY *publickey_make_rsa(SSH_SESSION *session, BUFFER *buffer,
+PUBLIC_KEY *publickey_make_rsa(SSH_SESSION *session, ssh_buffer buffer,
int type) {
ssh_string e = NULL;
ssh_string n = NULL;
@@ -246,7 +246,7 @@ void publickey_free(PUBLIC_KEY *key) {
}
PUBLIC_KEY *publickey_from_string(SSH_SESSION *session, ssh_string pubkey_s) {
- BUFFER *tmpbuf = NULL;
+ ssh_buffer tmpbuf = NULL;
ssh_string type_s = NULL;
char *type_c = NULL;
int type;
@@ -478,9 +478,9 @@ error:
}
#ifdef HAVE_LIBGCRYPT
-static int dsa_public_to_string(gcry_sexp_t key, BUFFER *buffer) {
+static int dsa_public_to_string(gcry_sexp_t key, ssh_buffer buffer) {
#elif defined HAVE_LIBCRYPTO
-static int dsa_public_to_string(DSA *key, BUFFER *buffer) {
+static int dsa_public_to_string(DSA *key, ssh_buffer buffer) {
#endif
ssh_string p = NULL;
ssh_string q = NULL;
@@ -583,9 +583,9 @@ error:
}
#ifdef HAVE_LIBGCRYPT
-static int rsa_public_to_string(gcry_sexp_t key, BUFFER *buffer) {
+static int rsa_public_to_string(gcry_sexp_t key, ssh_buffer buffer) {
#elif defined HAVE_LIBCRYPTO
-static int rsa_public_to_string(RSA *key, BUFFER *buffer) {
+static int rsa_public_to_string(RSA *key, ssh_buffer buffer) {
#endif
ssh_string e = NULL;
@@ -658,7 +658,7 @@ error:
ssh_string publickey_to_string(PUBLIC_KEY *key) {
ssh_string type = NULL;
ssh_string ret = NULL;
- BUFFER *buf = NULL;
+ ssh_buffer buf = NULL;
buf = buffer_new();
if (buf == NULL) {
@@ -704,7 +704,7 @@ error:
/* Signature decoding functions */
static ssh_string signature_to_string(SIGNATURE *sign) {
unsigned char buffer[40] = {0};
- BUFFER *tmpbuf = NULL;
+ ssh_buffer tmpbuf = NULL;
ssh_string str = NULL;
ssh_string tmp = NULL;
ssh_string rs = NULL;
@@ -849,7 +849,7 @@ static ssh_string signature_to_string(SIGNATURE *sign) {
SIGNATURE *signature_from_string(SSH_SESSION *session, ssh_string signature,
PUBLIC_KEY *pubkey, int needed_type) {
SIGNATURE *sign = NULL;
- BUFFER *tmpbuf = NULL;
+ ssh_buffer tmpbuf = NULL;
ssh_string rs = NULL;
ssh_string type_s = NULL;
ssh_string e = NULL;
@@ -1150,7 +1150,7 @@ ssh_string ssh_do_sign_with_agent(struct ssh_session *session,
/*
* This function signs the session id (known as H) as a string then
* the content of sigbuf */
-ssh_string ssh_do_sign(SSH_SESSION *session, BUFFER *sigbuf,
+ssh_string ssh_do_sign(SSH_SESSION *session, ssh_buffer sigbuf,
PRIVATE_KEY *privatekey) {
CRYPTO *crypto = session->current_crypto ? session->current_crypto :
session->next_crypto;
diff --git a/libssh/sftp.c b/libssh/sftp.c
index ab361043..7d585271 100644
--- a/libssh/sftp.c
+++ b/libssh/sftp.c
@@ -111,7 +111,7 @@ SFTP_SESSION *sftp_server_new(SSH_SESSION *session, CHANNEL *chan){
int sftp_server_init(SFTP_SESSION *sftp){
struct ssh_session *session = sftp->session;
SFTP_PACKET *packet = NULL;
- BUFFER *reply = NULL;
+ ssh_buffer reply = NULL;
u32 version;
sftp_enter_function();
@@ -196,7 +196,7 @@ void sftp_free(SFTP_SESSION *sftp){
SAFE_FREE(sftp);
}
-int sftp_packet_write(SFTP_SESSION *sftp,u8 type, BUFFER *payload){
+int sftp_packet_write(SFTP_SESSION *sftp,u8 type, ssh_buffer payload){
int size;
if (buffer_prepend_data(payload, &type, sizeof(u8)) < 0) {
@@ -418,7 +418,7 @@ void sftp_packet_free(SFTP_PACKET *packet) {
/* Initialize the sftp session with the server. */
int sftp_init(SFTP_SESSION *sftp) {
SFTP_PACKET *packet = NULL;
- BUFFER *buffer = NULL;
+ ssh_buffer buffer = NULL;
ssh_string ext_name_s = NULL;
ssh_string ext_data_s = NULL;
char *ext_name = NULL;
@@ -673,7 +673,7 @@ SFTP_DIR *sftp_opendir(SFTP_SESSION *sftp, const char *path){
SFTP_DIR *dir = NULL;
STATUS_MESSAGE *status;
ssh_string path_s;
- BUFFER *payload;
+ ssh_buffer payload;
u32 id;
payload = buffer_new();
@@ -757,7 +757,7 @@ SFTP_DIR *sftp_opendir(SFTP_SESSION *sftp, const char *path){
* baselines from the protocol version 4.
* This code is more or less dead but maybe we need it in future.
*/
-static SFTP_ATTRIBUTES *sftp_parse_attr_4(SFTP_SESSION *sftp, BUFFER *buf,
+static SFTP_ATTRIBUTES *sftp_parse_attr_4(SFTP_SESSION *sftp, ssh_buffer buf,
int expectnames) {
SFTP_ATTRIBUTES *attr;
ssh_string owner = NULL;
@@ -933,7 +933,7 @@ static SFTP_ATTRIBUTES *sftp_parse_attr_4(SFTP_SESSION *sftp, BUFFER *buf,
string extended_data
... more extended data (extended_type - extended_data pairs),
so that number of pairs equals extended_count */
-static SFTP_ATTRIBUTES *sftp_parse_attr_3(SFTP_SESSION *sftp, BUFFER *buf,
+static SFTP_ATTRIBUTES *sftp_parse_attr_3(SFTP_SESSION *sftp, ssh_buffer buf,
int expectname) {
ssh_string longname = NULL;
ssh_string name = NULL;
@@ -1075,7 +1075,7 @@ static SFTP_ATTRIBUTES *sftp_parse_attr_3(SFTP_SESSION *sftp, BUFFER *buf,
}
/* FIXME is this really needed as a public function? */
-int buffer_add_attributes(BUFFER *buffer, SFTP_ATTRIBUTES *attr) {
+int buffer_add_attributes(ssh_buffer buffer, SFTP_ATTRIBUTES *attr) {
u32 flags = (attr ? attr->flags : 0);
flags &= (SSH_FILEXFER_ATTR_SIZE | SSH_FILEXFER_ATTR_UIDGID |
@@ -1117,7 +1117,7 @@ int buffer_add_attributes(BUFFER *buffer, SFTP_ATTRIBUTES *attr) {
}
-SFTP_ATTRIBUTES *sftp_parse_attr(SFTP_SESSION *session, BUFFER *buf,
+SFTP_ATTRIBUTES *sftp_parse_attr(SFTP_SESSION *session, ssh_buffer buf,
int expectname) {
switch(session->version) {
case 4:
@@ -1143,7 +1143,7 @@ SFTP_ATTRIBUTES *sftp_readdir(SFTP_SESSION *sftp, SFTP_DIR *dir) {
SFTP_MESSAGE *msg = NULL;
STATUS_MESSAGE *status;
SFTP_ATTRIBUTES *attr;
- BUFFER *payload;
+ ssh_buffer payload;
u32 id;
if (dir->buffer == NULL) {
@@ -1266,7 +1266,7 @@ void sftp_attributes_free(SFTP_ATTRIBUTES *file){
static int sftp_handle_close(SFTP_SESSION *sftp, ssh_string handle) {
STATUS_MESSAGE *status;
SFTP_MESSAGE *msg = NULL;
- BUFFER *buffer = NULL;
+ ssh_buffer buffer = NULL;
u32 id;
buffer = buffer_new();
@@ -1367,7 +1367,7 @@ SFTP_FILE *sftp_open(SFTP_SESSION *sftp, const char *file, int flags,
SFTP_ATTRIBUTES attr;
SFTP_FILE *handle;
ssh_string filename;
- BUFFER *buffer;
+ ssh_buffer buffer;
u32 sftp_flags = 0;
u32 id;
@@ -1464,7 +1464,7 @@ ssize_t sftp_read(SFTP_FILE *handle, void *buf, size_t count) {
SFTP_MESSAGE *msg = NULL;
STATUS_MESSAGE *status;
ssh_string datastring;
- BUFFER *buffer;
+ ssh_buffer buffer;
int id;
if (handle->eof) {
@@ -1555,7 +1555,7 @@ ssize_t sftp_read(SFTP_FILE *handle, void *buf, size_t count) {
/* Start an asynchronous read from a file using an opened sftp file handle. */
int sftp_async_read_begin(SFTP_FILE *file, u32 len){
SFTP_SESSION *sftp = file->sftp;
- BUFFER *buffer;
+ ssh_buffer buffer;
u32 id;
sftp_enter_function();
@@ -1678,7 +1678,7 @@ ssize_t sftp_write(SFTP_FILE *file, const void *buf, size_t count) {
SFTP_MESSAGE *msg = NULL;
STATUS_MESSAGE *status;
ssh_string datastring;
- BUFFER *buffer;
+ ssh_buffer buffer;
u32 id;
int len;
int packetlen;
@@ -1795,7 +1795,7 @@ int sftp_unlink(SFTP_SESSION *sftp, const char *file) {
STATUS_MESSAGE *status = NULL;
SFTP_MESSAGE *msg = NULL;
ssh_string filename;
- BUFFER *buffer;
+ ssh_buffer buffer;
u32 id;
buffer = buffer_new();
@@ -1864,7 +1864,7 @@ int sftp_rmdir(SFTP_SESSION *sftp, const char *directory) {
STATUS_MESSAGE *status = NULL;
SFTP_MESSAGE *msg = NULL;
ssh_string filename;
- BUFFER *buffer;
+ ssh_buffer buffer;
u32 id;
buffer = buffer_new();
@@ -1932,7 +1932,7 @@ int sftp_mkdir(SFTP_SESSION *sftp, const char *directory, mode_t mode) {
SFTP_MESSAGE *msg = NULL;
SFTP_ATTRIBUTES *errno_attr = NULL;
SFTP_ATTRIBUTES attr;
- BUFFER *buffer;
+ ssh_buffer buffer;
ssh_string path;
u32 id;
@@ -2019,7 +2019,7 @@ int sftp_mkdir(SFTP_SESSION *sftp, const char *directory, mode_t mode) {
int sftp_rename(SFTP_SESSION *sftp, const char *original, const char *newname) {
STATUS_MESSAGE *status = NULL;
SFTP_MESSAGE *msg = NULL;
- BUFFER *buffer;
+ ssh_buffer buffer;
ssh_string oldpath;
ssh_string newpath;
u32 id;
@@ -2102,7 +2102,7 @@ int sftp_rename(SFTP_SESSION *sftp, const char *original, const char *newname) {
/* Set file attributes on a file, directory or symbolic link. */
int sftp_setstat(SFTP_SESSION *sftp, const char *file, SFTP_ATTRIBUTES *attr) {
u32 id = sftp_get_new_id(sftp);
- BUFFER *buffer = buffer_new();
+ ssh_buffer buffer = buffer_new();
ssh_string path = string_from_char(file);
SFTP_MESSAGE *msg = NULL;
STATUS_MESSAGE *status = NULL;
@@ -2218,7 +2218,7 @@ char *sftp_canonicalize_path(SFTP_SESSION *sftp, const char *path) {
SFTP_MESSAGE *msg = NULL;
ssh_string name = NULL;
ssh_string pathstr;
- BUFFER *buffer;
+ ssh_buffer buffer;
char *cname;
u32 ignored;
u32 id;
@@ -2292,7 +2292,7 @@ static SFTP_ATTRIBUTES *sftp_xstat(SFTP_SESSION *sftp, const char *path,
STATUS_MESSAGE *status = NULL;
SFTP_MESSAGE *msg = NULL;
ssh_string pathstr;
- BUFFER *buffer;
+ ssh_buffer buffer;
u32 id;
buffer = buffer_new();
@@ -2356,7 +2356,7 @@ SFTP_ATTRIBUTES *sftp_lstat(SFTP_SESSION *session, const char *path) {
SFTP_ATTRIBUTES *sftp_fstat(SFTP_FILE *file) {
STATUS_MESSAGE *status = NULL;
SFTP_MESSAGE *msg = NULL;
- BUFFER *buffer;
+ ssh_buffer buffer;
u32 id;
buffer = buffer_new();
diff --git a/libssh/sftpserver.c b/libssh/sftpserver.c
index f5906a36..9f3c7c9a 100644
--- a/libssh/sftpserver.c
+++ b/libssh/sftpserver.c
@@ -38,7 +38,7 @@
SFTP_CLIENT_MESSAGE *sftp_get_client_message(SFTP_SESSION *sftp) {
SFTP_PACKET *packet;
SFTP_CLIENT_MESSAGE *msg;
- BUFFER *payload;
+ ssh_buffer payload;
ssh_string tmp;
msg = malloc(sizeof (SFTP_CLIENT_MESSAGE));
@@ -228,7 +228,7 @@ void sftp_client_message_free(SFTP_CLIENT_MESSAGE *msg) {
int sftp_reply_name(SFTP_CLIENT_MESSAGE *msg, const char *name,
SFTP_ATTRIBUTES *attr) {
- BUFFER *out;
+ ssh_buffer out;
ssh_string file;
out = buffer_new();
@@ -259,7 +259,7 @@ int sftp_reply_name(SFTP_CLIENT_MESSAGE *msg, const char *name,
}
int sftp_reply_handle(SFTP_CLIENT_MESSAGE *msg, ssh_string handle){
- BUFFER *out;
+ ssh_buffer out;
out = buffer_new();
if (out == NULL) {
@@ -278,7 +278,7 @@ int sftp_reply_handle(SFTP_CLIENT_MESSAGE *msg, ssh_string handle){
}
int sftp_reply_attr(SFTP_CLIENT_MESSAGE *msg, SFTP_ATTRIBUTES *attr) {
- BUFFER *out;
+ ssh_buffer out;
out = buffer_new();
if (out == NULL) {
@@ -335,7 +335,7 @@ int sftp_reply_names_add(SFTP_CLIENT_MESSAGE *msg, const char *file,
}
int sftp_reply_names(SFTP_CLIENT_MESSAGE *msg) {
- BUFFER *out;
+ ssh_buffer out;
out = buffer_new();
if (out == NULL) {
@@ -364,7 +364,7 @@ int sftp_reply_names(SFTP_CLIENT_MESSAGE *msg) {
int sftp_reply_status(SFTP_CLIENT_MESSAGE *msg, u32 status,
const char *message) {
- BUFFER *out;
+ ssh_buffer out;
ssh_string s;
out = buffer_new();
@@ -395,7 +395,7 @@ int sftp_reply_status(SFTP_CLIENT_MESSAGE *msg, u32 status,
}
int sftp_reply_data(SFTP_CLIENT_MESSAGE *msg, const void *data, int len) {
- BUFFER *out;
+ ssh_buffer out;
out = buffer_new();
if (out == NULL) {
diff --git a/libssh/socket.c b/libssh/socket.c
index 16da8cca..d1869bbe 100644
--- a/libssh/socket.c
+++ b/libssh/socket.c
@@ -48,8 +48,8 @@ struct socket {
not block */
int data_to_write;
int data_except;
- BUFFER *out_buffer;
- BUFFER *in_buffer;
+ ssh_buffer out_buffer;
+ ssh_buffer in_buffer;
SSH_SESSION *session;
};