diff options
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -788,10 +788,10 @@ ssh_packet_set_compress_hooks(struct ssh *ssh, void *ctx, | |||
788 | * encrypted independently of each other. | 788 | * encrypted independently of each other. |
789 | */ | 789 | */ |
790 | 790 | ||
791 | #ifdef WITH_OPENSSL | ||
792 | void | 791 | void |
793 | ssh_packet_set_encryption_key(struct ssh *ssh, const u_char *key, u_int keylen, int number) | 792 | ssh_packet_set_encryption_key(struct ssh *ssh, const u_char *key, u_int keylen, int number) |
794 | { | 793 | { |
794 | #ifdef WITH_SSH1 | ||
795 | struct session_state *state = ssh->state; | 795 | struct session_state *state = ssh->state; |
796 | const struct sshcipher *cipher = cipher_by_number(number); | 796 | const struct sshcipher *cipher = cipher_by_number(number); |
797 | int r; | 797 | int r; |
@@ -816,8 +816,8 @@ ssh_packet_set_encryption_key(struct ssh *ssh, const u_char *key, u_int keylen, | |||
816 | error("Warning: %s", wmsg); | 816 | error("Warning: %s", wmsg); |
817 | state->cipher_warning_done = 1; | 817 | state->cipher_warning_done = 1; |
818 | } | 818 | } |
819 | #endif /* WITH_SSH1 */ | ||
819 | } | 820 | } |
820 | #endif | ||
821 | 821 | ||
822 | /* | 822 | /* |
823 | * Finalizes and sends the packet. If the encryption key has been set, | 823 | * Finalizes and sends the packet. If the encryption key has been set, |
@@ -2727,23 +2727,29 @@ sshpkt_put_stringb(struct ssh *ssh, const struct sshbuf *v) | |||
2727 | return sshbuf_put_stringb(ssh->state->outgoing_packet, v); | 2727 | return sshbuf_put_stringb(ssh->state->outgoing_packet, v); |
2728 | } | 2728 | } |
2729 | 2729 | ||
2730 | #if defined(WITH_OPENSSL) && defined(OPENSSL_HAS_ECC) | ||
2730 | int | 2731 | int |
2731 | sshpkt_put_ec(struct ssh *ssh, const EC_POINT *v, const EC_GROUP *g) | 2732 | sshpkt_put_ec(struct ssh *ssh, const EC_POINT *v, const EC_GROUP *g) |
2732 | { | 2733 | { |
2733 | return sshbuf_put_ec(ssh->state->outgoing_packet, v, g); | 2734 | return sshbuf_put_ec(ssh->state->outgoing_packet, v, g); |
2734 | } | 2735 | } |
2736 | #endif /* WITH_OPENSSL && OPENSSL_HAS_ECC */ | ||
2735 | 2737 | ||
2738 | #ifdef WITH_SSH1 | ||
2736 | int | 2739 | int |
2737 | sshpkt_put_bignum1(struct ssh *ssh, const BIGNUM *v) | 2740 | sshpkt_put_bignum1(struct ssh *ssh, const BIGNUM *v) |
2738 | { | 2741 | { |
2739 | return sshbuf_put_bignum1(ssh->state->outgoing_packet, v); | 2742 | return sshbuf_put_bignum1(ssh->state->outgoing_packet, v); |
2740 | } | 2743 | } |
2744 | #endif /* WITH_SSH1 */ | ||
2741 | 2745 | ||
2746 | #ifdef WITH_OPENSSL | ||
2742 | int | 2747 | int |
2743 | sshpkt_put_bignum2(struct ssh *ssh, const BIGNUM *v) | 2748 | sshpkt_put_bignum2(struct ssh *ssh, const BIGNUM *v) |
2744 | { | 2749 | { |
2745 | return sshbuf_put_bignum2(ssh->state->outgoing_packet, v); | 2750 | return sshbuf_put_bignum2(ssh->state->outgoing_packet, v); |
2746 | } | 2751 | } |
2752 | #endif /* WITH_OPENSSL */ | ||
2747 | 2753 | ||
2748 | /* fetch data from the incoming packet */ | 2754 | /* fetch data from the incoming packet */ |
2749 | 2755 | ||
@@ -2789,23 +2795,29 @@ sshpkt_get_cstring(struct ssh *ssh, char **valp, size_t *lenp) | |||
2789 | return sshbuf_get_cstring(ssh->state->incoming_packet, valp, lenp); | 2795 | return sshbuf_get_cstring(ssh->state->incoming_packet, valp, lenp); |
2790 | } | 2796 | } |
2791 | 2797 | ||
2798 | #if defined(WITH_OPENSSL) && defined(OPENSSL_HAS_ECC) | ||
2792 | int | 2799 | int |
2793 | sshpkt_get_ec(struct ssh *ssh, EC_POINT *v, const EC_GROUP *g) | 2800 | sshpkt_get_ec(struct ssh *ssh, EC_POINT *v, const EC_GROUP *g) |
2794 | { | 2801 | { |
2795 | return sshbuf_get_ec(ssh->state->incoming_packet, v, g); | 2802 | return sshbuf_get_ec(ssh->state->incoming_packet, v, g); |
2796 | } | 2803 | } |
2804 | #endif /* WITH_OPENSSL && OPENSSL_HAS_ECC */ | ||
2797 | 2805 | ||
2806 | #ifdef WITH_SSH1 | ||
2798 | int | 2807 | int |
2799 | sshpkt_get_bignum1(struct ssh *ssh, BIGNUM *v) | 2808 | sshpkt_get_bignum1(struct ssh *ssh, BIGNUM *v) |
2800 | { | 2809 | { |
2801 | return sshbuf_get_bignum1(ssh->state->incoming_packet, v); | 2810 | return sshbuf_get_bignum1(ssh->state->incoming_packet, v); |
2802 | } | 2811 | } |
2812 | #endif /* WITH_SSH1 */ | ||
2803 | 2813 | ||
2814 | #ifdef WITH_OPENSSL | ||
2804 | int | 2815 | int |
2805 | sshpkt_get_bignum2(struct ssh *ssh, BIGNUM *v) | 2816 | sshpkt_get_bignum2(struct ssh *ssh, BIGNUM *v) |
2806 | { | 2817 | { |
2807 | return sshbuf_get_bignum2(ssh->state->incoming_packet, v); | 2818 | return sshbuf_get_bignum2(ssh->state->incoming_packet, v); |
2808 | } | 2819 | } |
2820 | #endif /* WITH_OPENSSL */ | ||
2809 | 2821 | ||
2810 | int | 2822 | int |
2811 | sshpkt_get_end(struct ssh *ssh) | 2823 | sshpkt_get_end(struct ssh *ssh) |