diff --git a/ChangeLog b/ChangeLog index fe9db7f..0967c9c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-06-23 James Housley + * Eberhard Mattes submitted a patch "According to RFC 4251, + a boolean value of true is encoded as 1, not as 0xff". Servers + should accept any non-zero value. + 2007-06-22 James Housley * Guenter Knauf submitted code for windows to detect if the socket is blocking or not. diff --git a/src/channel.c b/src/channel.c index 171e330..eb9f7a7 100644 --- a/src/channel.c +++ b/src/channel.c @@ -363,7 +363,7 @@ libssh2_channel_forward_listen_ex(LIBSSH2_SESSION *session, const char *host, in *(s++) = SSH_MSG_GLOBAL_REQUEST; libssh2_htonu32(s, sizeof("tcpip-forward") - 1); s += 4; memcpy(s, "tcpip-forward", sizeof("tcpip-forward") - 1); s += sizeof("tcpip-forward") - 1; - *(s++) = 0xFF; /* want_reply */ + *(s++) = 0x01; /* want_reply */ libssh2_htonu32(s, session->fwdLstn_host_len); s += 4; memcpy(s, host ? host : "0.0.0.0", session->fwdLstn_host_len); s += session->fwdLstn_host_len; @@ -629,7 +629,7 @@ libssh2_channel_setenv_ex(LIBSSH2_CHANNEL *channel, char *varname, unsigned int libssh2_htonu32(s, sizeof("env") - 1); s += 4; memcpy(s, "env", sizeof("env") - 1); s += sizeof("env") - 1; - *(s++) = 0xFF; + *(s++) = 0x01; libssh2_htonu32(s, varname_len); s += 4; memcpy(s, varname, varname_len); s += varname_len; @@ -721,7 +721,7 @@ libssh2_channel_request_pty_ex(LIBSSH2_CHANNEL *channel, const char *term, unsig libssh2_htonu32(s, sizeof("pty-req") - 1); s += 4; memcpy(s, "pty-req", sizeof("pty-req") - 1); s += sizeof("pty-req") - 1; - *(s++) = 0xFF; + *(s++) = 0x01; libssh2_htonu32(s, term_len); s += 4; if (term) { @@ -829,8 +829,8 @@ libssh2_channel_x11_req_ex(LIBSSH2_CHANNEL *channel, int single_connection, cons libssh2_htonu32(s, sizeof("x11-req") - 1); s += 4; memcpy(s, "x11-req", sizeof("x11-req") - 1); s += sizeof("x11-req") - 1; - *(s++) = 0xFF; /* want_reply */ - *(s++) = single_connection ? 0xFF : 0x00; + *(s++) = 0x01; /* want_reply */ + *(s++) = single_connection ? 0x01 : 0x00; libssh2_htonu32(s, proto_len); s += 4; memcpy(s, auth_proto ? auth_proto : "MIT-MAGIC-COOKIE-1", proto_len); @@ -936,7 +936,7 @@ libssh2_channel_process_startup(LIBSSH2_CHANNEL *channel, const char *request, u libssh2_htonu32(s, request_len); s += 4; memcpy(s, request, request_len); s += request_len; - *(s++) = 0xFF; + *(s++) = 0x01; if (message) { libssh2_htonu32(s, message_len); s += 4; diff --git a/src/publickey.c b/src/publickey.c index 7587546..6eda6c3 100644 --- a/src/publickey.c +++ b/src/publickey.c @@ -545,14 +545,14 @@ libssh2_publickey_add_ex(LIBSSH2_PUBLICKEY *pkey, const unsigned char *name, uns memcpy(pkey->add_s, name, name_len); pkey->add_s += name_len; libssh2_htonu32(pkey->add_s, blob_len); pkey->add_s += 4; memcpy(pkey->add_s, blob, blob_len); pkey->add_s += blob_len; - *(pkey->add_s++) = overwrite ? 0xFF : 0; + *(pkey->add_s++) = overwrite ? 0x01 : 0; libssh2_htonu32(pkey->add_s, num_attrs); pkey->add_s += 4; for(i = 0; i < num_attrs; i++) { libssh2_htonu32(pkey->add_s, attrs[i].name_len); pkey->add_s += 4; memcpy(pkey->add_s, attrs[i].name, attrs[i].name_len); pkey->add_s += attrs[i].name_len; libssh2_htonu32(pkey->add_s, attrs[i].value_len); pkey->add_s += 4; memcpy(pkey->add_s, attrs[i].value, attrs[i].value_len); pkey->add_s += attrs[i].value_len; - *(pkey->add_s++) = attrs[i].mandatory ? 0xFF : 0; + *(pkey->add_s++) = attrs[i].mandatory ? 0x01 : 0; } } diff --git a/src/userauth.c b/src/userauth.c index e1bc6ad..5c45957 100644 --- a/src/userauth.c +++ b/src/userauth.c @@ -291,7 +291,7 @@ libssh2_userauth_password_ex(LIBSSH2_SESSION *session, const char *username, uns libssh2_htonu32(s, sizeof("password") - 1); s += 4; memcpy(s, "password", sizeof("password") - 1); s += sizeof("password") - 1; - *s = 0xFF; s++; + *s = 0x01; s++; libssh2_htonu32(s, password_len); s += 4; memcpy(s, password, password_len); s += password_len; @@ -807,7 +807,7 @@ libssh2_userauth_publickey_fromfile_ex(LIBSSH2_SESSION *session, const char *use return -1; } - *session->userauth_pblc_b = 0xFF; + *session->userauth_pblc_b = 0x01; libssh2_htonu32(buf, session->session_id_len); datavec[0].iov_base = buf;