Commit 9f39299d authored by Niels Möller's avatar Niels Möller
Browse files

*** empty log message ***

Rev: ChangeLog:1.182
Rev: src/rsa.c:1.2
Rev: src/server_pty.c:1.15
Rev: src/server_session.h:1.9
parent 309b1d2b
2000-04-19 Niels Mller <nisse@cuckoo.localdomain>
* src/xalloc.h [DEBUG_ALLOC] (CHECK_TYPE, CHECK_SUBTYPE): Return
the object pointer. Needed by CLONE()
* src/userauth.h (lsh_user): Added tty-argument to the fork
method.
* src/unix_user.c (do_fork_process): Call logwtmp. For now, the
host-name is bogus.
* src/server_session.c (do_kill_process): Call logout(), to update
wtmp.
(spawn_process): Construct tty name for utmp/wtmp logging.
(lsh_basename): New function.
* src/lsh.c, src/lshd.c, src/lsh_proxy.c: Improved default
behaviour if no --port argument is given.
* src/io_commands.c (do_listen, do_listen_connection, do_connect):
IPv6 support.
* src/io.c (get_inaddr): Removed.
(tcp_addr): Likewise.
(make_address_info_c): Added an extra argument used as fallback if
service lookup fails.
(sockaddr2info): IPv6 support.
(address_info2sockaddr): Rewrote, to handle IPv6 and to allocate
the returned sockaddr structure dynamically.
* src/connection.h (ssh_connection): Added peer attribute,
currently unused.
* src/atoms.in: Added rsa-related atoms.
* configure.in: Replaced many calls to AC_ARG_WITH with
AC_ARG_ENABLE. Added --disable-ipv6 and --disable-utmp flags.
* acconfig.h: Added WITH_IPV6 and WITH_UTMP.
2000-04-18 Niels Mller <nisse@cuckoo.localdomain>
* src/io_commands.c (do_listen_continue): Use make_listen_value().
2000-04-17 Niels Mller <nisse@cuckoo.localdomain>
* src/publickey_crypto.h (make_rsa_algorithm): Added prototype.
* src/io.c (io_iter): Use #ifdef:s around tests for POLLNVAL,
POLLPRI and POLLHUP.
* configure.in: Bumped version to 0.9.6.
2000-04-16 Niels Mller <nisse@cuckoo.localdomain>
......
......@@ -53,10 +53,6 @@
(prefix . "const UINT8 *")))
*/
#define STATIC_RSA_ALGORITHM(a, l, id) \
{ { STATIC_HEADER, make_rsa_signer, make_rsa_verifier }, \
a, l, id }
static void
pkcs_1_encode(mpz_t m,
struct rsa_algorithm *params,
......@@ -66,7 +62,6 @@ pkcs_1_encode(mpz_t m,
{
UINT8 *em = alloca(length);
unsigned i = length;
unsigned pad;
struct hash_instance *h = MAKE_HASH(params->hash);
HASH_UPDATE(h, msg_length, msg);
......@@ -174,20 +169,20 @@ do_rsa_sign(struct signer *s,
UINT8 *msg)
{
CAST(rsa_signer, self, s);
struct lsh_string *s;
struct lsh_string *res;
mpz_t m;
mpz_init(m);
pkcs_1_encode(m, self->params, self->public->size - 1,
pkcs_1_encode(m, self->public.params, self->public.size - 1,
msg_length, msg);
/* FIXME: Optimize using CRT */
mpz_powm(m, m, self->d, self->public->m);
mpz_powm(m, m, self->d, self->public.n);
s = ssh_format("%lun", m);
res = ssh_format("%lun", m);
mpz_clear(m);
return s;
return res;
}
static struct sexp *
......@@ -213,13 +208,13 @@ do_rsa_public_key(struct signer *s)
}
static int
do_rsa_verify(struct verifier *s,
do_rsa_verify(struct verifier *v,
UINT32 length,
UINT8 *msg,
UINT32 signature_length,
UINT8 * signature_data)
{
CAST(rsa_verifier, self, s);
CAST(rsa_verifier, self, v);
mpz_t m;
mpz_t s;
int res;
......@@ -230,7 +225,7 @@ do_rsa_verify(struct verifier *s,
mpz_init(s);
bignum_parse_u(s, signature_length, signature_data);
if (mpz_cmp_u(s, self->public.n) >= 0)
if (mpz_cmp(s, self->public.n) >= 0)
{
mpz_clear(s);
return 0;
......@@ -239,7 +234,7 @@ do_rsa_verify(struct verifier *s,
mpz_powm(s, s, self->public.e, self->public.n);
mpz_init(m);
pkcs_1_encode(m, self->public->params, self->public->size,
pkcs_1_encode(m, self->public.params, self->public.size - 1,
length, msg);
res = !mpz_cmp(m, s);
......@@ -262,12 +257,12 @@ make_rsa_signer(struct signature_algorithm *s,
struct sexp_iterator *i)
{
CAST(rsa_algorithm, params, s);
NEW(rsa_verifier, res);
NEW(rsa_signer, res);
init_rsa_public(&res->public, params);
if ( (SEXP_LEFT(i) >= 3)
&& spki_init_rsa_public(&res->public, i)
&& sexp_get_un(i, ATOM_d, res->d) )
&& sexp_get_un(i, ATOM_D, res->d) )
{
res->super.sign = do_rsa_sign;
res->super.sign_spki = do_rsa_sign_spki;
......@@ -313,11 +308,17 @@ make_rsa_algorithm(struct hash_algorithm *hash,
self->super.make_signer = make_rsa_signer;
self->super.make_verifier = make_rsa_verifier;
self->hash = hash;
self->hashid = hashid;
self->prefix_length = prefix_length;
self->prefix = prefix;
return &self->super;
}
#define STATIC_RSA_ALGORITHM(a, l, id) \
{ { STATIC_HEADER, make_rsa_signer, make_rsa_verifier }, \
(a), (l), (id) }
/* From pkcs-1v2
*
* md5 OBJECT IDENTIFIER ::=
......@@ -341,7 +342,7 @@ static const UINT8 md5_prefix[] =
};
struct rsa_algorithm rsa_md5_algorithm =
STATIC_RSA_ALGORITHM(&md5_algorithm, md5_prefix, 18);
STATIC_RSA_ALGORITHM(&md5_algorithm, 18, md5_prefix);
/* From pkcs-1v2
*
......@@ -365,6 +366,6 @@ static const UINT8 sha1_prefix[] =
/* Here comes the raw hash value */
};
strust rsa_algorithm rsa_sha1_algorithm =
STATIC_RSA_ALGORITHM(&sha1_algorithm, sha1_prefix, 15);
struct rsa_algorithm rsa_sha1_algorithm =
STATIC_RSA_ALGORITHM(&sha1_algorithm, 15, sha1_prefix);
......@@ -76,8 +76,8 @@ struct pty_info *make_pty_info(void)
pty->super.alive = 0;
pty->super.kill = do_kill_pty_info;
pty->tty_name = NULL; /* Perhaps not needed; Cleared by NEW() */
/* pty->tty_name = NULL; */ /* Cleared by NEW() */
return pty;
}
......@@ -140,7 +140,8 @@ static int pty_check_permissions(const char *name, uid_t user)
/* Returns the name of the slave tty, as a string with an extra
* terminating NUL. */
static struct lsh_string *pty_grantpt_uid(int master, uid_t user)
static struct lsh_string *
pty_grantpt_uid(int master, uid_t user)
{
uid_t me = getuid();
if (me == user)
......
......@@ -59,7 +59,7 @@ struct lsh_string *
format_exit(struct ssh_channel *channel, int value);
struct resource *
make_process_resource(pid_t pid, int signal);
make_process_resource(pid_t pid, struct lsh_string *tty, int signal);
struct channel_request *
make_pty_handler(void);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment