diff options
author | Vladislav Grishenko <themiron@mail.ru> | 2018-10-26 20:53:10 +0500 |
---|---|---|
committer | Vladislav Grishenko <themiron@mail.ru> | 2018-10-26 20:53:10 +0500 |
commit | 2d4093196ad0ed39da46a2d9e814584238929378 (patch) | |
tree | 4e83c51e7c2005e4ab55ed178a1ff100668b6549 /accel-pppd/ctrl/sstp | |
parent | a6206e51576967083c7c7b92ab47356f8efa5b8b (diff) | |
download | accel-ppp-2d4093196ad0ed39da46a2d9e814584238929378.tar.gz accel-ppp-2d4093196ad0ed39da46a2d9e814584238929378.zip |
sstp: fix build w/o openssl
Diffstat (limited to 'accel-pppd/ctrl/sstp')
-rw-r--r-- | accel-pppd/ctrl/sstp/sstp.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/accel-pppd/ctrl/sstp/sstp.c b/accel-pppd/ctrl/sstp/sstp.c index 4e290598..3b65103a 100644 --- a/accel-pppd/ctrl/sstp/sstp.c +++ b/accel-pppd/ctrl/sstp/sstp.c @@ -1492,10 +1492,15 @@ static int sstp_recv_msg_call_connected(struct sstp_conn_t *conn, struct sstp_ct struct { struct sstp_ctrl_hdr hdr; struct sstp_attrib_crypto_binding attr; - } __attribute__((packed)) buf, *msg = (void *)hdr; - uint8_t md[EVP_MAX_MD_SIZE], hash, *ptr; + } __attribute__((packed)) *msg = (void *)hdr; + uint8_t hash; + unsigned int len; +#ifdef CRYPTO_OPENSSL + typeof(*msg) buf; + uint8_t md[EVP_MAX_MD_SIZE], *ptr; const EVP_MD *evp; - unsigned int len, mdlen; + unsigned int mdlen; +#endif if (conf_verbose) log_ppp_info2("recv [SSTP SSTP_MSG_CALL_CONNECTED]\n"); @@ -1533,7 +1538,9 @@ static int sstp_recv_msg_call_connected(struct sstp_conn_t *conn, struct sstp_ct log_ppp_error("sstp: invalid SHA256 Cert Hash"); return sstp_abort(conn, 0); } +#ifdef CRYPTO_OPENSSL evp = EVP_sha256(); +#endif } else if (hash & CERT_HASH_PROTOCOL_SHA1) { len = SHA_DIGEST_LENGTH; if (conf_hash_sha1.len == len && @@ -1541,13 +1548,16 @@ static int sstp_recv_msg_call_connected(struct sstp_conn_t *conn, struct sstp_ct log_ppp_error("sstp: invalid SHA1 Cert Hash"); return sstp_abort(conn, 0); } +#ifdef CRYPTO_OPENSSL evp = EVP_sha1(); +#endif } else { log_ppp_error("sstp: invalid Hash Protocol 0x%02x\n", msg->attr.hash_protocol_bitmask); return sstp_abort(conn, 0); } +#ifdef CRYPTO_OPENSSL if (conn->hlak_key) { ptr = mempcpy(md, SSTP_CMK_SEED, SSTP_CMK_SEED_SIZE); *ptr++ = len; @@ -1565,6 +1575,7 @@ static int sstp_recv_msg_call_connected(struct sstp_conn_t *conn, struct sstp_ct return sstp_abort(conn, 0); } } +#endif conn->sstp_state = STATE_SERVER_CALL_CONNECTED; |