2005-07-13  Werner Koch  <wk@g10code.com>

	* Makefile.am (libgsti_la_SOURCES): Include auth.h

	* utils.c (_gsti_algolist_parse): Changed STRING to a plain char*.
	* gsti.h (gsti_channel_read_cb_t, gsti_channel_request_cb_t): Use
	void* for DATA.
	* channel.c (gsti_channel_write): Ditto.
	* buffer.c (gsti_buf_getraw, gsti_buf_putraw): Ditto.
	* stream.c (gsti_stream_writen): Ditto.
	* bstring.c (gsti_bstr_make): Ditto.
	(gsti_bstr_data): Return a void*.

2004-07-20  Marcus Brinkmann  <marcus@g10code.de>

	* gsti.h (gsti_set_readfnc, gsti_read, gsti_write): Prototypes
	removed.
	(gsti_control_cb_t, gsti_pre_ident_cb_t, gsti_packet_handler_t):
	New type definitions.
	(GSTI_CONTROL_FLAG_KEX): New macro.
	(gsti_set_control_cb, gsti_set_pre_ident_cb,
	gsti_set_packet_handler, gsti_start, gsti_push_data): New
	prototypes.
	(gsti_channel_write): Make DATA argument const in prototype.
	* api.h (struct gsti_context): Removed members readfnc, readctx.
	Added new members control_cb, control_cb_value, pre_ident_cb,
	pre_ident_cb_value, user_pkt_handler_cb,
	user_pkt_handler_cb_value, state_info, state_data, state_data_len,
	state_data_alloc, data_handler, packet_handler.
	(fsm_user_read, fsm_user_write): Remove prototypes.
	* fsm.c: Rewritten.
	* auth.c: Include <stdlib.h> and <errno.h>.  Do not include
	"memory.h".  Everwhere pass new extra argument to
	_gsti_packet_write.  Everywhere use standard memory allocation
	routines, and not the gsti wrappers.
	(gsti_auth_free): Fix inverted check for argument.
	* channel.c: Everywhere use _gsti_write_packet_from_buffer instead
	gsti_put_packet.
	(gsti_channel_write): Make DATA argument const.
	* kex.c: Everwhere pass new extra argument to _gsti_packet_write.
	(host_version_string): Add space before comment.
	* main.c (gsti_set_readfnc, gsti_read, gsti_write): Functions
	removed.
	(gsti_set_hostkey): Set CTX->we_are_server.
	(gsti_deinit): Free CTX->state_data.
	* packet.h: Include "buffer.h".
	(_gsti_packet_read): Prototype removed.
	(_gsti_packet_write): Add new argument PKT to prototype.
	(_gsti_handle_packet_data, _gsti_write_packet_from_buffer): New
	prototypes.	
	* packet.c: Include <errno.h>.
	(generate_mac): Accept new argument PKT.  Use it instead of the
	packet in CTX.
	(_gsti_packet_write): Likewise.
	(_gsti_packet_read): Removed function.
	(_gsti_handle_packet_data, _gsti_write_packet_from_buffer,
	gsti_put_packet): New function.
	* pubkey.h (gsti_key_type_t): New type that supercedes the
	anonymous enum.  Change the various int's in the prototypes that
	refer to this enum.
	* pubkey.c: Everywhere, use the new type gsti_key_type_t instead of
	an int if appropriate.
	* ssh.h (SSH_IDENT_MAX_LEN): New macro.
	(ssh_msg_id_t): Add new symbols SSH_MSG_CHANNEL_BEGIN,
	SSH_MSG_CHANNEL_END, SSH_MSG_RESERVED_BEGIN, SSH_MSG_RESERVED_END,
	SSH_MSG_USER_BEGIN and SSH_MSG_USER_END.
	* utils.h: Include <sys/types.h>, "bstring.h" and "memory.h".
	
2004-07-19  Werner Koch  <wk@gnupg.org>

	Some logging cleanups.

	* utils.h: Include gsti.h.  Pass context to _gsti_dump_object.
	* utils.c (_gsti_dump_object): Use log_debug and not log_info. Add
	new CTX arg.  Changed all caller to apss a context.
	(_gsti_print_string): Add arg CTX.  Changed all callers.
	* packet.c (_gsti_packet_read, _gsti_packet_write) 
	(print_disconnect_msg): Reformat messages.  Add new arg CTX.
	(print_debug_msg): Ditto.
	* gsti.h: New log level GSTI_LOG_ERROR.
	* logging.c (_gsti_logv): Implement it.
	(_gsti_log_err): Use it here.  Removed ERR arg and changed all
	callers o ise strerror directly.  This is more straightforward
	than to pass ERR.
	* fsm.c (logrc): Removed and repalced by straight logging calls.

2004-07-15  Werner Koch  <wk@gnupg.org>

	* packet.c (msg_id_to_str): New.
	(_gsti_packet_read, _gsti_packet_write): Use it.

2007-07-14  Timo Schulz  <twoaday@g10code.de>

	* auth.c: Return 'unexpected' and not 'bug' when the packet 
	type is	that the required one.
	(dump_auth_banner): New.
	(build_auth_banner): Insert dummy byte for packet type.
	* fsm.c (fsm_client_loop): For USERAUTH_BANNER use cb type 1.
	
2003-07-13  Timo Schulz  <twoaday@g10code.de>

	* packet.h (MSG_auth_request): s/false/chk_key.
	Changed all callers.
	* auth.c: All authentication functions now have a uniform
	function form.
	(build_auth_banner): New.
	(free_auth_banner): New.
	(parse_auth_banner): New.
	(init_auth_banner): New.
	(_gsti_auth_send_banner_packet): New.
	(_gsti_auth_proc_banner_packet): New.
	* fsm.c (handle_auth_cb): Support for banner messages.
	(fsm_client_loop): Likewise.
	* bstring.c (gsti_bstr_length, gsti_bstr_data): Allow for NULL
	pointers.
	* main.c (gsti_set_auth_banner): New.
	
2004-07-10  Timo Schulz  <twoaday@g10code.de>

	* gsti.h (gsti_auth_cb_t): New.
	* api.h (gsti_context): Added auth callback.
	* main.c (gsti_set_auth_callback): New.
	* fsm.c (fsm_server_loop): Add auth callback to allow external
	checking of the authentication values.
	(fsm_client_loop): Add SSH_MSG_USERAUTH_FAILURE.
	(handle_auth_cb): New.
	* auth.c (gsti_auth_free): Free key blob.
	(_gsti_auth_proc_init_packet): Store keyblob.
	
2004-07-10  Timo Schulz  <twoaday@g10code.de>

	* pubkey.c (gsti_key_fingerprint): Use _gsti_xmalloc.
	* packet.c (_gsti_packet_free): Release pktbuf.
	* kex.c (free_msg_kexdh_reply): New.
	(kex_proc_kexdh_reply): Cleanup in the case of an error.
	(_gsti_kex_proc_gex_group): Likewise.
	* auth.c (auth_send_init_packet): Merged with...
	(auth_send_second_packet): ...this function.
	(read_bstring): Return an error code.
	(auth_proc_second_packet): Merged with...
	(auth_proc_init_packet): ...this function.
	
2004-07-09  Marcus Brinkmann  <marcus@g10code.de>

	* ssh.h (ssh_msg_id_t): Add SSH_MSG_KEX_DH_GEX_REQUEST_OLD.
	Fix SSH_MSG_KEX_DH_GEX_GROUP.

2004-07-08  Timo Schulz  <ts@g10code.de>

	* stream.c (_gsti_stream_writen): Faster random generation.
	* ssh.h: Added size of the cookie.
	* kex.c (kex_proc_kexdh_reply): Swap the kexinit values to
	calculate the right hash.
	(kex_send_init_packet): Store the kexinit values for later use.
	(kex_proc_init_packet): Use the host and the peer list for
	(build_hmac_list): Implemented pre-defined hmac lists.
	algorithm selection.
	* types.h (STRLIST): Renamed to...
	(gsti_strlist_t): ...this.
	* gsti.h: Use gcrypt digest constants.
	
2004-07-08  Timo Schulz  <ts@g10code.de>

	* fsm.c (fsm_server_loop): Return invalid packet if
	an unexpected packet was received.
	* kex.c (_gsti_kex_check_alglist): New.
	(kex_check_algo): New.
	(build_cipher_list): Support to use a pre-defined cipher list.
	* gsti.h: Use gcrypt cipher constants.
	* main.c (gsti_set_dhgex): Set default values if one argument
	is zero.
	(gsti_set_kex_prefs): New.
	* api.h (gsti_ctx_t): Use ushort for the prefs since some
	cipher id's are > 256 and thus larger than a byte.
	
2004-07-07  Timo Schulz  <ts@g10code.de>

	* keyblob.c: Removed from the repository.
	* keyblob.h: Likewise.
	
2004-07-07  Timo Schulz  <ts@g10code.de>

	* kex.c (check_dh_mpi_range): Add DH group support.
	Prefixed all gex functions with _gsti_.
	(parse_msg_kexdh_init): Likewise.
	(parse_msg_kexdh_reply): Likewise.
	(build_kex_list): Likewise.
	* fsm.c (fsm_client_loop): Change order of DH group exchange.
	
2004-07-06  Timo Schulz  <twoaday@g10code.de>

	* pubkey.c (_gsti_key_fromblob): Return an error for
	unknown pubkey algos and not a bug.
	* fsm.c (fsm_server_loop): Implement DH group exchange.
	* main.c (_gsti_kex_free): New.
	* kex.c (build_msg_kexdh_reply): Likewise.
	(build_msg_kexinit): Likewise.
	(hash_32bit): New.
	(kex_proc_gex_group): Store DH group values.
	(kex_send_gex_group): Likewise.
	(calc_dh_key): Support DH group exchange.
	(calc_dh_secret): Likewise.
	* auth.c (check_auth_id): Use the length of the table string.
	
2004-07-05  Timo Schulz  <twoaday@freakmail.de>

	* packet.c (_gsti_packet_write): Use gcry_create_nonce to
	make random generation faster.
	
2004-07-02  Werner Koch  <wk@gnupg.org>

	* main.c (gsti_get_hostkey): New.

2004-07-01  Werner Koch  <wk@gnupg.org>

	* main.c (gsti_set_client_key): Release an existing key.
	(gsti_set_client_key_blob): New.

	* pubkey.c (pk_table): Swapped RSA parameters; E comes first.
	(_gsti_rsa_sign, _gsti_rsa_verify): Adapt for it.
	(_gsti_rsa_sign, _gsti_dss_sign): Check number of parameters and
	support a sign callback.
	* pubkey.h (struct gsti_key_s): Add members SIGN_FNC and
	SIGN_FNC_VALUE.

2004-06-30  Timo Schulz  <twoaday@g10code.de>

	* pubkey.c: s/nkey/npkey for the pubkey table.
	(read_pk_algo): Iterate over the pubkey table.
	(pkalgo_get_nkey): Renamed to...
	(pkalgo_get_npkey): ... this. Changed all callers.
	(_gsti_sig_decode): Set p to NULL to avoid double free.
	(_gsti_sig_encode): Release p in case of an error.
	(_gsti_ssh_get_pkname): Return error code and not the buffer.
	* main.c (gsti_get_auth_key): Return NULL for an invalid ctx.
	

2004-06-30  Marcus Brinkmann  <marcus@g10code.de>

	* gsti.h (gsti_get_auth_key): Add prototype.
	* main.c (gsti_get_auth_key): New function.
	
	* gsti.h (gsti_channel_close): Add prototype.

2004-06-29  Marcus Brinkmann  <marcus@g10code.de>

	* channel.c (ssh_msg_channel_open_confirmation_S): Only invoke
	CHANNEL->win_adj_cb if not NULL.
	(ssh_msg_channel_window_adjust_S): Likewise.
	(ssh_msg_channel_close_S): Only invoke CHANNEL->close_cb if not NULL.

2004-06-29  Timo Schulz  <twoaday@freakmail.de>

	* kex.c (select_dh_modulus): Add missing break keywords.
	(check_dh_mpi_range): New.
	(parse_msg_kexdh_init): Check range of returned MPI.
	(parse_msg_kexdh_reply): Likewise.
	
2004-06-29  Werner Koch  <wk@gnupg.org>

	* fsm.c (state_to_string): New.
	(fsm_server_loop, fsm_client_loop): Use it here.
	* utils.h (STR,STR2): New macros.
	* packet.c (_gsti_packet_read): Do not dump the entire packet.
	* logging.c (_gsti_logv): Prepend the lines with "gsti: ";
	(_gsti_log_cont): New.
	(_gsti_logv): Support GSTI_LOG_CONT.
	* gsti.h (gsti_log_level_t): Add GSTI_LOG_CONT.
	* utils.c (_gsti_print_string, _gsti_dump_object): Use it here.
	(_gsti_print_string): Quote everything except plain ascii.

2004-06-29  Marcus Brinkmann  <marcus@g10code.de>

	* gsti.h (gsti_channel_eof): New prototype.
	(gsti_channel_eof_cb_t): New type definition.
	(gsti_channel_open): Add new EOF callback arguments.
	(gsti_channel_open_cb_t): Likewise.
	* channel.c: Add new EOF callback arguments where missing.
	(ssh_msg_channel_eof_S): New function.
	(gsti_channel_write): Check CHANNEL->eof.
	(ssh_msg_channel_eof): New function.
	(ssh_msg_channel_eof_t): New type.
	(gsti_channel_eof): New function.
	(struct gsti_channel): Add new EOF callback members.
	(ssh_msg_channel_close): New function.
	(ssh_msg_channel_close_t): New type.
	(ssh_msg_channel_close_S): New function.
	(_gsti_handle_channel_packet): Handle SSH_MSG_CHANNEL_EOF and
	SSH_MSG_CHANNEL_CLOSE.

2004-06-21  Timo Schulz  <twoaday@g10code.de>

	* ssh.h: Add SSH Group Exchange constants.
	* kex.c (build_kex_list): Use new SSH constants.
	(build_pkalgo_list): Add SSH_RSA.
	* auth.h: New file.
	* api.h: Move _auth prototypes to ...
	* auth.h: ... this file.
	Global table to store valid auth methods.
	(check_auth_id): Iterate over the auth table.
	* fsm.c (fsm_server_loop): Send SSH auth failure packet.
	* packet.c (_gsti_packet_write): Make sure the seq-no does
	not cause an overflow.
	
2004-06-14  Timo Schulz  <twoaday@g10code.de>

	* stream.c (_gsti_read_new_stream): Return error code
        and not the context itself. Changed all callers.
        (_gsti_write_new_stream): Likewise.

	* auth.c (parse_auth_request): Handle possible errors.
        (calc_sig_hash): Likewise.
        (auth_send_failure_packet): New.

	* pubkey.c (_gsti_key_getblob): Return 'No Seckey' if
        the key context is invalid.

	* kex.c (wait_on_version): Handle possible errors.
        (calc_exchange_hash): Likewise.
        (construct_one_key): Likewise.
        (kex_proc_init_packet): Likewise.
	* packet.c (_gsti_packet_read): Ditto.
	
2004-06-14  Werner Koch  <wk@gnupg.org>

	* api.h (_gsti_handle_channel_packet): Include prototype.

	* main.c: Don't include moduli.h.  Include kex.h.
	(init_gex_default, gsti_init): Removed and changed to ..
	* kex.c (_gsti_kex_set_defaults): .. new function.

2004-06-09  Marcus Brinkmann  <marcus@g10code.de>

	* types.h (gsti_byte_t, gsti_uint32_t): Move to ...
	* gsti.h (gsti_byte_t, gsti_uint32_t): ... here.
	* api.h (struct gsti_context): New members channel_types,
	channels, nr_channels, max_channels.
	* gsti.h (gsti_channel_read_cb_t, gsti_channel_request_cb_t,
	gsti_win_adj_cb_t, gsti_channel_close_cb_t,
	gsti_channel_open_cb_t, gsti_channel_open_result_cb_t): New types.
	(gsti_channel_open, gsti_channel_get_window_size,
	gsti_channel_get_max_packet_size,
	gsti_channel_get_rec_max_packet_size,
	gsti_channel_get_rec_window_size, gsti_channel_write,
	gsti_channel_window_adjust, gsti_channel_add_type): New prototypes.
	* channel.c: New file.
	* Makefile.am (libgsti_la_SOURCES): Add channel.c.
	* fsm.c (fsm_server_loop): Call _gsti_handle_channel_packet.
	
	* buffer.c (gsti_buf_putbstr): Remove check for BSTR.

	* stream.c (_gsti_stream_readn): Return EOF if EOF is encountered
	without any other error.

	* packet.h: Include "types.h".

2004-06-09  Timo Schulz  <twoaday@g10code.de>

	* pubkey.c (read_bstring): Add error handling.
	(check_pubalgo): Additional parameter to support bstrings.
	(pktype_from_file): Use check_pubalgo to figure out the algid.
	
	(_gsti_key_getblob): Return error code and not the context.
	Changed all callers.
	(_gsti_key_fromblob): Likewise.
	(_gsti_sig_encode): Likewise.
	(gsti_key_fingerprint): Likewise.

	* auth.c (init_auth_request): Error handling.
	(auth_send_pkok_packet): Likewise.
	
2004-06-09  Marcus Brinkmann  <marcus@g10code.de>

	Global: All users of bstring and buffer related types and
	functions have changed.
	
	* Makefile.am (libgsti_la_SOURCES): Add bstring.h, bstring.c.
	* bstring.h: New file.
	* bstring.c: New file.
	* memory.h (_gsti_bstring_make, _gsti_bstring_free): Remove prototypes.
	* memory.c (_gsti_bstring_make, _gsti_bstring_free): Remove functions.
	* types.h: Include "bstring.h".
	(bstring_s, BUFFER): Remove types.
	(gsti_byte_t, gsti_uint32_t): New types.
	* buffer.h: Rewritten.
	* buffer.c: Rewritten.

	* Makefile.am (libgsti_la_SOURCES): Add ssh.h.
	* ssh.h: New file.
	* packet.h: Include "ssh.h".
	(enum SSH_MSG_*): Removed enum.
	(enum SSH_DISCONNECT_*): Removed enum.
	* kex.c (host_version_string): Use SSH_IDENT_PREFIX.
	(kex_wait_on_version): Remove variable initstr.  Rewrite parsing
	of SSH_IDENT_PREFIX.  Fix inverted error return value (NO_DATA
	vs. PROTOCOL_VIOLATION).
	(build_compress_list): Use SSH_COMPRESSION_NONE and
	SSH_COMPRESSION_ZLIB.
	(hmac_list): Use SSH_MAC_HMAC_SHA1, SSH_MAC_HMAC_SHA1_96,
	SSH_MAC_HMAC_MD5, and SSH_MAC_HMAC_MD5_96.
	(cipher_list): Use SSH_CIPHER_3DES_CBC, SSH_CIPHER_BLOWFISH_CBC,
	SSH_CIPHER_CAST128_CBC, SSH_CIPHER_TWOFISH256_CBC, and
	SSH_CIPHER_AES128_CBC.
	(build_kex_list): Use SSH_KEX_DHG1_SHA1.
	(build_pkalgo_list): Use SSH_PKA_SSH_DSS.
	* auth.c (check_auth_id): Use SSH_AUTH_PUBLICKEY.
	(init_auth_request): Likewise.

2004-06-07  Timo Schulz  <twoaday@g10code.de>

	* gsti.h (GSTI_PKTDESC): Rename type to ...
	(gsti_pktdesc_t): .. this.

	* api.h (gsti_kex_t): New.
	* kex.c (choose_kex_algo): Support new ctx.
	(build_msg_service): Remove goto.
	(parse_gex_group): Likewise.

	* pubkey.c (read_key): Remove the secure mpi code.
	(check_pubalgo): Return optional the algorithm id.

	* stream.c (_gsti_stream_flush): Store the return code
	in case of an error.
	(_gsti_stream_getbyte): Likewise.
	(_gsti_stream_putbyte): Likewise.
	(_gsti_stream_writen, _gsti_stream_readn): Return the
	stored return value in case of an error.
	
2004-06-06  Timo Schulz  <twoaday@g10code.de>

	* auth.c (gsti_auth_new): New.
	(gsti_auth_free): New.

	Changed some structure names to the foo_t format.

	* main.c (gsti_set_readfnc): Support new callback implementation.
	(gsti_set_writefnc): Likewise.

	* gsti.h (gsti_read_fnc_t, gsti_write_fnc_t): Changed prototypes.
	* stream.c: Likewise.
	
2004-06-02  Timo Schulz  <twoaday@g10code.de>

	* pubkey.c (gsti_key_save): New.
	(_gsti_key_fromblob): RSA support.
	(_gsti_rsa_sign, _gsti_rsa_verify): Likewise.
	
2004-06-01  Timo Schulz  <twoaday@g10code.de>

	* pubkey.c (sexp_from_buffer): PKCS#1 support.
	Changed all callers.

	(sexp_get_sshmpi): Use SSH_PK_LAST to check for invalid
	pubkey algorithm ids.

	(gsti_key_from_sexp): New. Create a gsti key handle based
	on a s-exp struct created by Libgcrypt.

	* Add nskey to the pubkey table structure.
	
2004-05-28  Timo Schulz  <twoaday@freakmail.de>

	* pubkey.c (gsti_key_load): Open file in binary mode.

	* pubkey.h: Removed unused prototypes.
	
2004-05-28  Timo Schulz  <twoaday@freakmail.de>

	* pubkey.c: Change GSTI_KEY to gsti_key_t and some
	cleanups.
	
2004-05-27  Timo Schulz  <twoaday@freakmail.de>
	
	* pubkey.c (_gsti_sig_decode): separate the MPI values, the
	new Libgcrypt interface does not support the old way.
                                                                               
2004-05-26  Marcus Brinkmann  <marcus@g10code.de>

	* gsti.h (GSTIHD): Rename type to ...
	(gsti_ctx_t): ... this.

	Everywhere: Change GSTIHD hd to gsti_ctx_t ctx.

2004-05-25  Marcus Brinkmann  <marcus@g10code.de>

	Everywhere: Change various "int rc" variables to "gsti_error_t err",
	and related changes.

	* gsti.h: Include <gpg-error.h>.
	(_GSTI_INLINE): New macro.
	(gsti_error_t, gsti_err_code_t, gsti_err_source_t): New types.
	(GSTI_ERR_SOURCE_DEFAULT): New macro.
	(gsti_err_make, gsti_error, gsti_err_code, gsti_err_source): New
	inline functions.
	(gsti_strerror, gsti_strerror_r, gsti_strsource,
	gsti_err_code_from_errno, gsti_err_code_to_errno,
	gsti_err_make_from_errno, gsti_error_from_errno): New prototypes.
	* error.c: New file.
	* Makefile.am (libgsti_la_SOURCES): Add error.c.
	* main.c (gsti_strerror): Removed.
	* auth.h (auth_send_accept_packet, auth_proc_accept_packet,
	auth_send_init_packet, auth_proc_init_packet,
	auth_send_pkok_packet, parse_pkok_packet, auth_proc_pkok_packet,
	auth_send_second_packet, auth_proc_second_packet): Change return
	type to gsti_error_t.
	* auth.c (auth_send_accept_packet, auth_proc_accept_packet,
	auth_send_init_packet, calc_sig_hash, auth_proc_init_packet,
	parse_auth_request, build_auth_request, init_auth_request,
	build_pkok_packet, auth_send_pkok_packet, parse_pkok_packet,
	auth_proc_pkok_packet, auth_send_second_packet,
	auth_proc_second_packet): Change return type to gsti_error_t.
	* buffer.h (_gsti_buf_putmpi, _gsti_buf_getmpi): Change return
	type to gsti_error_t in prototype.
	* buffer.c (_gsti_buf_putmpi, _gsti_buf_getmpi): Change return
	type to gsti_error_t.
	* api.h (map_gcry_rc): Removed prototype.
	(fsm_user_read, fsm_user_write): Change return type to
	gsti_error_t in prototype.
	* fsm.c (fsm_user_read, fsm_user_write, gsti_get_packet, fsm_loop,
	fsm_server_loop, fsm_client_loop, request_packet, handle_quit,
	handle_init): Change return type to gsti_error_t.
	* gsti.h (gsti_set_log_stream): Change return type to gsti_error_t
	in prototype.
	(gsti_deinit): Change return type to void in prototype.
	(gsti_set_readfnc, gsti_set_writefnc, gsti_set_service,
	gsti_set_hostkey, gsti_set_client_key, gsti_set_client_user,
	gsti_set_auth_method, gsti_set_compression, gsti_set_dhgex,
	gsti_read, gsti_write, gsti_key_load, gsti_get_packet,
	gsti_put_packet): Change return type to gsti_error_t in prototype.
	* main.c (gsti_deinit): Change return type to void.
	(gsti_set_readfnc, gsti_set_writefnc, gsti_set_service,
	gsti_set_hostkey, gsti_set_client_key, gsti_set_client_user,
	gsti_set_auth_method, gsti_set_compression, gsti_set_dhgex,
	gsti_read, gsti_write): Change return type to gsti_error_t.
	(map_gcry_rc): Removed.
	* logging.c (gsti_set_log_stream): Change return type to
	gsti_error_t.
	* pubkey.h (_gsti_dss_sign, _gsti_dss_verify,
	_gsti_ssh_cmp_pkname, _gsti_ssh_cmp_keys, _gsti_sig_decode):
	Change return type to gsti_error_t in prototype.
	* pubkey.c: Include <errno.h>.
	(gsti_key_load, parse_key_entry, read_dss_key, read_bstring,
	sexp_get_sshmpi, sexp_from_buffer, _gsti_dss_sign,
	_gsti_dss_verify, _gsti_ssh_cmp_pkname, _gsti_ssh_cmp_keys,
	_gsti_sig_decode): Change return type to gsti_error_t.
	* stream.h (_gsti_stream_readn, _gsti_stream_writen,
	_gsti_stream_flush): Change return type to gsti_error_t in
	prototype.
	* stream.c (_gsti_stream_readn, _gsti_stream_writen,
	_gsti_stream_flush): Change return type to gsti_error_t.
	* kex.h (kex_send_version, kex_wait_on_version,
	kex_send_init_packet, kex_proc_init_packet, kex_send_kexdh_init,
	kex_proc_kexdh_init, kex_send_kexdh_reply, kex_proc_kexdh_reply,
	kex_send_newkeys, kex_proc_newkeys, kex_send_disconnect,
	kex_send_service_request, kex_proc_service_request,
	kex_send_service_accept, kex_proc_service_accept,
	kex_send_gex_request, kex_proc_gex_request, kex_send_gex_group,
	kex_proc_gex_group): Change return type to gsti_error_t in
	prototype.
	* kex.c (kex_send_version, kex_wait_on_version, parse_msg_kexinit,
	build_msg_kexinit, parse_msg_kexdh_init, build_msg_kexdh_init,
	parse_msg_kexdh_reply, build_msg_kexdh_reply, calc_exchange_hash,
	construct_keys, kex_send_init_packet, choose_mac_algo,
	choose_cipher_algo, choose_kex_algo, kex_proc_init_packet,
	kex_send_kexdh_init, kex_proc_kexdh_init, kex_send_kexdh_reply,
	kex_proc_kexdh_reply, kex_send_newkeys, kex_proc_newkeys,
	kex_send_disconnect, parse_msg_service, build_msg_service,
	kex_send_service_request, kex_proc_service_request,
	kex_send_service_accept, kex_proc_service_accept,
	build_gex_request, kex_send_gex_request, parse_gex_request,
	kex_proc_gex_request, build_gex_group, kex_send_gex_group,
	parse_gex_group, kex_proc_gex_group): Change return type to
	gsti_error_t.
	* packet.h (_gsti_packet_read, _gsti_packet_write,
	_gsti_packet_flush): Change return type to gsti_error_t in
	prototype.
	* packet.c (verify_mac, _gsti_packet_read, _gsti_packet_write,
	_gsti_packet_flush): Change return type to gsti_error_t.

2004-05-24  Marcus Brinkmann  <marcus@g10code.de>

	Everywhere: Pass context to invocation of _gsti_log_info and friends.
	Change _gsti_log_rc to _gsti_log_err.
	
	* gsti.h (gsti_log_level_t): New type, using the existing enum for
	GSTI_LOG_* symbols.  Add symbol GSTI_LOG_MAX.  Change the values
	of GSTI_LOG_INFO and GSTI_LOG_DEBUG to make room for insertions.
	(GSTI_LOG_FNC): Rename to ...
	(gsti_log_cb_t): ... this.  Add new argument CTX, change type of
	log level argument.
	(gsti_set_log_handler): Removed.
	(gsti_set_log_stream): New prototype.
	(gsti_set_log_level): Add new argument CTX.
	* utils.h (_gsti_log_rc, _gsti_log_info, _gsti_log_debug): Add
	argument CTX to prototype.
	(_gsti_get_log_level): Prototype removed.
	* api.h (struct gsti_context): New members LOG_CB, LOG_CB_HOOK,
	and LOG_LEVEL.
	* main.c (log_handler, log_handler_value, log_level,
	_gsti_get_log_level): Removed.
	(_gsti_logv, _gsti_log_rc, _gsti_log_info, _gsti_log_debug,
	gsti_set_log_level): Moved to ...
	* logging.c: ... this new file.
	* Makefile.am (libgsti_la_SOURCES): Add logging.c.

2004-03-08  Werner Koch  <wk@gnupg.org>

        Changed indentation to GNU style.
	
2004-03-08  Werner Koch  <wk@gnupg.org>

	* main.c (map_gcry_rc): Shortcut code as we are now using
	gpg-error.h anyway.

	* Makefile.am: Modernized.  Use --version-info.
	(libgsti_la_SOURCES): Added pubkey.h.

	* gsti-config.in: Modernized.

        Fixed all copyright entries from "Free Software Foundation, Inc"
	to "Werner Koch".  It was originally intended to assign the code
	to the FSF but this actually never happened and frankly there has
	been no real release as the code lived his life for most time
	merely as a test bed for libgcrypt.
	
	* ChangeLog: Merged my entries from 2000.  Obviously I forgot to
	commit the Changelog to the CVS when moving the files from the
	local PRCS repository to CVS.

2002-10-05  Timo Schulz  <ts@winpt.org>

	* kex.c (kex_send_init_packet): Fixed memory leak.
	* main.c (gsti_deinit): Free auth struct.
	(gsti_set_client_key): New.
	(gsti_set_client_user): New.
	(gsti_set_auth_method): New.
	(_gsti_free_auth): New.
	* api.h: Added auth struct to the GSTI struct.
	* auth.c (auth_send_init_packet): New.
	(auth_proc_init_packet): New.
	(auth_send_accept_packet): New.
	(auth_proc_accept_packet): New.
	(auth_send_second_packet): New.
	(auth_proc_second_packet): New.
	* utils.c (_gsti_bstring_hash): Moved from kex.c and
	renamed from hash_bstring. Now it's global.
	
2002-10-06  Timo Schulz  <ts@winpt.org>

	* fsm.c (fsm_server_loop): New.
	(fsm_client_loop): New.
	(new_state): Removed. The code is now in the functions above.
	(fsm_loop): Now we use separate loops.
	* auth.c (auth_send_accept_packet): Flush the packet.
	(auth_send_init_packet): Ditto.
	(auth_send_second_packet): Ditto.

2002-10-06  Timo Schulz  <ts@winpt.org>
	* auth.c (auth_send_pkok_packet): New.
	(auth_proc_pkok_packet): New.
	* fsm.c (fsm_server_loop): Send the SSH_MSG_USERAUTH_PK_OK and
	not the SSH_MSG_USERAUTH_SUCCESS twice.
	(fsm_client_loop): Proc the new packets.
	(pubkey.h): Prefix key context with gsti_.
	
2002-10-07  Timo Schulz  <ts@winpt.org>

	* pubkey.c (read_dss_key): Store 'x' in secure memory.
	* auth.c (parse_pkok_packet): New.
	(auth_proc_pkok_packet): Use it here.
	Check the data returned by the server.
	* pubkey.c (_gsti_ssh_cmp_keys): New.
	(_gsti_ssh_cmp_pkname): New.
	* zlib.c: New. Taken from PuTTY. It's a MIT style license
	and so it's compatible with the GPL. 
	But we don't use compression by default.
	* utils.h: Provide zlib prototypes or dummies.
	* main.c (gsti_set_compression): New.
	* kex.c (build_compress_list): New.
	(kex_send_init_packet): Use it here.
	
2002-10-08  Timo Schulz  <ts@winpt.org>

	* utils.c (_gsti_dump_object): Use the logging stuff and
	not fprintf. Support to dump BUFFER's.
	(_gsti_print_string): Removed the FILE* argument.
	Changed all callers.
	* buffer.c (_gsti_buf_putbstr): New.
	* auth.c: Changed all _gsti_buf_putstr to _gsti_buf_putbstr.
	* kex.c: Likewise.
	* api.h: Created zlib struct inside GSTI handle.
	* memory.c (_gsti_xmalloc): Implemented common xfoo memory
	wrapper so they fail when there is a memory problem.
	(_gsti_xrealloc): Ditto.
	(_gsti_xcalloc): Ditto.
	(_gsti_xstrdup): Ditto.
	
2002-10-19  Timo Schulz  <ts@winpt.org>

	* pubkey.c (pktype_from_file): New.
	(gsti_key_load): Use it here and remove the pktype param.
	* packet.c (print_debug_msg): Free buffer.
	* moduli.h: New. Contains various modulus values for the
	DH group exchange method.
	
	
2002-10-19  Timo Schulz  <ts@winpt.org>

	* packet.h: Added DH group numbers.
	* kex.c (build_gex_request): New.
	(kex_send_gex_request): New.
	(parse_gex_request): New.
	(kex_proc_gex_request): New.
	(select_dh_modulus): New.
	(choose_dh_size): New.
	(kex_send_gex_group): New.
	
2002-10-20  Timo Schulz  <ts@winpt.org>

	* api.h: Use a BUFFER to read from the payload.
	* kex.c (parse_xxx): Use a BUFFER as the input.
	Changed all callers.
	(build_kex_list): New.
	(build_pkalgo_list): New.
	(choose_kex_algo): New.
	* auth.c (parse_xxx): Some as kex.c
	* main.c (init_gex_default): New.
	(gsti_init): Use it here.
	
2000-10-10  Werner Koch  <wk@gnupg.org>

	* api.h (gsti_context): Replaced *mac_{inner,outer}_hd by *mac_hd.
	* kex.c (prepare_mac): Changed to use the libgcrypt function,
	changed args and adjusted all callers.
	(prepare_hmac_pad): Removed.
	* packet.c (generate_mac, verify_mac): Use libgcrypt function.
	
	