2015-11-26  Miloslav Trmač  <mitr@redhat.com>

	* configure.ac: Release 0.102.
	* NEWS: Update.

	* src/bridge.py (SignRPMsReadReplyThread._real_run): On exceptions,
	shut down the server socket to cause *RequestThread to terminate even
	if the server is blocking and waiting for this thread to continue reading
	its replies.

	* src/utils.py (run_worker_threads): Do not log exceptions after
	waiting on a thread, the thread has logged it already at termination
	time.

	* src/utils.py (log_exception): New parameter thread_name.  All users
	changed.

	* src/utils.py (WorkerQueueOrphanedError, WorkerQueue): New classes.
	(WorkerThread.run): Mark input queues as orphaned. Be fairly silent
	about failures sending EOF to orphaned queues.
	(run_worker_threads): Silently ignore failures sending EOF to orphaned
	queues.
	(log_exception): Recognize WorkerQueueOrphanedError.
	* src/bridge.py (SignRPMsRequestHandler.post_request_phase)
	* src/server.py (cmd_sign_rpms): Use utils.WorkerQueue.

2015-11-18  Miloslav Trmač  <mitr@redhat.com>

	* configure.ac: Release 0.101.
	* NEWS: Update.

	* src/bridge.py (SignRPMsReadRequestThread.eof): Remove.
	(SignRPMsReadRequestThread.__init__)
	(SignRPMsKojiRequestThread.__init__)
	(SignRPMsKojiRequestThread._real_run): Use None instead of
	SignRPMsReadRequestThread.eof as the end-of-stream marker.
	(SignRPMsReadReplyThread.eof): Remove.
	(SignRPMsReadReplyThread.__init__)
	(SignRPMsKojiReplyThread.__init__)
	(SignRPMsKojiReplyThread._real_run): Use None instead of
	SignRPMsReadReplyThread.eof as the end-of-stream marker.

	* src/bridge.py (SignRPMsKojiRequestThread)
	(SignRPMsKojiReplyThread): New classes, split from...
	(SignRPMsKojiThread): ... this.
	(SignRPMsKojiRequestThread._real_run)
	(SignRPMsSendRequestThread._real_run): Rely on utils.WorkerThread to
	put the end-of-stream None value to the queue when done.
	(SignRPMsRequestHandler.post_request_phase): Use
	SignRPMsKojiRequestThread and SignRPMsKojiReplyThread instead of the
	shared SignRPMsKojiThread.

	* src/utils.py (WorkerThread.__init__): New member
	ignored_exception_types.
	(WorkerThread.run): Log an uncaught exception in self._real_run()
	immediately, using self.ignored_exception_types.
	(run_worker_threads): Initialize thread's ignored_exception_types.

2013-02-26  Miloslav Trmač  <mitr@redhat.com>

	* src/bridge.py (KojiClient.add_signature): Raise an exception instead
	of just silently logging a warning.

2012-07-17  Miloslav Trmač  <mitr@redhat.com>

	* configure.ac: Release 0.100.
	* NEWS: Update.

	* config/bridge.conf: Document per-Koji instance required-fas-group-*
	variables.
	* src/bridge.py (BridgeConfiguration._add_sections): Recognize '[koji]'
	section.
	(BridgeConfiguration._read_configuration): Set up self.koji_fas_groups.
	(BridgeConnection.__forward_request_headers): Authorize user access to
	Koji instance.
	(BridgeConnection.__check_koji_instance_access): New method.

2012-07-16  Miloslav Trmač  <mitr@redhat.com>

	* src/bridge.py (BridgeConnection.__terminate_client_connection):
	Document why this is only necessary for the client-bridge connection.

2012-07-16  Miloslav Trmač  <mitr@redhat.com>

	* src/utils.py (koji_read_config): Require 'topurl' instead of 'pkgurl'.
	* src/bridge.py (KojiClient.__init__): New member self.__koji_pathinfo.
	(KojiClient.__get_session): Initialize self.__koji_pathinfo from
	topurl in Koji configuration.
	(KojiClient.get_rpm_url): Use self.__koji_pathinfo.build instead of
	hard-coding the build directory layout, like Koji 1.7 does.

2012-07-10  Miloslav Trmač  <mitr@redhat.com>

	* src/client.py (SignRPMArgumentExaminer.open_rpm): Refuse to work on
	zero-length files (the bridge would try to replace them with something
	looked up in Koji).
	* tests/basic.at (Basic functionality): Test handling of empty files
	in sign-rpm and sign-rpms.

	* src/double_tls.py (_SplittingBuffer._active): Mark as inactive after
	we've seen EOFs on both streams, don't wait for a TLS close notify and
	FIN.

	* src/double_tls.py (_debug): Update sample to store output in per-PID
	files, and disable buffering.

	* src/double_tls.py (_CombiningBuffer._handle_errors): Don't send
	EOF markers if the destination has been already shut down for other
	reasons.

	* src/double_tls.py (_SplittingBuffer._handle_errors): Fix class name
	in debug log.

2012-06-25  Miloslav Trmač  <mitr@redhat.com>

	* tests/basic.at (Basic functionality): Replace GnuPG version by a
	constant string before comparing the public key.
	* tests/imported-public-key.asc: Replace GnuPG version by a constant
	string.

	* Makefile.am (installcheck-local): Make sure the test suite is
	up-to-date before running it.

2012-06-03  Miloslav Trmač  <mitr@redhat.com>

	* Makefile.am (pythondir): Override Python installation location.
	(python_PYTHON, nodist_python_PYTHON): Rename from pkgdata_PYTHON
	and nodist_pkgdata_PYTHON to work around automake's placement
	restrictions.  All users updated.

2011-06-17  Miloslav Trmač  <mitr@redhat.com>

	* src/bridge.py (BridgeConnection): Rename self.handler to
	self.__handler.
	(BridgeConnection.__forward_request_headers): Rename from
	forward_request_headers.
	(BridgeConnection.__forward_reply_headers): Rename from
	forward_reply_headers.
	(BridgeConnection.__forward_reply_payload): Rename from
	forward_reply_payload.
	(BridgeConnection.__terminate_client_connection): Rename from
	terminate_client_connection.
	(BridgeConnection.__finalize): Rename from finalize.

	* src/bridge.py (BridgeConnection.handle_connection): Move from
	a top-level function.

	* src/bridge.py (handle_connection): Move all connection-specific code
	from bridge_one_request here.

	* src/bridge.py (fas_user_is_in_group): Move into infrastructure
	section.

	* src/bridge.py (BridgeConnection.forward_request_headers): Split from
	handle_connection().
	(BridgeConnection.read_request_headers)
	(BridgeConnection.read_request_payload_size): Fold into
	forward_request_headers().

	* src/bridge.py (BridgeConnection.__init__): Initialize self.handler.
	(BridgeConnection.finalize): Split from handle_connection.  Handle cases
	when handler was not initialized.
	(handle_connection): Finalize the connection even when
	conn.read_request_headers() fails.

	* src/bridge.py (BridgeConnection.forward_reply_headers): New
	function, split from handle_connection.
	(BridgeConnection.read_reply_payload_size)
	(BridgeConnection.forward_reply_payload_authenticator): Fold into
	forward_reply_headers.

	* src/bridge.py (bridge_one_request): Close server socket even if
	client has failed to connect.

	* src/bridge.py (RequestValidator): Split from RequestType.
	(RequestValidator.__init__): Remove default value of max_payload.
	Remove default_fields handling.
	(RequestValidator.validate): Rename back from validate_data.
	(RequestHandler): Rename from RequestType, use one instance per
	connection.
	(RequestHandler.validate): Remove.
	(SignRPMRequestHandler): Rename from SignRPMRequestType.
	(SignRPMRequestHandler.close): Stop zeroizing state, this object
	won't be reused for future connections.
	(SignRPMsReadRequestThread.__subheader_validator): Use RequestValidator.
	Rename from __subheader_RT.  All users updated.
	(SignRPMsRequestHandler): Rename from SignRPMsRequestType.
	(RT): New class holding named fields instead of using old
	RequestType.  Default max_payload and common fields are now handled
	here.
	(request_types): Update for new RT.
	(BridgeConnection.read_request_headers): Set self.handler.  Return only
	the verifier.
	(handle_connection): Use the separate validator directly.  Use
	conn.handler instead of direct access to a RequestType.

	* src/bridge.py (SignRPMRequestType.forward_reply_payload): Make this
	more similar to SignRPMsSendReplyThread.__handle_one_rpm.

	* src/bridge.py (RequestType.validate_data): Rename from
	RequestType.validate.  All users updated.
	(RequestType.validate): New method, use BridgeConnection.
	(RequestType.forward_request_payload)
	(RequestType.forward_reply_payload, KojiClient.__init__)
	(KojiClient.__get_session, SignRPMsKojiThread.__init__)
	(SignRPMsKojiThread._real_run)
	(SignRPMsKojiThread.__handle_one_reply_rpm)
	(SignRPMsSendReplyThread.__init__)
	(SignRPMsSendReplyThread.__handle_one_rpm): Use BridgeConnection
	fields instead of separate parameters.  All users and subclasses
	updated.
	(SignRPMRequestType.__init__)
	(SignRPMRequestType.forward_request_payload, SignRPMRequestType.close):
	Don't store request header fields.
	(SignRPMRequestType.forward_reply_payload): Access request header fields
	through BridgeConnection.
	(SignRPMsRequestType.forward_request_payload)
	(SignRPMsRequestType.close): Don't store request header fields.
	(SignRPMsRequestType.post_request_phase): Access request header
	fields through BridgeConnection.
	(BridgeConnection.read_request_headers)
	(BridgeConnection.read_request_payload_size)
	(BridgeConnection.forward_reply_headers)
	(BridgeConnection.read_reply_payload_size)
	(BridgeConnection.forward_reply_payload_authenticator)
	(BridgeConnection.terminate_client_connection): New methods, split from
	handle_connection.

	* src/bridge.py (BridgeConnection): New class.
	(RequestType.forward_request_payload, RequestType.forward_reply_payload)
	(RequestType.post_request_phase, KojiClient.__init__)
	(SignRPMsReadRequestThread.__init__)
	(SignRPMsKojiThread.__init__, handle_connection): Use
	BridgeConnection instead of separate parameters and members.  All
	users and subclasses updated.
	(bridge_one_request): Create a BridgeConnection object.

2011-06-13  Miloslav Trmač  <mitr@redhat.com>

	* src/bridge.py (RequestType, RequestType.post_request_phase): New
	parameter user_name.  All users updated.
	(KojiClient.__init__): New parameter user_name.  All users updated.
	(KojiClient.__get_session): Do proxy authentication based on certificate
	CN, not on sigul user name.
	(SignRPMRequestType.forward_request_payload): Pass certificate CN to
	KojiClient.
	(SignRPMsKojiThread.__init__): New parameter user_name.
	(SignRPMsKojiThread._real_run): Pass certificate CN to KojiClient.
	(SignRPMsRequestType.post_request_phase): Pass certificate CN to
	SignRPMsKojiThread.
	(handle_connection): New parameter user_name.
	(bridge_one_request): Pass certificate CN as Koji user name.

	* src/server.py (SigningContext.sign_rpm): If we fail due to unexpected
	RPM output, record it.

	* src/client.py (cmd_sign_rpm, cmd_sign_rpms): Reject (sigul sign-rpm*
	-o ... --koji-only ...).

2011-06-06  Miloslav Trmač  <mitr@redhat.com>

	* configure.ac: Release 0.99.
	* NEWS: Update.

2011-06-04  Miloslav Trmač  <mitr@redhat.com>

	* doc/protocol-design.txt (sign-rpm, sign-rpms): New field
	koji-instance.
	* src/utils.py (KojiConfiguration._add_defaults): Add default for
	koji-instances.
	(KojiConfiguration._read_configuration): Handle koji-instances, and the
	per-instance configuration files.
	(koji_read_config): New parameter instance.
	* src/client.py (SignRPMArgumentExaminer.__init__): New parameter
	koji_instance.
	(SignRPMArgumentExaminer.open_rpm): Use the specified Koji instance.
	(SignRPMsRequestThread.__init__): New parameter koji_instance.
	(SignRPMsRequestThread._real_run): Use the specified Koji instance.
	(cmd_sign_rpm, cmd_sign_rpms): New option --koji-instance.
	* src/bridge.py (KojiClient.__get_session): Use the koji-instance
	field.
	(request-types): Allow field 'koji-instance' in sign-rpm and sign-rpms.
	* config/bridge.conf (koji)
	* config/client.conf (koji): Add alternative Koji instance examples.
	* doc/sigul.1.in (sign-rpm, sign-rpms): Document --koji-instance.

2011-06-03  Miloslav Trmač  <mitr@redhat.com>

	* doc/sigul.1.in (sign-rpm): Fix typo in synopsis.
	(sign-rpms): Add --v3-signature to synopsis.

2011-06-01  Miloslav Trmač  <mitr@redhat.com>

	* configure.ac: Release 0.98.

2011-05-31  Miloslav Trmač  <mitr@redhat.com>

	* tests/basic.at (new-key): Use an expiration date that doesn't overflow
	32-bit time_t.

2011-05-30  Miloslav Trmač  <mitr@redhat.com>

	* src/bridge.py (create_listen_sock)
	* src/double_tls.py (DoubleTLSClient.__child): Explicitly specify socket
	family to avoid a DeprecationWarning.
	* src/double_tls.py (DoubleTLSClient.__child): Use nss.io.AddrInfo
	to avoid a DeprecationWarning.
	* README: Update required python-nss version.

	* NEWS: Update.

	* Makefile.am (DISTCLEANFILES, EXTRA_DIST): Fix (make distcheck).

	* Makefile.am (installcheck-local): Fix AUTOTEST_PATH.

	* Makefile.am (check-local): Remove, the test suite requires installed
	files.

	* tests/basic.at: Always use RSA keys, to make the (rpm -K) output
	predictable.

	* src/server.py (ServerConfiguration._add_defaults): Removee "encrypt"
	from default key usage, recent gnupg versions reject it with DSA.
	* config/server.conf (gnupg-key-usage): Update example.

	* src/utils.py (DaemonIDConfiguration._read_configuration): Treat empty
	user and group names same as undefined values.
	* tests/basic.at (Basic functionality): Don't try to change users,
	regardless of system-wide configuration.

	* src/bridge.py (SignRPMsReadRequestThread._real_run)
	(SignRPMsReadRequestThread.__read_one_request)
	(SignRPMsKojiThread._real_run)
	(SignRPMsKojiThread.__handle_one_request_rpm)
	(SignRPMsSendRequestThread._real_run)
	(SignRPMsSendRequestThread.__handle_one_rpm)
	(SignRPMsReadReplyThread._real_run)
	(SignRPMsReadReplyThread.__read_one_reply)
	(SignRPMsSendReplyThread._real_run)
	(SignRPMsSendReplyThread.__handle_one_rpm)
	* src/server.py (SignRPMsRequestThread._real_run)
	(SignRPMsRequestThread.__read_one_request)
	(SignRPMsSignerThread._real_run)
	(SignRPMsSignerThread.__handle_one_rpm)
	(SignRPMsReplyThread._real_run)
	(SignRPMsReplyThread.__handle_one_rpm): Remove detailed debugging log
	output.

	* NEWS
	* README: Update.

2011-05-26  Miloslav Trmač  <mitr@redhat.com>

	* src/sigul_setup_client: Stop when a client certificate already exists
	and tell the user what to do.

	* src/sigul_setup_client: Read NSS database password from
	~/.sigul/client.conf if it already exists.

	* src/sigul_setup_client: Explain the changing password terminology
	when doing a PKCS#12 export/import.

	* src/bridge.py (bridge_one_request)
	* src/double_tls.py (DoubleTLSClient.__child): Make reporting of
	expired certificate errors more user-friendly.

	* src/double_tls.py (DoubleTLSClient.__child): Flush log output on
	NSPRError.

2011-05-25  Miloslav Trmač  <mitr@redhat.com>

	* README: Clarify how koji accounts are used.

	* src/server.py (ServerConfiguration._add_sections)
	(ServerConfiguration._read_configuration): Don't duplicate handling of
	database-path in ServerBaseConfiguration.

	* src/utils.py (KojiConfiguration): New class.
	(koji_read_config): Use a KojiConfiguration parameter instead of
	handling the file path directly.
	* src/bridge.py (BridgeConfiguration): Use utils.KojiConfiguration.
	(BridgeConfiguration._add_defaults)
	(BridgeConfiguration._read_configuration): Don't handle koji-config.
	explicitly.
	(RequestType.forward_request_payload): New parameter config.  All
	subclasses and users updated.
	(KojiClient.__init__): New parameter config.  All users updated.
	(KojiClient.__get_session): Don't use an undefined variable.
	* src/client.py (ClientConfiguration): Use utils.KojiConfiguration.
	(ClientConfiguration._add_defaults)
	(ClientConfiguration._read_configuration): Don't handle koji-config.
	(SignRPMArgumentExaminer.__init__): New parameter config.  All users
	updated.
	(SignRPMArgumentExaminer.open_rpm): Don't use an undefined variable.
	* config/bridge.conf (koji-config)
	* config/client.conf (koji-config): Move example to a separate koji
	section.

	* src/utils.py (Configuration._add_sections): New method.  All
	subclasses updated.
	(Configuration.__init__): Add all sections to the parser explicitly
	to avoid errors when a section is not present in the config file.

2011-05-25  Dan Horák <dan@danny.cz>

	* src/bridge.py (BridgeConfiguration._add_defaults)
	(BridgeConfiguration._read_configuration)
	* src/client.py (ClientConfiguration._add_defaults)
	(ClientConfiguration._read_configuration): Handle koji-config.
	* src/utils.py (koji_read_config): New parameter koji_config.  All users
	updated.
	* config/bridge.conf (koji-config)
	* config/client.conf (koji-config): Add option examples.

2011-05-24  Miloslav Trmač  <mitr@redhat.com>

	* src/bridge.py (main): Add FIXME.

	* src/bridge.py (SignRPMRequestType.forward_request_payload)
	(SignRPMsSendRequestThread.__handle_one_rpm): Tell the user what has
	happened on URLGrabError and what the failing URL was.

2011-05-23  Miloslav Trmač  <mitr@redhat.com>

	* doc/sigul.1.in (sign-rpm): Document --v3-signature.
	(sign-rpms): Document command.

	* tests/basic.at (get-public-key, delete-key, change-passphrase)
	(sign-text, sign-data, sign-rpm): Run the client in verbose mode when
	possible.

	* src/client.py (handle_global_options): New option --user-name.
	* doc/sigul.1.in: Document --user-name.
	* tests/basic.at (new-user, sign-text): Use --user-name to test user
	authentication and key access granting behavior.

	* tests/new-key-substitute.asc: New file.
	* tests/basic.at (new-key): Allow skipping the new-key test if
	$SIGUL_SUBSTITUTE_NEW_KEY is set.

	* src/client.py (cmd_import_key): Fix help synopsis, improve command
	description.

	* tests/basic.at (new-key): Stop sending a superfluous password.

	* doc/sign-many.py (sign_rpm): Split from main.
	(sign_rpms): New function.
	(main): Demonstrate using sign_rpm or sign_rpms.

2011-05-19  Miloslav Trmač  <mitr@redhat.com>

	* src/server_add_admin.py (main)
	* src/server_common.py (db_open)
	* src/server.py (cmd_new_user, cmd_new_key, cmd_import_key)
	(cmd_grant_key_access): Port to sqlalchemy 0.5.

	* tests/basic.at
	* tests/imported-public-key.asc
	* tests/imported-secret-key.asc
	* tests/testrpm.spec
	* tests/testsuite.at: New files.
	* configure.ac: Initialize test suite.  Define AUTOM4TE.
	* Makefile.am (TESTFILES): New variable.
	(EXTRA_DIST): Distribute the test suite.
	(src/sigul, src/sigul_bridge, src/sigul_server)
	(src/sigul_server_add_admin, src/sigul_server_create_db): Make the
	scripts executable even before installing, to allow running them from
	the test suite.
	(clean-local, check-local, installcheck-local)
	($(top_srcdir)/tests/package.m4, $(top_srcdir)/tests/testsuite)
	(atconfig): New rules.

	* src/utils.py (read_password): Raise EOFError on unexpected EOF instead
	of looping infinitely.

2011-05-09  Miloslav Trmač  <mitr@redhat.com>

	* src/server_add_admin.py (main): Only import readline when necessary,
	to avoid sending escape sequences to stdout when not interactive.

	* src/server_add_admin (main): New option --name.

	* src/server_add_admin.py (AddAdminConfiguration._read_configuration):
	Fix so that this doesn't crash on every start.

	* src/utils.py (create_basic_parser)
	(optparse_parse_options_only): Split from get_daemon_options().
	(get_daemon_options): Drop parameters batch, daemon_options: let
	original users of these parameters handle the parser directly.
	* src/server_add_admin.py (main)

	* src/server_create_db.py (main): Use utils.create_basic_parser and
	handle the parser directly.

	* src/server_add_admin.py (main): Beautify.

	* src/client.py (read_password): Move ...
	* src/utils.py (read_password): ... here.  All users updated.
	(optparse_add_batch_option): New function, extracted from
	client.py_handle_global_options.
	(get_daemon_options): New parameter batch.
	* src/client.py (handle_global_options): Use
	utils.optparse_add_batch_option().
	* src/server_add_admin.py (AddAdminConfiguration): New class.
	(main): Add --batch.  Use utils.read_password.  Only ask for password
	once in batch mode.

	* src/utils.py (get_daemon_options): Rename parameter daemonize to
	daemon_options.  Only handle --internal-log-dir and --internal-pid-dir
	if daemon_options is True.  All users updated.

	* config/server.conf (database-path): Fix default value.

	* src/utils.py (get_daemon_options): Add --internal-pid-dir.
	(create_pid_file, delete_pid_file): New parameter options.  All users
	updated.

	* src/bridge.py (main)
	* src/server.py (main): Remove the unused possibility to disable logging
	to a file, by editing settings.py.

	* src/utils.py (get_daemon_options): Add --internal-log-dir.
	* src/server.py (main)
	* src/bridge.py (main): Reflect --internal-log-dir, overriding
	settings.log_dir.

2011-05-06  Miloslav Trmač  <mitr@redhat.com>

	* src/server.py (request_handling_child): Log errors when opening the
	database instead of silently discarding them.

	* src/client.py (SignRPMsReplyThread._real_run): Immediately report
	successful subrequests in verbose mode.

	* src/bridge.py (bridge_one_request): Log more information on NSPRError.

2011-02-01  Miloslav Trmač  <mitr@redhat.com>

	* README: Add numerical identifiers to command sequences to disambiguate
	"see above" references.

2010-06-12  Miloslav Trmač  <mitr@redhat.com>

	* configure.ac: Define PACKAGE_URL.

2010-05-27  Miloslav Trmač  <mitr@redhat.com>

	* src/double_tls.py (_CombiningBuffer.__init__)
	(_InnerBridgingBuffer.__init__): New member __buffer_dropped.
	(_SplittingBuffer.__init__): New members __inner_buffer_dropped and
	__outer_buffer_dropped.
	(_CombiningBuffer._handle_errors, _SplittingBuffer._handle_errors)
	(_InnerBridgingBuffer._handle_errors): Don't flood the logs with "data
	dropped" messages.

	* src/double_tls.py (_id): Handle more than 26 objects (more than (255
	- ord('A')) to be precise).

2010-05-25  Miloslav Trmač  <mitr@redhat.com>

	* src/server.py (ServerConfiguration._add_defaults): New option
	signing-timeout.
	(ServerConfiguration._read_configuration): Handle signing-timeout.
	(SigningContext.sign_rpm): Catch pexpect exceptions.  Use
	signing-timeout.  New parameter config.  All callers changed.
	(SignRPMsSignerThread.__init__): New parameter config.  Caller changed.
	* config/server.conf (bridge-hostname): Document signing-timeout.

	* src/utils.py (_derivation_counter_1): New definition.
	(derived_key): New function.
	(SHA512HashAndHMACReader, WorkerThread): New classes.
	(run_worker_threads, log_exception): New functions.
	* src/double_tls.py (DoubleTLSClient.outer_shutdown)
	(OuterBuffer.set_full_duplex): New methods.
	* src/bridge.py (BridgeConfiguration._add_defaults): New option
	max-rpms-payload-size.
	(BridgeConfiguration._read_configuration): Handle max-rpms-payload-size.
	(RequestType.__init__): Add support for subheaders.
	(RequestType.post_request_phase): New method.
	(SubrequestMap, SignRPMsReadRequestThread, SignRPMsKojiThread)
	(SignRPMsSendRequestThread, SignRPMsReadReplyThread)
	(SignRPMsSendReplyThread, SignRPMsRequestType): New classes.
	(request_types): Add 'sign-rpms'.
	(SF): Unset after last use.
	(handle_connection): Call RequestType.post_request_phase().  New
	parameter config.  All callers changed.
	* src/client.py (MAX_SIGN_RPMS_PAYLOAD_SIZE): New definition.
	(ClientsConnection.__send_payload_size)
	(ClientsConnection.__send_payload_from_file): Document that these
	methods are suitable both for the primary payload and subpayloads.
	(ClientsConnection.send_subheader)
	(ClientsConnection.send_empty_subpayload)
	(ClientsConnection.read_subheader)
	(ClientsConnection.read_empty_subpayload)
	(ClientsConnection.write_subpayload_to_file)
	(ClientsConnection.outer_shutdown_write): New methods.
	(SignRPMsRequestThread, SignRPMsReplyThread): New classes.
	(cmd_sign_rpms): New function.
	(command_handlers): Add sign-rpms.
	(main): Allow using ClientError to exit without printing an additional
	message.
	* src/server.py (ServerConfiguration._add_defaults): New option
	max-rpms-payload-size.
	(ServerConfiguration._read_configuration): Handle max-rpms-payload-size.
	(ServersConnection.__send_payload_size)
	(ServersConnection.__send_payload_from_file): Document that these
	methods are suitable both for the primary payload and subpayloads.
	(ServersConnection.read_subheader)
	(ServersConnection.read_subpayload_to_file)
	(ServersConnection.send_subheader)
	(ServersConnection.send_empty_subpayload)
	(ServersConnection.send_subpayload_from_file): New methods.
	(SignRPMsRequestThread, SignRPMsSignerThread)
	(SignRPMsReplyThread): New classes.
	(cmd_sign_rpms): New function.
	* doc/protocol-design.txt: Document op="sign-rpms".
	* config/bridge.conf (max-rpms-payload-size)
	* config/server.conf (max-rpms-payload-size): Document new option.

	* src/client.py (SignRPMArgumentExaminer): Split from cmd_sign_rpm.

	* src/server.py (RPMFileError, RPMFile, SigningContext): Split from
	cmd_sign_rpm.

	* src/utils.py (file_size_in_blocks, path_size_in_blocks): New
	functions.

	* src/server.py (ServersConnection.__send_payload_from_file): Split from
	ServersConnection.send_payload_from_file().

	* src/server.py (ServersConnection.send_payload_from_file): Rename
	parameter.

	* src/server.py (ServersConnection.__send_payload_size): Rename from
	ServersConnection.__start_reply_payload().  All users changed.

	* src/client.py (ClientsConnection.__send_payload_from_file): Split
	from ClientsConnection.send_payload_from_file.

	* src/client.py (ClientsConnection.send_payload_from_file): Rename
	parameter.

	* src/client.py (ClientsConnection.__send_payload_size): Rename from
	ClientsConnection.__start_payload().  All users changed.

	* src/utils.py (sha512_digest): Remove no longer necessary conversions
	between str and buffer.  Fold into callers.
	(_DigestsReader, SHA512Reader, SHA512HMACReader, _DigestsWriter)
	(SHA512Writer, SHA512HMACWriter): New classes.
	* src/client.py (ClientsConnection.connect): Set up
	self.__request_header_writer instead of self.__request_header_digest,
	self.__request_payload_writer instead of self.__request_payload_digest.
	All users updated.
	(ClientsConnection.send_inner): Generate auth keys directly as NSS keys.
	Set up self.__reply_header_reader instead of self.__reply_header_hmac,
	self.__reply_payload_header instead of self.__reply_payload_hmac.  All
	users updated.
	(ClientsConnection.__send_payload_part): Replace by
	self.__request_payload_writer.write(), fold into callers.
	(ClientsConnection.__send_header): Replace by
	self.__request_header_writer.write(), fold into callers.
	(ClientsConnection.__read_header): Replace by
	self.__reply_header_reader.read(), fold into callers.
	* src/server.py (ServersConnection.read_request): Use a single reader
	for computing SHA-512 in all three payload types.  Use utils.copy_data.
	(ServersConnection.read_request): Set up self.__reply_header_writer
	instead of self.__reply_header_hmac, self.__reply_payload_writer instead
	of self.__reply_payload_hmac.  All users updated.
	(ServersConnection.__send_payload): Replace by
	self.__reply_payload_writer.write(), fold into callers.
	(ServersConnection.__send_reply_payload_auth): Replace by
	self.__reply_payload_writer.write_64B_hmac(), fold into callers.

	* src/double_tls.py (OuterBuffer.__recv_exact): Add a parameter to the
	EOFError exception.
	(OuterBuffer.read): Update docstring.

	* src/bridge.py (SignRPMRequestType): Rename from SignRpmRequestType.
	All references updated.

	* src/utils.py (md5_digest): Remove no longer necessary conversions
	between str and buffer.  Fold into the only caller.
	* src/bridge.py (RPMObject, KojiClient): Split from SignRpmRequestType.
	(SignRpmRequestType): Use KojiClient.
	(SignRpmRequestType.forward_reply_payload): Don't keep tmp_file open
	while adding signature to Koji.
	(SignRpmRequestType.close): Call superclass close() method.  Clear
	self.__request_fields for added safety.

	* src/bridge.py (urlgrabber_open): Split from
	SignRpmRequestType.forward_request_payload.
	(SignRpmRequestType.forward_request_payload): Use urlgrabber_open.

	* src/double_tls.py (OuterBuffer.send_outer_eof): New method.
	* src/bridge.py (handle_connection): Make sure we don't send a RST to
	the client before it can handle all reply data.

	* src/bridge.py (InvalidReplyError): New class.
	(handle_connection): Raise InvalidReplyError, not InvalidRequestError.
	(bridge_one_request): Handle InvalidReplyError.

	* src/utils.py (readable_fields): New function.
	* src/bridge.py (handle_connection)
	* src/server.py (ServersConnection.read_request): Use
	utils.readable_fields.

	* src/utils.py (copy_data): New function.
	* src/bridge.py (copy_file_data): Rename from copy_data.  Use
	utils.copy_data.  All callers changed.

	* src/utils.py (write_new_file): Rename parameter.

2010-04-08  Miloslav Trmač  <mitr@redhat.com>

	* src/double_tls.py (OuterBuffer.read, OuterBuffer.write)
	(OuterBuffer.pending_inner_packets, OuterBuffer.add_outer_data): Add
	debug output.

	* src/double_tls.py (_SplittingBuffer._check_shutdown): Fix variable
	name, don't shut down self.__outer_dst over and over.

	* src/double_tls.py (_ForwardingBuffer._handle_errors)
	(_ForwardingBuffer._receive): Comment on possible combinations of
	PR_POLL_IN with other flags.
	(_CombiningBuffer._handle_errors)
	(_CombiningBuffer.__receive_inner)
	(_CombiningBuffer.__receive_outer)
	(_SplittingBuffer._handle_errors, _SplittingBuffer._receive)
	(_InnerBridgingBuffer._handle_errors)
	(_InnerBridgingBuffer._receive): If PR_POLL_IN is set, ignore
	PR_POLL_HUP and PR_POLL_ERR in this iteration.

2010-04-06  Miloslav Trmač  <mitr@redhat.com>

	* src/double_tls.py: (__next_id, __ids, _id): Uncomment.
	(_debug): New function.  Use everywhere instead of commented-out `print'
	to make debugging easier to enable.
	(_CombiningBuffer._prepare_poll): Fix a debug print pasto.

2010-04-02  Miloslav Trmač  <mitr@redhat.com>

	* src/double_tls.py: Drop some unused imports.

2010-03-19  Miloslav Trmač  <mitr@redhat.com>

	* doc/protocol-design.txt: Minor clarifications.

2010-03-10  Miloslav Trmač  <mitr@redhat.com>

	* src/bridge.py (SignRpmRequestType.forward_request_payload): Work with
	recent urlgrabber as well.

2009-07-31  Miloslav Trmač  <mitr@redhat.com>

	* configure.ac: Release 0.97.
	* NEWS: Update.

	* src/bridge.py (copy_data, StoringProxy.stored_read)
	* src/utils.py (u8_unpack, u32_unpack, read_fields): Rename "bytes"
	to avoid a conflict with a built-in.

	* src/settings.py.in (koji_do_proxy_auth): New variable.
	* src/bridge.py (SignRpmRequestType.__koji_get_session): Proxy
	authenticate as the client if settings allow it.
	* README: Document proxy authentication is now required.

	* src/double_tls.py (DoubleTLSClient.inner_open_server): Log the subject
	of the client's certificate in the server.

	* README: Explicitly mention that host names in configuration must match
	host names in certificates.

	* src/server.py (ServersConnection.read_request): close() the temporary
	file to force it to be written to disk.

	* src/bridge.py (SignRpmRequestType.forward_reply_payload): Remove an
	obsolete comment.

	* src/bridge.py (SignRpmRequestType.__init__): Don't initialize an
	unused member.
	(SignRpmRequestType.__init__, SignRpmRequestType.__koji_get_session):
	Only read koji configuration once.

2009-07-30  Miloslav Trmač  <mitr@redhat.com>

	* src/bridge.py (SignRpmRequestType.close): Don't keep cached
	self.__koji_rpm_info between requests.

	* src/server.py (cmd_sign_rpm): Handle source RPMS specially.

	* src/client.py (cmd_sign_rpm)
	* src/server.py (cmd_sign_rpm): Fix handling of epoch returned from
	Koji.

2009-07-23  Miloslav Trmač  <mitr@redhat.com>

	* configure.ac: Release 0.96.
	* NEWS: Update.

2009-07-22  Miloslav Trmač  <mitr@redhat.com>

	* src/bridge.py	(SignRpmRequestType.forward_reply_payload): Don't
	attempt to parse empty payloads as RPMs.  Handle corrupted RPMs.

	* src/bridge.py (SignRpmRequestType.forward_reply_payload): close()
	tmp_file to force it to be written to disk, flush() apparently isn't
	enough.

	* src/bridge.py (SignRpmRequestType.__koji_get_session): Authenticate
	when connecting to Koji.
	* README (server): Update.

	* src/bridge.py (main): Fix pid file removal.

	* src/bridge.py (bridge_one_request): Handle ForwardingError
	gracefully.

	* src/bridge.py (SignRpmRequestType.forward_reply_payload): Support
	RSA and v4 signatures.

	* src/double_tls.py (_CombiningBuffer.__receive_inner):
	(_CombiningBuffer.__receive_outer, _InnerBridgingBuffer._receive):
	Handle unexpected connection reset, and poll() that does not provide
	any application-level data.
	(_SplittingBuffer._receive): Don't re-raise the exception on reset
	connection.  Simplify a bit.

	* src/bridge.py (bridge_one_request, main)
	* src/server.py (request_handling_child): Log more useful information
	about NSPRError on RHEL5.

2009-07-18  Miloslav Trmač  <mitr@redhat.com>

	* configure.ac: Release 0.95.
	* NEWS: Update.

	* src/client.py (ClientsConnection.send_inner)
	(ClientsConnection.read_payload)
	(ClientsConnection.write_payload_to_file)
	(ClientsConnection.__read_header)
	* src/server.py (ServersConnection.read_request)
	(ServersConnection.__send_payload)
	(ServersConnection.send_reply_header): Use M2Crypto.EVP.HMAC instead of
	Python's hmac, which uses incorrect block size in RHEL5.
	* src/utils.py (M2CryptoSHA512DigestMod): Remove.

	* src/utils.py (nss_init._password_callback): Be compatible with both
	python-nss 0.1 and 0.4.

2009-07-17  Miloslav Trmač  <mitr@redhat.com>

	* config/server.conf (database-path): Fix the comments.

2009-07-01  Miloslav Trmač  <mitr@redhat.com>

	* configure.ac: Release 0.94.
	* NEWS: Update.

	* README: Note that unmodified python-nss >= 0.4 is required.
	* src/utils.py (nss_init._password_callback): Update for python-nss-0.4.

2009-04-10  Miloslav Trmač  <mitr@redhat.com>

	* configure.ac: Version 0.93.

	* doc/sigul.1.in: Document import-key.
	* README: Document import-key.

	* doc/protocol-design.txt (import-key): New operation.
	* src/client.py (cmd_import_key): New function.
	(command_handlers): Add cmd_import_key.
	* src/errors.py (INVALID_IMPORT, IMPORT_PASSPHRASE_ERROR): New
	definitions.
	(_messages): Update.
	* src/bridge.py (request_types): Add import-key.
	* src/server_common.py (GPGError): New exception class.
	(_restore_gnupg_home, gpg_import_key): New functions.
	(_ChangePasswordResponder): New class.
	(gpg_change_password): New function.
	* src/server.py (random_passphrase): Split from cmd_new_key.
	(cmd_import_key): New function.

	* src/bridge.py: Update to run with newer python-fedora.

	* src/client.py (cmd_grant_key_access): Use read_key_passphrase().

	* src/server.py (cmd_new_key): Remove a redundant check.

2009-01-28  Miloslav Trmač  <mitr@redhat.com>

	* configure.ac: Version 0.92.
	* NEWS: Update.

	* doc/protoocol-design.txt (sign-rpm): Add optional "v3-signature" field.
	* src/client.py (cmd_sign_rpm): Add --v3-signature.
	* src/bridge.py (request_types): Add v3-signature to sign-rpm.
	* src/server.py (cmd_sign_rpm): Handle v3-signature.

	* src/double_tls.py (DoubleTLSClient.__child)
	* src/server.py (request_handling_child): Handle SystemError (raised
	on SIGTERM) without printing a backtrace.

2009-01-12  Miloslav Trmač  <mitr@redhat.com>

	* configure.ac: Version 0.91.
	* NEWS: Update.

2009-01-11  Miloslav Trmač  <mitr@redhat.com>

	* src/utils.py (M2CryptoSHA512DigestMod): New class.
	* src/client.py (ClientsConnection.connect)
	(ClientsConnection.send_inner)
	* src/server.py (ServersConnection.read_request)
	(ServersConnection.read_request): Use M2Crypto.EVP.MessageDigest instead
	of hashlib, which is not supported by Python 2.4.
	* src/client.py (read_password): Read password from stdin, the second
	argument to getpass.getpass() is not supported by Python 2.4.
	* src/server.py (cmd_sign_rpm): Define '_signature gpg', which is
	required by RHEL5 rpm.

	* README: Make it clear when a CA private key is copied, describe how
	to avoid doing so.

	* src/client.py (main): Don't frighten users with exceptions on
	PR_END_OF_FILE_ERROR.
