Skip to content

Commit 6ed383e

Browse files
committed
Merge pull request #295
2 parents 27ee36f + 38f7d67 commit 6ed383e

File tree

5 files changed

+25
-14
lines changed

5 files changed

+25
-14
lines changed

config.m4

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -287,27 +287,28 @@ if test "$MONGODB" != "no"; then
287287
mongoc-ssl.c
288288
";
289289

290-
MONGOC_SOURCES_LIBCRYPTO="\
291-
mongoc-crypto-openssl.c \
292-
mongoc-rand-openssl.c
293-
";
294-
295290
MONGOC_SOURCES_OPENSSL="\
291+
mongoc-crypto-openssl.c \
296292
mongoc-openssl.c \
293+
mongoc-rand-openssl.c \
297294
mongoc-stream-tls-openssl.c \
298295
mongoc-stream-tls-openssl-bio.c
299296
";
300297

301-
MONGOC_SOURCES_COMMON_CRYPTO="\
302-
mongoc-crypto-common-crypto.c \
303-
mongoc-rand-common-crypto.c
304-
";
305-
306298
MONGOC_SOURCES_SECURE_TRANSPORT="\
299+
mongoc-crypto-common-crypto.c \
300+
mongoc-rand-common-crypto.c \
307301
mongoc-secure-transport.c \
308302
mongoc-stream-tls-secure-transport.c
309303
";
310304

305+
MONGOC_SOURCES_SECURE_CHANNEL="\
306+
mongoc-crypto-cng.c \
307+
mongoc-rand-cng.c \
308+
mongoc-secure-channel.c \
309+
mongoc-stream-tls-secure-channel.c
310+
";
311+
311312
MONGOC_SOURCES_SASL=mongoc-sasl.c
312313

313314
if test "$ext_shared" = "no"; then
@@ -385,10 +386,9 @@ PHP_ARG_WITH(libmongoc, whether to use system libmongoc,
385386
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[src/libmongoc/src/mongoc], $MONGOC_SOURCES, [$STD_CFLAGS], shared_objects_mongodb, yes)
386387
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[src/libmongoc/src/mongoc], $MONGOC_SOURCES_CRYPTO, [$STD_CFLAGS], shared_objects_mongodb, yes)
387388
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[src/libmongoc/src/mongoc], $MONGOC_SOURCES_SSL, [$STD_CFLAGS], shared_objects_mongodb, yes)
388-
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[src/libmongoc/src/mongoc], $MONGOC_SOURCES_LIBCRYPTO, [$STD_CFLAGS], shared_objects_mongodb, yes)
389389
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[src/libmongoc/src/mongoc], $MONGOC_SOURCES_OPENSSL, [$STD_CFLAGS], shared_objects_mongodb, yes)
390-
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[src/libmongoc/src/mongoc], $MONGOC_SOURCES_COMMON_CRYPTO, [$STD_CFLAGS], shared_objects_mongodb, yes)
391390
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[src/libmongoc/src/mongoc], $MONGOC_SOURCES_SECURE_TRANSPORT, [$STD_CFLAGS], shared_objects_mongodb, yes)
391+
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[src/libmongoc/src/mongoc], $MONGOC_SOURCES_SECURE_CHANNEL, [$STD_CFLAGS], shared_objects_mongodb, yes)
392392
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[src/libmongoc/src/mongoc], $MONGOC_SOURCES_SASL, [$STD_CFLAGS], shared_objects_mongodb, yes)
393393

394394

@@ -402,6 +402,10 @@ PHP_ARG_WITH(libmongoc, whether to use system libmongoc,
402402
AC_SUBST(MONGOC_ENABLE_SECURE_TRANSPORT, 0)
403403
AC_SUBST(MONGOC_ENABLE_COMMON_CRYPTO, 0)
404404

405+
dnl Secure Channel only applies to Windows
406+
AC_SUBST(MONGOC_ENABLE_SECURE_CHANNEL, 0)
407+
AC_SUBST(MONGOC_ENABLE_CRYPTO_CNG, 0)
408+
405409
AC_SUBST(MONGOC_NO_AUTOMATIC_GLOBALS, 1)
406410
fi
407411

config.w32

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ if (PHP_MONGODB != "no") {
2323
ADD_SOURCES(configure_module_dirname + "/src/libmongoc/src/mongoc", "mongoc-openssl.c mongoc-stream-tls-openssl.c mongoc-stream-tls-openssl-bio.c", "mongodb");
2424
ADD_SOURCES(configure_module_dirname + "/src/libmongoc/src/mongoc", "mongoc-crypto-common-crypto.c mongoc-rand-common-crypto.c", "mongodb");
2525
ADD_SOURCES(configure_module_dirname + "/src/libmongoc/src/mongoc", "mongoc-secure-transport.c mongoc-stream-tls-secure-transport.c", "mongodb");
26+
ADD_SOURCES(configure_module_dirname + "/src/libmongoc/src/mongoc", "mongoc-crypto-cng.c mongoc-rand-cng.c", "mongodb");
27+
ADD_SOURCES(configure_module_dirname + "/src/libmongoc/src/mongoc", "mongoc-secure-channel.c mongoc-stream-tls-secure-channel.c", "mongodb");
2628
ADD_SOURCES(configure_module_dirname + "/src/libmongoc/src/mongoc", "mongoc-sasl.c", "mongodb");
2729

2830
AC_DEFINE("HAVE_MONGOC", 1);
@@ -54,6 +56,10 @@ if (PHP_MONGODB != "no") {
5456
AC_DEFINE("MONGOC_ENABLE_SECURE_TRANSPORT", 0);
5557
AC_DEFINE("MONGOC_ENABLE_COMMON_CRYPTO", 0);
5658

59+
// TODO: Support building with Secure Channel on Windows
60+
AC_DEFINE("MONGOC_ENABLE_SECURE_CHANNEL", 0)
61+
AC_DEFINE("MONGOC_ENABLE_CRYPTO_CNG", 0)
62+
5763
if (PHP_MONGODB_SASL != "no" &&
5864
CHECK_LIB("libsasl.lib", "mongodb", PHP_MONGODB) &&
5965
CHECK_HEADER_ADD_INCLUDE("sasl/sasl.h", "CFLAGS_MONGOC")) {

php_phongo.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1989,6 +1989,7 @@ bool phongo_manager_init(php_phongo_manager_t *manager, const char *uri_string,
19891989
!php_phongo_apply_rp_options_to_uri(uri, bson_options TSRMLS_CC) ||
19901990
!php_phongo_apply_wc_options_to_uri(uri, bson_options TSRMLS_CC)) {
19911991
/* Exception should already have been thrown */
1992+
mongoc_uri_destroy(uri);
19921993
return false;
19931994
}
19941995

src/libmongoc

Submodule libmongoc updated 104 files

0 commit comments

Comments
 (0)