Skip to content
Snippets Groups Projects
  1. Sep 08, 2019
    • Simon Tatham's avatar
      Whitespace rationalisation of entire code base. · 5d718ef6
      Simon Tatham authored
      The number of people has been steadily increasing who read our source
      code with an editor that thinks tab stops are 4 spaces apart, as
      opposed to the traditional tty-derived 8 that the PuTTY code expects.
      
      So I've been wondering for ages about just fixing it, and switching to
      a spaces-only policy throughout the code. And I recently found out
      about 'git blame -w', which should make this change not too disruptive
      for the purposes of source-control archaeology; so perhaps now is the
      time.
      
      While I'm at it, I've also taken the opportunity to remove all the
      trailing spaces from source lines (on the basis that git dislikes
      them, and is the only thing that seems to have a strong opinion one
      way or the other).
          
      Apologies to anyone downstream of this code who has complicated patch
      sets to rebase past this change. I don't intend it to be needed again.
      5d718ef6
  2. Jan 20, 2019
    • Simon Tatham's avatar
      Centralised HMAC implementation. · baff23cd
      Simon Tatham authored
      This replaces all the separate HMAC-implementing wrappers in the
      various source files implementing the underlying hashes.
      
      The new HMAC code also correctly handles the case of a key longer than
      the underlying hash's block length, by replacing it with its own hash.
      This means I can reinstate the test vectors in RFC 6234 which exercise
      that case, which I didn't add to cryptsuite before because they'd have
      failed.
      
      It also allows me to remove the ad-hoc code at the call site in
      cproxy.c which turns out to have been doing the same thing - I think
      that must have been the only call site where the question came up
      (since MAC keys invented by the main SSH-2 BPP are always shorter than
      that).
      baff23cd
    • Simon Tatham's avatar
      Access all hashes and MACs through the standard API. · 0d2d20aa
      Simon Tatham authored
      All the hash-specific state structures, and the functions that
      directly accessed them, are now local to the source files implementing
      the hashes themselves. Everywhere we previously used those types or
      functions, we're now using the standard ssh_hash or ssh2_mac API.
      
      The 'simple' functions (hmacmd5_simple, SHA_Simple etc) are now a pair
      of wrappers in sshauxcrypt.c, each of which takes an algorithm
      structure and can do the same conceptual thing regardless of what it
      is.
      0d2d20aa
  3. Oct 06, 2018
    • Simon Tatham's avatar
      Get rid of #ifdef DEFINE_PLUG_METHOD_MACROS. · ed652a70
      Simon Tatham authored
      I don't actually know why this was ever here; it appeared in the very
      first commit that invented Plug in the first place (7b0e0827) without
      explanation. Perhaps Dave's original idea was that sometimes you'd
      need those macros _not_ to be defined so that the same names could be
      reused as the methods for a particular Plug instance? But I don't
      think that ever actually happened, and the code base builds just fine
      with those macros defined unconditionally just like all the other sets
      of method macros we now have, so let's get rid of this piece of cruft
      that was apparently unnecessary all along.
      ed652a70
  4. Sep 20, 2018
    • Simon Tatham's avatar
      Turn SSH-2 MACs into a classoid. · 853bd8b2
      Simon Tatham authored
      This piece of tidying-up has come out particularly well in terms of
      saving tedious repetition and boilerplate. I've managed to remove
      three pointless methods from every MAC implementation by means of
      writing them once centrally in terms of the implementation-specific
      methods; another method (hmacmd5_sink) vanished because I was able to
      make the interface type 'ssh2_mac' be directly usable as a BinarySink
      by way of a new delegation system; and because all the method
      implementations can now find their own vtable, I was even able to
      merge a lot of keying and output functions that had previously
      differed only in length parameters by having them look up the lengths
      in whatever vtable they were passed.
      853bd8b2
  5. May 27, 2018
    • Simon Tatham's avatar
      Modernise the Socket/Plug vtable system. · 5129c40b
      Simon Tatham authored
      Now I've got FROMFIELD, I can rework it so that structures providing
      an implementation of the Socket or Plug trait no longer have to have
      the vtable pointer as the very first thing in the structure. In
      particular, this means that the ProxySocket structure can now directly
      implement _both_ the Socket and Plug traits, which is always
      _logically_ how it's worked, but previously it had to be implemented
      via two separate structs linked to each other.
      5129c40b
  6. May 26, 2018
    • Simon Tatham's avatar
      Make lots of generic data parameters into 'void *'. · 7babe66a
      Simon Tatham authored
      This is a cleanup I started to notice a need for during the BinarySink
      work. It removes a lot of faffing about casting things to char * or
      unsigned char * so that some API will accept them, even though lots of
      such APIs really take a plain 'block of raw binary data' argument and
      don't care what C thinks the signedness of that data might be - they
      may well reinterpret it back and forth internally.
      
      So I've tried to arrange for all the function call APIs that ought to
      have a void * (or const void *) to have one, and those that need to do
      pointer arithmetic on the parameter internally can cast it back at the
      top of the function. That saves endless ad-hoc casts at the call
      sites.
      7babe66a
  7. May 25, 2018
  8. Feb 29, 2016
    • Colin Watson's avatar
      Avoid -Wmisleading-indentation warnings with GCC 6. · e71ec6bf
      Colin Watson authored
      GCC 6 warns about potentially misleading indentation, such as:
      
          if (condition) stmt1; stmt2;
      
      Chaining multiple ifs on a single line runs into this warning, even if
      it's probably not actually misleading to a human eye, so just add a
      couple of newlines to pacify the compiler.
      
      (cherry picked from commit d700c334)
      e71ec6bf
  9. Jan 30, 2016
    • Colin Watson's avatar
      Avoid -Wmisleading-indentation warnings with GCC 6. · d700c334
      Colin Watson authored
      GCC 6 warns about potentially misleading indentation, such as:
      
          if (condition) stmt1; stmt2;
      
      Chaining multiple ifs on a single line runs into this warning, even if
      it's probably not actually misleading to a human eye, so just add a
      couple of newlines to pacify the compiler.
      d700c334
  10. Jun 07, 2015
  11. Jul 14, 2011
    • Simon Tatham's avatar
      Post-release destabilisation! Completely remove the struct type · a1f3b7a3
      Simon Tatham authored
      'Config' in putty.h, which stores all PuTTY's settings and includes an
      arbitrary length limit on every single one of those settings which is
      stored in string form. In place of it is 'Conf', an opaque data type
      everywhere outside the new file conf.c, which stores a list of (key,
      value) pairs in which every key contains an integer identifying a
      configuration setting, and for some of those integers the key also
      contains extra parts (so that, for instance, CONF_environmt is a
      string-to-string mapping). Everywhere that a Config was previously
      used, a Conf is now; everywhere there was a Config structure copy,
      conf_copy() is called; every lookup, adjustment, load and save
      operation on a Config has been rewritten; and there's a mechanism for
      serialising a Conf into a binary blob and back for use with Duplicate
      Session.
      
      User-visible effects of this change _should_ be minimal, though I
      don't doubt I've introduced one or two bugs here and there which will
      eventually be found. The _intended_ visible effects of this change are
      that all arbitrary limits on configuration strings and lists (e.g.
      limit on number of port forwardings) should now disappear; that list
      boxes in the configuration will now be displayed in a sorted order
      rather than the arbitrary order in which they were added to the list
      (since the underlying data structure is now a sorted tree234 rather
      than an ad-hoc comma-separated string); and one more specific change,
      which is that local and dynamic port forwardings on the same port
      number are now mutually exclusive in the configuration (putting 'D' in
      the key rather than the value was a mistake in the first place).
      
      One other reorganisation as a result of this is that I've moved all
      the dialog.c standard handlers (dlg_stdeditbox_handler and friends)
      out into config.c, because I can't really justify calling them generic
      any more. When they took a pointer to an arbitrary structure type and
      the offset of a field within that structure, they were independent of
      whether that structure was a Config or something completely different,
      but now they really do expect to talk to a Conf, which can _only_ be
      used for PuTTY configuration, so I've renamed them all things like
      conf_editbox_handler and moved them out of the nominally independent
      dialog-box management module into the PuTTY-specific config.c.
      
      [originally from svn r9214]
      a1f3b7a3
  12. Jan 20, 2005
  13. Aug 30, 2004
Loading