Skip to content

Commit 69204ac

Browse files
authored
chore(BC-1268): Upgrade to Couchbase Lite C 3.2.4 (#78)
### Docto changes Fix warnings in the Dockerfile used when generating the new release. ### Couchbase changes **Enhancements** [CBL-7004 — Add API to Access the TLSIdentity Used by CBLURLEndpointListener](https://jira.issues.couchbase.com/browse/CBL-7004) **Issues and Resolutions** [CBL-7006 — Blobs Not Downloaded on Update with Delta Sync in Peer-to-Peer Replication](https://jira.issues.couchbase.com/browse/CBL-7006) [CBL-7048 — Anonymous TLSIdentity Not Regenerated on Listener Restart](https://jira.issues.couchbase.com/browse/CBL-7048) [CBL-7046 — Crash When CBLKeyPair_PublicKeyDigest or PublicKeyData Fails to Retrieve External Public Key](https://jira.issues.couchbase.com/browse/CBL-7046) [CBL-7044 — Add Missing mbedTLS Error Domain](https://jira.issues.couchbase.com/browse/CBL-7044) [CBL-7041 — Invalid or Inconsistent Certificate Locality Key Name](https://jira.issues.couchbase.com/browse/CBL-7041) [CBL-6999 — Missing Implementation of CBLReplicator_ServerCertificate for Accessing Server TLS Certificate](https://jira.issues.couchbase.com/browse/CBL-6999) [CBL-6975 — CreateIdentity with Persistent Key Crashes Inside Autorelease Pool on iOS](https://jira.issues.couchbase.com/browse/CBL-6975)
1 parent 0568503 commit 69204ac

File tree

76 files changed

+107525
-107456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+107525
-107456
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "couchbase_lite"
33
description = "Rust bindings for Couchbase Lite C"
44
# The first three numbers correspond to the Couchbase Lite C release, the fourth number corresponds to the Rust release
5-
version = "3.2.3-0"
5+
version = "3.2.4-0"
66

77
edition = "2024"
88

Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
FROM --platform=amd64 rust@sha256:ad8c72c693b517ed60c930839daed91a5696fa6118f031d888cd0b7055a921a3 AS strip-stage
1+
ARG PLATFORM=amd64
2+
FROM --platform=${PLATFORM} rust@sha256:ad8c72c693b517ed60c930839daed91a5696fa6118f031d888cd0b7055a921a3 AS strip-stage
23
ARG DIRNAME
34
RUN apt-get update
45
RUN apt-get -y install binutils binutils-aarch64-linux-gnu
@@ -12,4 +13,5 @@ RUN /usr/aarch64-linux-gnu/bin/strip /build/${DIRNAME}/lib/arm-linux-androideabi
1213
RUN strip /build/${DIRNAME}/lib/x86_64-pc-windows-gnu/cblite.dll -o /build/${DIRNAME}/lib/x86_64-pc-windows-gnu/cblite.stripped.dll
1314

1415
FROM scratch AS strip
15-
COPY --from=strip-stage /build/${DIRNAME}/ .
16+
ARG DIRNAME
17+
COPY --from=strip-stage /build/${DIRNAME}/ ${DIRNAME}/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ $ LSAN_OPTIONS=suppressions=san.supp RUSTFLAGS="-Zsanitizer=address" cargo +nigh
119119

120120
[CBL_DOCS]: https://docs.couchbase.com/couchbase-lite/current/introduction.html
121121

122-
[CBL_API_REFERENCE]: https://docs.couchbase.com/mobile/3.2.3/couchbase-lite-c/C/html/modules.html
122+
[CBL_API_REFERENCE]: https://docs.couchbase.com/mobile/3.2.4/couchbase-lite-c/C/html/modules.html
123123

124124
[CBL_EDITIONS_DIFF]: https://www.couchbase.com/products/editions/
125125

libcblite_community/include/cbl/CBLBase.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ typedef CBL_ENUM(uint8_t, CBLErrorDomain) {
4141
kCBLFleeceDomain, ///< code is a Fleece error; see "FleeceException.h"
4242
kCBLNetworkDomain, ///< code is a network error; see \ref CBLNetworkErrorCode
4343
kCBLWebSocketDomain, ///< code is a WebSocket close code (1000...1015) or HTTP error (300..599)
44+
kCBLMbedTLSDomain ///< code is an mbedTLS error.
4445
};
4546

4647
/** Couchbase Lite error codes, in the CBLDomain. */

libcblite_community/include/cbl/CBLTLSIdentity.h

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ CBL_PUBLIC extern const FLString kCBLCertAttrKeySurname; // "SN",
6969
CBL_PUBLIC extern const FLString kCBLCertAttrKeyOrganization; // "O", e.g. "Example Corp."
7070
CBL_PUBLIC extern const FLString kCBLCertAttrKeyOrganizationUnit; // "OU", e.g. "Marketing"
7171
CBL_PUBLIC extern const FLString kCBLCertAttrKeyPostalAddress; // "postalAddress", e.g. "123 Example Blvd #2A"
72-
CBL_PUBLIC extern const FLString kCBLCertAttrKeyLocality; // "locality", e.g. "Boston"
72+
CBL_PUBLIC extern const FLString kCBLCertAttrKeyLocality; // "L", e.g. "Boston"
7373
CBL_PUBLIC extern const FLString kCBLCertAttrKeyPostalCode; // "postalCode", e.g. "02134"
7474
CBL_PUBLIC extern const FLString kCBLCertAttrKeyStateOrProvince; // "ST", e.g. "Massachusetts" (or "Quebec", ...)
7575
CBL_PUBLIC extern const FLString kCBLCertAttrKeyCountry; // "C", e.g. "us" (2-letter ISO country code)
@@ -79,7 +79,7 @@ CBL_PUBLIC extern const FLString kCBLCertAttrKeyEmailAddress; // "rfc822Nam
7979
CBL_PUBLIC extern const FLString kCBLCertAttrKeyHostname; // "dNSName", e.g. "www.example.com"
8080
CBL_PUBLIC extern const FLString kCBLCertAttrKeyURL; // "uniformResourceIdentifier", e.g. "https://example.com/jane"
8181
CBL_PUBLIC extern const FLString kCBLCertAttrKeyIPAddress; // "iPAddress", e.g. An IP Address in binary format e.g. "\x0A\x00\x01\x01"
82-
CBL_PUBLIC extern const FLString kCBLCertAttrKeyRegisteredID; // "registeredID", e.g. A domain specific identifier.
82+
CBL_PUBLIC extern const FLString kCBLCertAttrKeyRegisteredID; // "registeredID", e.g. A domain-specific identifier encoded as an ASN.1 Object Identifier (OID) in DER format.
8383

8484
/** An opaque object representing the X.509 Certifcate. */
8585
typedef struct CBLCert CBLCert;
@@ -168,7 +168,8 @@ typedef CBL_ENUM(int, CBLSignatureDigestAlgorithm) {
168168
The core idea is that all private key operations are delegated to the application's secure key storage,
169169
ensuring that the private key is never exposed outside the key storage. */
170170
typedef struct CBLExternalKeyCallbacks {
171-
/** Provides the public key's raw data, as an ASN.1 DER sequence of [modulus, exponent].
171+
/** Provides the public key data as an ASN.1 DER-encoded SubjectPublicKeyInfo structure.
172+
For more information, see RFC 5280: https://datatracker.ietf.org/doc/html/rfc5280
172173
@param externalKey The external key pointer given to CBLKeyPair_CreateWithExternalKey.
173174
@param output Where to copy the key data.
174175
@param outputMaxLen Maximum length of output that can be written.
@@ -237,18 +238,20 @@ CBLKeyPair* _cbl_nullable CBLKeyPair_CreateWithPrivateKeyData(FLSlice privateKey
237238
/** Returns a hex-encoded digest of the public key.
238239
@param keyPair The key pair from which to extract the public key digest.
239240
@return A hex-encoded digest of the public key.
241+
@note Returns empty result if the public key digest cannot be retrieved.
240242
@note You are responsible for releasing the returned data. */
241243
_cbl_warn_unused
242244
FLSliceResult CBLKeyPair_PublicKeyDigest(CBLKeyPair* keyPair) CBLAPI;
243245

244246
/** Returns the public key data.
245247
@param keyPair The key pair from which to retrieve the public key.
246248
@return The public key data.
249+
@note Returns empty result if the public key data cannot be retrieved.
247250
@note You are responsible for releasing the returned data. */
248251
_cbl_warn_unused
249252
FLSliceResult CBLKeyPair_PublicKeyData(CBLKeyPair* keyPair) CBLAPI;
250253

251-
/** Returns the private key data, if the private key is known and its data is accessible.
254+
/** Returns the private key data in DER format, if the private key is known and its data is accessible.
252255
@param keyPair The key pair containing the private key.
253256
@return The private key data, or an empty slice if the key is not accessible.
254257
@note Persistent private keys in the secure key store generally don't have accessible data.
@@ -293,7 +296,7 @@ typedef CBL_OPTIONS(uint16_t, CBLKeyUsages) {
293296
the platform's secure key store (Keychain on Apple platforms or CNG Key Storage Provider on Windows).
294297
@param keyUsages The key usages for the generated identity.
295298
@param attributes A dictionary containing the certificate attributes.
296-
@param expiration The expiration date/time of the certificate in the identity.
299+
@param validityInMilliseconds Certificate validity duration in milliseconds.
297300
@param label The label used for persisting the identity in the platform's secure storage. If `kFLSliceNull` is passed, the identity will not be persisted.
298301
@param outError On failure, the error will be written here.
299302
@return A CBLTLSIdentity instance on success, or NULL on failure.
@@ -303,15 +306,15 @@ typedef CBL_OPTIONS(uint16_t, CBLKeyUsages) {
303306
_cbl_warn_unused
304307
CBLTLSIdentity* _cbl_nullable CBLTLSIdentity_CreateIdentity(CBLKeyUsages keyUsages,
305308
FLDict attributes,
306-
CBLTimestamp expiration,
309+
int64_t validityInMilliseconds,
307310
FLString label,
308311
CBLError* _cbl_nullable outError) CBLAPI;
309312

310313
/** Creates a self-signed TLS identity using the provided RSA key pair and certificate attributes.
311314
@param keyUsages The key usages for the generated identity.
312315
@param keypair The RSA key pair to be used for generating the TLS identity.
313316
@param attributes A dictionary containing the certificate attributes.
314-
@param expiration The expiration date/time of the certificate in the identity.
317+
@param validityInMilliseconds Certificate validity duration in milliseconds.
315318
@param outError On failure, the error will be written here.
316319
@return A CBLTLSIdentity instance on success, or NULL on failure.
317320
@Note The Common Name (kCBLCertAttrKeyCommonName) attribute is required.
@@ -320,7 +323,7 @@ _cbl_warn_unused
320323
CBLTLSIdentity* _cbl_nullable CBLTLSIdentity_CreateIdentityWithKeyPair(CBLKeyUsages keyUsages,
321324
CBLKeyPair* keypair,
322325
FLDict attributes,
323-
CBLTimestamp expiration,
326+
int64_t validityInMilliseconds,
324327
CBLError* _cbl_nullable outError) CBLAPI;
325328

326329
#if !defined(__linux__) && !defined(__ANDROID__)
@@ -348,10 +351,10 @@ CBLTLSIdentity* _cbl_nullable CBLTLSIdentity_IdentityWithLabel(FLString label,
348351

349352
#endif //#if !defined(__linux__) && !defined(__ANDROID__)
350353

351-
/** Returns a TLS identity from an existing identity using the provided RSA keypair and certificate.
352-
* The certificate will not be resigned with the new keypair; it will be used as is.
354+
/** Returns a TLS identity from an existing identity using the provided RSA keypair and certificate chain.
355+
* The certificate chain is used as-is; the leaf certificate is not re-signed.
353356
* @param keypair A CBLKeyPair instance representing the RSA keypair to be associated with the identity.
354-
* @param cert A CBLCert instance representing the certificate associated with the identity.
357+
* @param cert A CBLCert instance representing the certificate chain.
355358
* @param outError On failure, the error will be written here.
356359
* @return A CBLTLSIdentity instance on success, or `NULL` if an error occurs.
357360
@note You are responsible for releasing the returned reference. */

libcblite_community/include/cbl/CBLURLEndpointListener.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,13 @@ const CBLURLEndpointListenerConfiguration* CBLURLEndpointListener_Config(const C
104104
/** The listening port of the listener. If the listener is not started, the port will be zero. */
105105
uint16_t CBLURLEndpointListener_Port(const CBLURLEndpointListener*) CBLAPI;
106106

107+
/** The TLS identity used by the listener for TLS communication. The value will be nullptr if the listener is not started, or if the TLS is disabled.
108+
@note The returned identity remains valid until the listener is stopped or released.
109+
If you want to keep it longer, retain it with `CBLTLSIdentity_Retain`. */
110+
CBLTLSIdentity* CBLURLEndpointListener_TLSIdentity(const CBLURLEndpointListener*) CBLAPI;
111+
107112
/** The possible URLs of the listener. If the listener is not started, NULL will be returned.
108-
@note You are responsible for releasing the returned reference. */
113+
@note You are responsible for releasing the returned reference. */
109114
FLMutableArray CBLURLEndpointListener_Urls(const CBLURLEndpointListener*) CBLAPI;
110115

111116
/** The connection status of the listener */

libcblite_community/include/cbl/CBL_Edition.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
/* #undef COUCHBASE_ENTERPRISE */
2121
#endif
2222

23-
#define CBLITE_VERSION "3.2.3"
24-
#define CBLITE_VERSION_NUMBER 3002003
25-
#define CBLITE_BUILD_NUMBER 30
26-
#define CBLITE_SOURCE_ID "b3b6dc0"
27-
#define CBLITE_BUILD_TIMESTAMP "2025-04-29T06:42:35Z"
23+
#define CBLITE_VERSION "3.2.4"
24+
#define CBLITE_VERSION_NUMBER 3002004
25+
#define CBLITE_BUILD_NUMBER 9
26+
#define CBLITE_SOURCE_ID "664eff6"
27+
#define CBLITE_BUILD_TIMESTAMP "2025-06-04T20:51:59Z"
80 Bytes
Binary file not shown.
Binary file not shown.
48 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)