search for: buffer_put_int

Displaying 20 results from an estimated 39 matches for "buffer_put_int".

2009 Feb 12
2
[patch 1/3] add protocol extension to ATTR message
...Buffer ext; + + buffer_init(&ext); + buffer_append(&ext, data, datalen); + decode_extra_attrib(&ext, &a); + buffer_free(&ext); + } xfree(type); - xfree(data); } } return &a; } +static void +encode_extra_attrib(Buffer *b, const Attrib *a) +{ + buffer_put_int(b, a->ext_flags); + if (a->ext_flags & SSH2_FXE_EXTATTR_DEV) + buffer_put_int64(b, a->dev); + if (a->ext_flags & SSH2_FXE_EXTATTR_INO) + buffer_put_int64(b, a->ino); + if (a->ext_flags & SSH2_FXE_EXTATTR_NLINK) + buffer_put_int(b, a->nlink); + if (a->ext_flags...
2012 May 03
5
[PATCH/RFC 0/6] New mux client request to list open tcp forwardings.
These patches implement a new mux client request to list the currently opened TCP forwardings. It also removes some todos regarding keeping the list of forwardings in the options up-to-date. Bert Wesarg (6): attach the forwarding type to struct Forward merge local and remote forward lists generate unique ids for forwardings to be used for identification remove closed forwardings from
2006 Aug 17
0
[RFC] proposed extensions for SFTP
...+send_statvfs(u_int32_t id, struct statvfs *st) +{ + Buffer msg; + int flag = 0; + + if (st->f_flag & ST_RDONLY) + flag |= SSH2_FX_ST_RDONLY; + if (st->f_flag & ST_NOSUID) + flag |= SSH2_FX_ST_NOSUID; + + buffer_init(&msg); + buffer_put_char(&msg, SSH2_FXP_EXTENDED_REPLY); + buffer_put_int(&msg, id); + buffer_put_int(&msg, st->f_bsize); + buffer_put_int(&msg, st->f_frsize); + buffer_put_int64(&msg, st->f_blocks); + buffer_put_int64(&msg, st->f_bfree); + buffer_put_int64(&msg, st->f_bavail); + buffer_put_int64(&msg, st->f_files); + buffer_...
2010 Jan 14
1
ssh(1) multiplexing rewrite
...ER_AUTO_ASK) - allowed = ask_permission("Terminate shared connection " - "to %s? ", host); - if (allowed) - start_close = 1; - /* FALLTHROUGH */ - case SSHMUX_COMMAND_ALIVE_CHECK: - /* Reply for SSHMUX_COMMAND_TERMINATE and ALIVE_CHECK */ - buffer_clear(&m); - buffer_put_int(&m, allowed); - buffer_put_int(&m, getpid()); - if (ssh_msg_send(client_fd, SSHMUX_VER, &m) == -1) { - error("%s: client msg_send failed", __func__); - close(client_fd); - buffer_free(&m); - return start_close; + if (state->conn_state != MUX_HELLO_WAIT) { + e...
2018 Feb 12
2
User manipulation of tty mode opcodes / IUTF8 incompatibilities
On Sun, Feb 11, 2018 at 11:27 PM, Darren Tucker <dtucker at dtucker.net> wrote: > Sigh. If you could provide the server's identity string (eg from "ssh > -v yourthing") we could add a bug bit to stop it from being sent. $ ssh -v nathan at 10.0.0.1 OpenSSH_7.4p1, LibreSSL 2.5.0 [snip] debug1: Local version string SSH-2.0-OpenSSH_7.4 debug1: Remote protocol version
2005 May 19
1
ssh-keygen private keys export - new feature
...e); + u_int bytes = (bignum_bits + 7) / 8; + u_char *buf = xmalloc(bytes); + int oi; + + /* Get the value of in binary */ + oi = BN_bn2bin(value, buf); + if (oi != bytes) { + error("buffer_put_bignum_bits: BN_bn2bin() failed: oi %d != bytes %d", + oi, bytes); + return (-1); + } + + buffer_put_int(b, bignum_bits); + /* Store the binary data. */ + buffer_append(b, (char *)buf, oi); + + memset(buf, 0, bytes); + xfree(buf); + + return (0); +} + +static int +do_convert_private_ssh2_to_blob(const Key *key, u_char **blobp, u_int *lenp) +{ + Buffer b; + int len, len1; + char *pb; + + if (key == NUL...
2002 Apr 21
3
OpenSSH Security Advisory (adv.token)
...uffer *buffer) { @@ -158,8 +166,16 @@ } /* - * Stores an integer in the buffer in 4 bytes, msb first. + * Stores integers in the buffer, msb first. */ +void +buffer_put_short(Buffer *buffer, u_short value) +{ + char buf[2]; + PUT_16BIT(buf, value); + buffer_append(buffer, buf, 2); +} + void buffer_put_int(Buffer *buffer, u_int value) { Index: bufaux.h =================================================================== RCS file: /cvs/src/usr.bin/ssh/bufaux.h,v retrieving revision 1.17 diff -u -r1.17 bufaux.h --- bufaux.h 18 Mar 2002 17:25:29 -0000 1.17 +++ bufaux.h 19 Apr 2002 12:55:56 -0000 @@ -23,...
2002 Apr 21
3
OpenSSH Security Advisory (adv.token)
...uffer *buffer) { @@ -158,8 +166,16 @@ } /* - * Stores an integer in the buffer in 4 bytes, msb first. + * Stores integers in the buffer, msb first. */ +void +buffer_put_short(Buffer *buffer, u_short value) +{ + char buf[2]; + PUT_16BIT(buf, value); + buffer_append(buffer, buf, 2); +} + void buffer_put_int(Buffer *buffer, u_int value) { Index: bufaux.h =================================================================== RCS file: /cvs/src/usr.bin/ssh/bufaux.h,v retrieving revision 1.17 diff -u -r1.17 bufaux.h --- bufaux.h 18 Mar 2002 17:25:29 -0000 1.17 +++ bufaux.h 19 Apr 2002 12:55:56 -0000 @@ -23,...
2002 Jan 06
3
sftp/scp performance testing
Folks, I've noticed poor performance using sftp. If anyone has any advice on how to improve performance, I'd like to hear it. Test simply involved transferring a single 143MB MP3 file using defaults for all the program configs. The opensshd 3.0.2p1 server is used in all tests. Software: openssh suite 3.0.2p1 psftp (putty sftp client) latest dev snapshot pscp (putty scp client) latest
2008 Jun 19
5
Portforwarding using the control master.
Hi all, currently I am considering writing a patch for OpenSSH that will allow portforwarding using the control_master unix domain socket. The idea is to introduce an extra SSHMUX command, SSHMUX_COMMAND_SOCKS, which will then pass control to the normal socks functions used for dynamic forwarding. The main reason for me to write this patch are: - some more control over who gets to connect to
2002 Jan 03
3
[PATCH] Improving sftp client performance
...*num, int i) +{ + memmove(rq + i, rq + i + 1, (*num - i - 1) * sizeof(struct request)); + --*num; +} + +static void +send_request(int fd, const char *handle, u_int handle_len, int type, + const struct request *rq, Buffer *m) +{ + buffer_clear(m); + buffer_put_char(m, SSH2_FXP_READ); + buffer_put_int(m, rq->id); + buffer_put_string(m, handle, handle_len); + buffer_put_int64(m, rq->offset); + buffer_put_int(m, rq->len); + send_msg(fd, m); + debug3("Sent message SSH2_FXP_READ I:%d O:%llu S:%u", + rq->id, rq->offset, rq->len); +} + int do_init(int fd...
2010 Jul 13
5
[Bug 1795] New: An integer variable "num" in mm_answer_pam_query() is not initialized before used
...e, &info, &num, &prompts, &echo_on); <== num may not be altered in this call if (ret == 0 && num == 0) sshpam_authok = sshpam_ctxt; if (num > 1 || name == NULL || info == NULL) ret = -1; buffer_clear(m); buffer_put_int(m, ret); buffer_put_cstring(m, name); xfree(name); buffer_put_cstring(m, info); xfree(info); buffer_put_int(m, num); for (i = 0; i < num; ++i) { buffer_put_cstring(m, prompts[i]); <== fail here! xfree(prompts[i]...
2004 Jul 14
3
Logging of wrong pubkey auth
Hello ml, i've set up a ssh server with public-key authentication. But soon i realized that wrong pubkey authentications are not shown in the logs. So i wrote a small patch for monitor.c included as attachement. patch against 3.8.1p1 $ patch -p0 < /path/to/keyauth-loggin.patch Kindly regards, Jan Gehring
2006 Aug 19
0
[PATCH] add statfs extension to sftp-server
...clude <dirent.h> #include <errno.h> @@ -462,6 +463,24 @@ send_attrib(u_int32_t id, const Attrib * buffer_free(&msg); } +static void +send_statfs(u_int32_t id, struct statfs *st) +{ + Buffer msg; + + buffer_init(&msg); + buffer_put_char(&msg, SSH2_FXP_EXTENDED_REPLY); + buffer_put_int(&msg, id); + buffer_put_int(&msg, st->f_bsize); + buffer_put_int64(&msg, st->f_blocks); + buffer_put_int64(&msg, st->f_bfree); + buffer_put_int64(&msg, st->f_bavail); + buffer_put_int64(&msg, st->f_files); + buffer_put_int64(&msg, st->f_ffree); + send_m...
2016 Aug 03
2
Configure option '--with-ssh1' breaks openssh-7.3p1
OK, with this additional information I can now reproduce it. Based on some quick experiments it seems to be triggered when sshd is built --with-ssh1 and the config does not *load* a Protocol 1 host key. Works: Protocol=1,2 + Hostkey not specified Protocol=1,2 + Hostkeys for both protocols specified. Doesn't work: Protocol=2 + Hostkey not specified. Protocol=1,2 + Hostkeys specified only for
2003 Dec 07
0
[PATCH] Do PAM chauthtok via keyboard-interactive.
..._CHANGE_EXPIRED_AUTHTOK); + if (sshpam_err != PAM_SUCCESS) + goto auth_fail; + pam_password_change_required(0); + } + } else { + goto auth_fail; + } + } + buffer_put_cstring(&buffer, "OK"); #ifndef USE_POSIX_THREADS + /* Export variables set by do_pam_account */ + buffer_put_int(&buffer, sshpam_account_status); + buffer_put_int(&buffer, sshpam_new_authtok_reqd); + /* Export any environment strings set in child */ for(i = 0; environ[i] != NULL; i++) ; /* Count */ @@ -611,22 +654,22 @@ finish_pam(void) u_int do_pam_account(void) { + if (sshpam_account_statu...
2007 Dec 07
2
[PATCH] add statfs extension to sftp-server
...clude <dirent.h> #include <errno.h> @@ -462,6 +463,24 @@ send_attrib(u_int32_t id, const Attrib * buffer_free(&msg); } +static void +send_statfs(u_int32_t id, struct statfs *st) +{ + Buffer msg; + + buffer_init(&msg); + buffer_put_char(&msg, SSH2_FXP_EXTENDED_REPLY); + buffer_put_int(&msg, id); + buffer_put_int(&msg, st->f_bsize); + buffer_put_int64(&msg, st->f_blocks); + buffer_put_int64(&msg, st->f_bfree); + buffer_put_int64(&msg, st->f_bavail); + buffer_put_int64(&msg, st->f_files); + buffer_put_int64(&msg, st->f_ffree); + send_m...
2003 Oct 08
4
OS/390 openssh
...; xfree(blob); @@ -430,8 +430,8 @@ buffer_init(&msg); buffer_put_char(&msg, SSH2_AGENTC_SIGN_REQUEST); - buffer_put_string(&msg, blob, blen); - buffer_put_string(&msg, data, datalen); + buffer_put_binary(&msg, blob, blen); + buffer_put_binary(&msg, data, datalen); buffer_put_int(&msg, flags); xfree(blob); @@ -446,7 +446,7 @@ fatal("Bad authentication response: %d", type); } else { ret = 0; - *sigp = buffer_get_string(&msg, lenp); + *sigp = buffer_get_binary(&msg, lenp); } buffer_free(&msg); return ret; @@ -573,7 +573,7 @@ } e...
2003 Oct 30
2
sftp client reget reput
...*conn, char *local_path, char *remote_path, + int pflag, int rflag) +#else do_upload(struct sftp_conn *conn, char *local_path, char *remote_path, int pflag) +#endif { int local_fd, status; u_int handle_len, id, type; @@ -1023,6 +1049,13 @@ buffer_put_char(&msg, SSH2_FXP_OPEN); buffer_put_int(&msg, id); buffer_put_cstring(&msg, remote_path); + +#ifdef REGET + if(rflag) + buffer_put_int(&msg, SSH2_FXF_WRITE); + else +#endif + buffer_put_int(&msg, SSH2_FXF_WRITE|SSH2_FXF_CREAT|SSH2_FXF_TRUNC); encode_attrib(&msg, &a); send_msg(conn->fd_out, &msg); @...
2012 Jan 28
1
PATCH: Support for encrypted host keys
...+ buffer_get_bignum(buffer, key->pub_key); + buffer_get_bignum(buffer, key->priv_key); +} + +void +buffer_put_key(Buffer *buffer, const Key *key) +{ + if (key->cert != NULL || key->ecdsa != NULL || key->ecdsa_nid != -1) + fatal("%s: unsupported key feature", __func__); + + buffer_put_int(buffer, key->type); + buffer_put_int(buffer, key->flags); + + switch (key->type) { + case KEY_RSA1: + case KEY_RSA: + buffer_put_key_rsa(buffer, key->rsa); + break; + case KEY_DSA: + buffer_put_key_dsa(buffer, key->dsa); + break; + default: + fatal("%s: unsupported key type...