Diff

Differences From Artifact [6f46237dae]:

To Artifact [39a3bc1033]:


603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
603
604
605
606
607
608
609






610
611
612
613
614
615
616







-
-
-
-
-
-







    for (st->i = st->len = 0; st->i < 4; st->i++) {
	while ((*datalen) == 0)
	    crReturn(4 - st->i);
	st->len = (st->len << 8) + **data;
	(*data)++, (*datalen)--;
    }

#ifdef FWHACK
    if (st->len == 0x52656d6f) {       /* "Remo"te server has closed ... */
	st->len = 0x300;	       /* big enough to carry to end */
    }
#endif

    st->pad = 8 - (st->len % 8);
    st->biglen = st->len + st->pad;
    pktin.length = st->len - 5;

    if (pktin.maxlen < st->biglen) {
	pktin.maxlen = st->biglen;
	pktin.data = (pktin.data == NULL ? smalloc(st->biglen + APIEXTRA) :
766
767
768
769
770
771
772
773
774
775
776

777
778
779
780
781
782
783
784
760
761
762
763
764
765
766




767

768
769
770
771
772
773
774







-
-
-
-
+
-







     */
    for (st->i = st->len = 0; st->i < st->cipherblk; st->i++) {
	while ((*datalen) == 0)
	    crReturn(st->cipherblk - st->i);
	pktin.data[st->i] = *(*data)++;
	(*datalen)--;
    }
#ifdef FWHACK
    if (!memcmp(pktin.data, "Remo", 4)) {	/* "Remo"te server has closed ... */
	/* FIXME */
    }

#endif
    if (sccipher)
	sccipher->decrypt(pktin.data, st->cipherblk);

    /*
     * Now get the length and padding figures.
     */
    st->len = GET_32BIT(pktin.data);
3001
3002
3003
3004
3005
3006
3007









3008
3009
3010
3011
3012
3013
3014
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013







+
+
+
+
+
+
+
+
+







	    } else if (pktin.type == SSH1_SMSG_SUCCESS) {
		/* may be from EXEC_SHELL on some servers */
	    } else if (pktin.type == SSH1_SMSG_FAILURE) {
		/* may be from EXEC_SHELL on some servers
		 * if no pty is available or in other odd cases. Ignore */
	    } else if (pktin.type == SSH1_SMSG_EXIT_STATUS) {
		send_packet(SSH1_CMSG_EXIT_CONFIRMATION, PKT_END);
                /*
                 * In case `helpful' firewalls or proxies tack
                 * extra human-readable text on the end of the
                 * session which we might mistake for another
                 * encrypted packet, we close the session once
                 * we've sent EXIT_CONFIRMATION.
                 */
                ssh_state = SSH_STATE_CLOSED;
                crReturnV;
	    } else {
		bombout(("Strange packet received: type %d", pktin.type));
		crReturnV;
	    }
	} else {
	    while (inlen > 0) {
		int len = min(inlen, 512);