summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2015-01-30 23:10:17 +1100
committerDamien Miller <djm@mindrot.org>2015-02-18 22:29:32 +1100
commit773dda25e828c4c9a52f7bdce6e1e5924157beab (patch)
tree831507f35a8feb0ae984a7a13f521932a0fedb61 /packet.c
parente89c780886b23600de1e1c8d74aabd1ff61f43f0 (diff)
repair --without-openssl; broken in refactor
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/packet.c b/packet.c
index b29d875c0..b1219c85b 100644
--- a/packet.c
+++ b/packet.c
@@ -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
792void 791void
793ssh_packet_set_encryption_key(struct ssh *ssh, const u_char *key, u_int keylen, int number) 792ssh_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)
2730int 2731int
2731sshpkt_put_ec(struct ssh *ssh, const EC_POINT *v, const EC_GROUP *g) 2732sshpkt_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
2736int 2739int
2737sshpkt_put_bignum1(struct ssh *ssh, const BIGNUM *v) 2740sshpkt_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
2742int 2747int
2743sshpkt_put_bignum2(struct ssh *ssh, const BIGNUM *v) 2748sshpkt_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)
2792int 2799int
2793sshpkt_get_ec(struct ssh *ssh, EC_POINT *v, const EC_GROUP *g) 2800sshpkt_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
2798int 2807int
2799sshpkt_get_bignum1(struct ssh *ssh, BIGNUM *v) 2808sshpkt_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
2804int 2815int
2805sshpkt_get_bignum2(struct ssh *ssh, BIGNUM *v) 2816sshpkt_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
2810int 2822int
2811sshpkt_get_end(struct ssh *ssh) 2823sshpkt_get_end(struct ssh *ssh)