1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-03 22:13:11 +03:00

* 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.

Bug:	1703472
This commit is contained in:
James Housley
2007-06-23 22:20:30 +00:00
parent 25adcc150e
commit 74b12c3c7a
4 changed files with 15 additions and 10 deletions

View File

@@ -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;
}
}