asn1: Add ASN1_MALLOC_ENCODE_SAVE() macro

This commit is contained in:
Nicolas Williams
2025-12-02 17:18:53 -06:00
parent ec942cd5a1
commit bd9a03d498
3 changed files with 15 additions and 0 deletions

View File

@@ -75,6 +75,13 @@ enum asn1_print_flags {
} \
} while (0)
#define ASN1_MALLOC_ENCODE_SAVE(T, S, L, R) \
do { \
der_free_octet_string(&(S)->_save); \
ASN1_MALLOC_ENCODE(T, (S)->_save.data, \
(S)->_save.length, (S), (L), (R)); \
} while (0)
#ifdef _WIN32
#ifndef ASN1_LIB
#define ASN1EXP __declspec(dllimport)

View File

@@ -273,6 +273,13 @@ init_generate (const char *filename, const char *base)
" } \\\n"
" } while (0)\n\n",
headerfile);
fputs("#define ASN1_MALLOC_ENCODE_SAVE(T, S, L, R) \\\n"
" do { \\\n"
" der_free_octet_string(&(S)->_save); \\\n"
" ASN1_MALLOC_ENCODE(T, (S)->_save.data, \\\n"
" (S)->_save.length, (S), (L), (R)); \\\n"
" } while (0)\n\n",
headerfile);
fputs("#ifdef _WIN32\n"
"#ifndef ASN1_LIB\n"
"#define ASN1EXP __declspec(dllimport)\n"

1
lib/asn1/pkinit.opt Normal file
View File

@@ -0,0 +1 @@
--sequence=TD_DH_PARAMETERS