/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos

  • Committer: Teddy Hogeborn
  • Date: 2019-07-29 16:35:53 UTC
  • Revision ID: teddy@recompile.se-20190729163553-1i442i2cbx64c537
Make tests and man page examples match

Make the tests test_manual_page_example[1-5] match exactly what is
written in the manual page, and add comments to manual page as
reminders to keep tests and manual page examples in sync.

* mandos-ctl (Test_commands_from_options.test_manual_page_example_1):
  Remove "--verbose" option, since the manual does not have it as the
  first example, and change assertion to match.
* mandos-ctl.xml (EXAMPLE): Add comments to all examples documenting
  which test function they correspond to.  Also remove unnecessary
  quotes from option arguments in fourth example, and clarify language
  slightly in fifth example.

Show diffs side-by-side

added added

removed removed

Lines of Context:
115
115
if sys.version_info.major == 2:
116
116
    str = unicode
117
117
 
118
 
version = "1.8.3"
 
118
version = "1.8.4"
119
119
stored_state_file = "clients.pickle"
120
120
 
121
121
logger = logging.getLogger()
586
586
        def __init__(self, socket, credentials=None):
587
587
            self._c_object = gnutls.session_t()
588
588
            gnutls_flags = gnutls.CLIENT
589
 
            if gnutls.check_version("3.5.6"):
 
589
            if gnutls.check_version(b"3.5.6"):
590
590
                gnutls_flags |= gnutls.NO_TICKETS
591
591
            if gnutls.has_rawpk:
592
592
                gnutls_flags |= gnutls.ENABLE_RAWPK
794
794
                                                    ctypes.c_size_t)]
795
795
        openpgp_crt_get_fingerprint.restype = _error_code
796
796
 
797
 
    if check_version("3.6.4"):
 
797
    if check_version(b"3.6.4"):
798
798
        certificate_type_get2 = _library.gnutls_certificate_type_get2
799
799
        certificate_type_get2.argtypes = [session_t, ctypes.c_int]
800
800
        certificate_type_get2.restype = _error_code
2287
2287
            approval_required = False
2288
2288
            try:
2289
2289
                if gnutls.has_rawpk:
2290
 
                    fpr = ""
 
2290
                    fpr = b""
2291
2291
                    try:
2292
2292
                        key_id = self.key_id(
2293
2293
                            self.peer_certificate(session))
2297
2297
                    logger.debug("Key ID: %s", key_id)
2298
2298
 
2299
2299
                else:
2300
 
                    key_id = ""
 
2300
                    key_id = b""
2301
2301
                    try:
2302
2302
                        fpr = self.fingerprint(
2303
2303
                            self.peer_certificate(session))
2605
2605
                    raise
2606
2606
        # Only bind(2) the socket if we really need to.
2607
2607
        if self.server_address[0] or self.server_address[1]:
 
2608
            if self.server_address[1]:
 
2609
                self.allow_reuse_address = True
2608
2610
            if not self.server_address[0]:
2609
2611
                if self.address_family == socket.AF_INET6:
2610
2612
                    any_address = "::"  # in6addr_any
3242
3244
                        for k in ("name", "host"):
3243
3245
                            if isinstance(value[k], bytes):
3244
3246
                                value[k] = value[k].decode("utf-8")
3245
 
                        if not value.has_key("key_id"):
 
3247
                        if "key_id" not in value:
3246
3248
                            value["key_id"] = ""
3247
 
                        elif not value.has_key("fingerprint"):
 
3249
                        elif "fingerprint" not in value:
3248
3250
                            value["fingerprint"] = ""
3249
3251
                    #  old_client_settings
3250
3252
                    # .keys()