mirror of
https://github.com/jtesta/ssh-audit.git
synced 2025-06-23 11:04:31 +02:00
Fix and update write buffer. Add buffer tests.
This commit is contained in:
@ -416,7 +416,7 @@ class WriteBuf(object):
|
||||
return self.write(v)
|
||||
|
||||
def write_list(self, v):
|
||||
self.write_string(u','.join(v))
|
||||
return self.write_string(u','.join(v))
|
||||
|
||||
@classmethod
|
||||
def _bitlength(cls, n):
|
||||
@ -454,6 +454,12 @@ class WriteBuf(object):
|
||||
data = self._create_mpint(n)
|
||||
return self.write_string(data)
|
||||
|
||||
def write_line(self, v):
|
||||
if not isinstance(v, bytes):
|
||||
v = bytes(bytearray(v, 'utf-8'))
|
||||
v += b'\r\n'
|
||||
return self.write(v)
|
||||
|
||||
def write_flush(self):
|
||||
payload = self._wbuf.getvalue()
|
||||
self._wbuf.truncate(0)
|
||||
|
Reference in New Issue
Block a user