[Git][NTPsec/ntpsec][master] ntp.packet: Formatting suggestions from black

Hal Murray (@hal.murray) gitlab at mg.gitlab.com
Tue Nov 21 22:31:22 UTC 2023



Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
041c2060 by James Browning at 2023-11-21T06:58:51-08:00
ntp.packet: Formatting suggestions from black

- - - - -


1 changed file:

- pylib/packet.py


Changes:

=====================================
pylib/packet.py
=====================================
@@ -1046,7 +1046,7 @@ class ControlSession:
                                      (len(rawdata), (_pend + KEYID_LENGTH + MINIMUM_MAC_LENGTH)))
                     self._authpass = False
                 elif not self.auth.verify_mac(rawdata, packet_end=_pend,
-                                            mac_begin=_pend):
+                                              mac_begin=_pend):
                     self._authpass = False
 
             # Clip off the MAC, if any
@@ -1112,7 +1112,7 @@ class ControlSession:
                                 % (f, len(fragments)), 1)
                         break
                 else:
-                    tempfraglist = [ntp.poly.polystr(f.extension) \
+                    tempfraglist = [ntp.poly.polystr(f.extension)
                                     for f in fragments]
                     self.response = ntp.poly.polybytes("".join(tempfraglist))
                     warndbg("Fragment collection ends. %d bytes "
@@ -1363,7 +1363,7 @@ This combats source address spoofing
                         idx = int(idx)
                     except ValueError:
                         raise ControlException(SERR_BADTAG % tag)
-                    ### Does not check missing/gappy entries
+                    # Does not check missing/gappy entries
                     if idx not in fake_list:
                         fake_dict[str(idx)] = {}
                         fake_list.append(idx)
@@ -1709,7 +1709,7 @@ class Authenticator:
                     keytype = 'AES-128'
                 if len(passwd) > 20:
                     # if len(passwd) > 64:
-                        # print('AUTH: Truncating key %s to 256bits (32Bytes)' % keyid)
+                    #      print('AUTH: Truncating key %s to 256bits (32Bytes)' % keyid)
                     passwd = ntp.util.hexstr2octets(passwd[:64])
                 self.passwords[int(keyid)] = (keytype, passwd)
 
@@ -1778,7 +1778,7 @@ class Authenticator:
             return False
         # typically preferred to avoid timing attacks client-side (in theory)
         try:
-            return hmac.compare_digest(mac, mac2) # supported 2.7.7+ and 3.3+
+            return hmac.compare_digest(mac, mac2)  # supported 2.7.7+ and 3.3+
         except AttributeError:
             return mac == mac2  # solves issue #666
 



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/041c206005d72c726dc62cebb5f9bf7533b9faf8

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/-/commit/041c206005d72c726dc62cebb5f9bf7533b9faf8
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20231121/b547dca1/attachment-0001.htm>


More information about the vc mailing list