~ubuntu-branches/ubuntu/lucid/openssh/lucid

« back to all changes in this revision

Viewing changes to monitor_wrap.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2010-01-26 13:07:40 UTC
  • mfrom: (1.13.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20100126130740-d7r70jqrqlbvz3r0
Tags: 1:5.3p1-1ubuntu1
* Resynchronise with Debian.  Remaining changes:
  - Add support for registering ConsoleKit sessions on login.
  - Drop openssh-blacklist and openssh-blacklist-extra to Suggests; they
    take up a lot of CD space, and I suspect that rolling them out in
    security updates has covered most affected systems now.
  - Convert to Upstart.  The init script is still here for the benefit of
    people running sshd in chroots.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $OpenBSD: monitor_wrap.c,v 1.64 2008/11/04 08:22:13 djm Exp $ */
 
1
/* $OpenBSD: monitor_wrap.c,v 1.68 2009/06/22 05:39:28 dtucker Exp $ */
2
2
/*
3
3
 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4
4
 * Copyright 2002 Markus Friedl <markus@openbsd.org>
71
71
#include "atomicio.h"
72
72
#include "monitor_fdpass.h"
73
73
#include "misc.h"
 
74
#include "schnorr.h"
74
75
#include "jpake.h"
75
76
 
76
77
#include "channels.h"
77
78
#include "session.h"
78
79
#include "servconf.h"
 
80
#include "roaming.h"
79
81
 
80
82
/* Imports */
81
83
extern int compat20;
82
 
extern Newkeys *newkeys[];
83
84
extern z_stream incoming_stream;
84
85
extern z_stream outgoing_stream;
85
86
extern struct monitor *pmonitor;
86
 
extern Buffer input, output;
87
87
extern Buffer loginmsg;
88
88
extern ServerOptions options;
89
89
 
526
526
        Enc *enc;
527
527
        Mac *mac;
528
528
        Comp *comp;
529
 
        Newkeys *newkey = newkeys[mode];
 
529
        Newkeys *newkey = (Newkeys *)packet_get_newkeys(mode);
530
530
 
531
531
        debug3("%s: converting %p", __func__, newkey);
532
532
 
588
588
void
589
589
mm_send_keystate(struct monitor *monitor)
590
590
{
591
 
        Buffer m;
 
591
        Buffer m, *input, *output;
592
592
        u_char *blob, *p;
593
593
        u_int bloblen, plen;
594
594
        u_int32_t seqnr, packets;
626
626
        }
627
627
 
628
628
        debug3("%s: Sending new keys: %p %p",
629
 
            __func__, newkeys[MODE_OUT], newkeys[MODE_IN]);
 
629
            __func__, packet_get_newkeys(MODE_OUT),
 
630
            packet_get_newkeys(MODE_IN));
630
631
 
631
632
        /* Keys from Kex */
632
633
        if (!mm_newkeys_to_blob(MODE_OUT, &blob, &bloblen))
673
674
        buffer_put_string(&m, &incoming_stream, sizeof(incoming_stream));
674
675
 
675
676
        /* Network I/O buffers */
676
 
        buffer_put_string(&m, buffer_ptr(&input), buffer_len(&input));
677
 
        buffer_put_string(&m, buffer_ptr(&output), buffer_len(&output));
 
677
        input = (Buffer *)packet_get_input();
 
678
        output = (Buffer *)packet_get_output();
 
679
        buffer_put_string(&m, buffer_ptr(input), buffer_len(input));
 
680
        buffer_put_string(&m, buffer_ptr(output), buffer_len(output));
 
681
 
 
682
        /* Roaming */
 
683
        if (compat20) {
 
684
                buffer_put_int64(&m, get_sent_bytes());
 
685
                buffer_put_int64(&m, get_recv_bytes());
 
686
        }
678
687
 
679
688
        mm_request_send(monitor->m_recvfd, MONITOR_REQ_KEYEXPORT, &m);
680
689
        debug3("%s: Finished sending state", __func__);
1376
1385
}
1377
1386
 
1378
1387
void
1379
 
mm_jpake_step1(struct jpake_group *grp,
 
1388
mm_jpake_step1(struct modp_group *grp,
1380
1389
    u_char **id, u_int *id_len,
1381
1390
    BIGNUM **priv1, BIGNUM **priv2, BIGNUM **g_priv1, BIGNUM **g_priv2,
1382
1391
    u_char **priv1_proof, u_int *priv1_proof_len,
1411
1420
}
1412
1421
 
1413
1422
void
1414
 
mm_jpake_step2(struct jpake_group *grp, BIGNUM *s,
 
1423
mm_jpake_step2(struct modp_group *grp, BIGNUM *s,
1415
1424
    BIGNUM *mypub1, BIGNUM *theirpub1, BIGNUM *theirpub2, BIGNUM *mypriv2,
1416
1425
    const u_char *theirid, u_int theirid_len,
1417
1426
    const u_char *myid, u_int myid_len,
1451
1460
}
1452
1461
 
1453
1462
void
1454
 
mm_jpake_key_confirm(struct jpake_group *grp, BIGNUM *s, BIGNUM *step2_val,
 
1463
mm_jpake_key_confirm(struct modp_group *grp, BIGNUM *s, BIGNUM *step2_val,
1455
1464
    BIGNUM *mypriv2, BIGNUM *mypub1, BIGNUM *mypub2,
1456
1465
    BIGNUM *theirpub1, BIGNUM *theirpub2,
1457
1466
    const u_char *my_id, u_int my_id_len,