Add OPENSSL_NO_ECDH guards
Reviewed-by: Emilia Käsper <emilia@openssl.org>
(cherry picked from commit 7f9edfd23a)
			
			
This commit is contained in:
		| @@ -167,6 +167,7 @@ static int pkey_ec_verify(EVP_PKEY_CTX *ctx, | |||||||
| 	return ret; | 	return ret; | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | #ifndef OPENSSL_NO_ECDH | ||||||
| static int pkey_ec_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen) | static int pkey_ec_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen) | ||||||
| 	{ | 	{ | ||||||
| 	int ret; | 	int ret; | ||||||
| @@ -200,6 +201,7 @@ static int pkey_ec_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen) | |||||||
| 	*keylen = ret; | 	*keylen = ret; | ||||||
| 	return 1; | 	return 1; | ||||||
| 	} | 	} | ||||||
|  | #endif | ||||||
|  |  | ||||||
| static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) | static int pkey_ec_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) | ||||||
| 	{ | 	{ | ||||||
| @@ -332,7 +334,11 @@ const EVP_PKEY_METHOD ec_pkey_meth = | |||||||
| 	0,0, | 	0,0, | ||||||
|  |  | ||||||
| 	0, | 	0, | ||||||
|  | #ifndef OPENSSL_NO_ECDH | ||||||
| 	pkey_ec_derive, | 	pkey_ec_derive, | ||||||
|  | #else | ||||||
|  | 	0, | ||||||
|  | #endif | ||||||
|  |  | ||||||
| 	pkey_ec_ctrl, | 	pkey_ec_ctrl, | ||||||
| 	pkey_ec_ctrl_str | 	pkey_ec_ctrl_str | ||||||
|   | |||||||
| @@ -3058,6 +3058,7 @@ SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, | |||||||
| 				} | 				} | ||||||
| 			ok = ok && ec_ok; | 			ok = ok && ec_ok; | ||||||
| 			} | 			} | ||||||
|  | #ifndef OPENSSL_NO_ECDH | ||||||
| 		if ( | 		if ( | ||||||
| 			/* if we are considering an ECC cipher suite that uses an ephemeral EC key */ | 			/* if we are considering an ECC cipher suite that uses an ephemeral EC key */ | ||||||
| 			(alg_k & SSL_kEECDH) | 			(alg_k & SSL_kEECDH) | ||||||
| @@ -3105,6 +3106,7 @@ SSL_CIPHER *ssl3_choose_cipher(SSL *s, STACK_OF(SSL_CIPHER) *clnt, | |||||||
| 				} | 				} | ||||||
| 			ok = ok && ec_ok; | 			ok = ok && ec_ok; | ||||||
| 			} | 			} | ||||||
|  | #endif /* OPENSSL_NO_ECDH */ | ||||||
| #endif /* OPENSSL_NO_EC */ | #endif /* OPENSSL_NO_EC */ | ||||||
| #endif /* OPENSSL_NO_TLSEXT */ | #endif /* OPENSSL_NO_TLSEXT */ | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Matt Caswell
					Matt Caswell