Add support for building against boringssl
diff --git a/Makefile b/Makefile
index b05c72d..75ba742 100644
--- a/Makefile
+++ b/Makefile
@@ -269,13 +269,16 @@
 
 ifdef OPENSSL_DIR
 	CFLAGS += -I ${OPENSSL_DIR}/include
-	LDFLAGS += -I ${OPENSSL_DIR}/lib
+	LDFLAGS += -L ${OPENSSL_DIR}/lib
 endif
 ifdef OPENSSL_INC
 	CFLAGS += -I ${OPENSSL_INC}
 endif
 ifdef OPENSSL_LIB
-	LDFLAGS += -I ${OPENSSL_LIB}
+	LDFLAGS += -L ${OPENSSL_LIB}
+endif
+ifdef CRYPTO_LIB
+	LDFLAGS += -L ${CRYPTO_LIB}
 endif
 
 export BUILD_RUN
diff --git a/host/include/openssl_compat.h b/host/include/openssl_compat.h
index 7771f32..9c95468 100644
--- a/host/include/openssl_compat.h
+++ b/host/include/openssl_compat.h
@@ -8,6 +8,7 @@
 
 #include <openssl/rsa.h>
 
+#ifndef OPENSSL_IS_BORINGSSL
 #if OPENSSL_VERSION_NUMBER < 0x10100000L
 
 static inline void RSA_get0_key(const RSA *rsa, const BIGNUM **n,
@@ -23,4 +24,6 @@
 
 #endif  /* OPENSSL_VERSION_NUMBER < 0x10100000L */
 
+#endif  /* OPENSSL_IS_BORINGSSL */
+
 #endif  /* VBOOT_REFERENCE_OPENSSL_COMPAT_H_ */