]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dcrypt: Symbolize maximum OID length
authorAki Tuomi <aki.tuomi@open-xchange.com>
Fri, 23 Aug 2019 10:48:03 +0000 (13:48 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Mon, 23 Sep 2019 05:47:45 +0000 (08:47 +0300)
src/lib-dcrypt/dcrypt-openssl.c

index 5d8877f4c7130c2c586f9d597f4c2e93372811c9..ece4cfb4436b4683c8ff780ed4fbad4bb7989f18 100644 (file)
@@ -94,6 +94,9 @@
        STMT_START { HMAC_CTX_free(ctx); (ctx) = NULL; } STMT_END
 #endif
 
+/* openssl manual says this is OK */
+#define OID_TEXT_MAX_LEN 80
+
 struct dcrypt_context_symmetric {
        pool_t pool;
        const EVP_CIPHER *cipher;
@@ -1643,7 +1646,7 @@ dcrypt_openssl_store_private_key_dovecot(struct dcrypt_private_key *key,
        size_t dest_used = buffer_get_used_size(destination);
        const char *cipher2 = NULL;
        EVP_PKEY *pkey = key->key;
-       char objtxt[80]; /* openssl manual says this is OK */
+       char objtxt[OID_TEXT_MAX_LEN];
        ASN1_OBJECT *obj;
 
        if (EVP_PKEY_base_id(pkey) == EVP_PKEY_EC) {