From 010b655ee9b7e05dbb524b49dbae1681aafd967e Mon Sep 17 00:00:00 2001 From: bjoern Date: Wed, 13 Nov 2024 17:46:32 +0100 Subject: [PATCH] api: correct DC_CERTCK_ACCEPT_* values and docs (#6176) this PR changes `DC_CERTCK_ACCEPT_*` to the same values in cffi as rust does. and regards the same values as deprecated afterwards there is some confusion about what is deprecated and what not, see https://github.com/deltachat/deltachat-android/issues/3408 iOS needs to be adapted as it was following the docs in the CFFI before, same desktop. both need to be graceful on reading and strict on writing. ~~**this PR is considered harmful,** so we should not merge that in during 1.48 release, there is no urgency, things are fine (wondering if it isn't even worth the effort, however, having different values and deprecations is a call for trouble in the future ...)~~ --------- Co-authored-by: iequidoo <117991069+iequidoo@users.noreply.github.com> --- deltachat-ffi/deltachat.h | 10 ++++++++-- node/constants.js | 1 + node/lib/constants.ts | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/deltachat-ffi/deltachat.h b/deltachat-ffi/deltachat.h index bccb269cc..08fb40897 100644 --- a/deltachat-ffi/deltachat.h +++ b/deltachat-ffi/deltachat.h @@ -5709,8 +5709,14 @@ int64_t dc_lot_get_timestamp (const dc_lot_t* lot); #define DC_CERTCK_STRICT 1 /** - * Accept invalid certificates, including self-signed ones - * or having incorrect hostname. + * Accept certificates that are expired, self-signed + * or not valid for the server hostname. + */ +#define DC_CERTCK_ACCEPT_INVALID 2 + +/** + * For API compatibility only: Treat this as DC_CERTCK_ACCEPT_INVALID on reading. + * Must not be written. */ #define DC_CERTCK_ACCEPT_INVALID_CERTIFICATES 3 diff --git a/node/constants.js b/node/constants.js index ea5343179..d087c4543 100644 --- a/node/constants.js +++ b/node/constants.js @@ -1,6 +1,7 @@ // Generated! module.exports = { + DC_CERTCK_ACCEPT_INVALID: 2, DC_CERTCK_ACCEPT_INVALID_CERTIFICATES: 3, DC_CERTCK_AUTO: 0, DC_CERTCK_STRICT: 1, diff --git a/node/lib/constants.ts b/node/lib/constants.ts index ec0734ccc..6a2aaaaec 100644 --- a/node/lib/constants.ts +++ b/node/lib/constants.ts @@ -1,6 +1,7 @@ // Generated! export enum C { + DC_CERTCK_ACCEPT_INVALID = 2, DC_CERTCK_ACCEPT_INVALID_CERTIFICATES = 3, DC_CERTCK_AUTO = 0, DC_CERTCK_STRICT = 1,