]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix build with older versions of gnutls
authorAndreas Schwab <schwab@linux-m68k.org>
Sun, 1 Jan 2023 23:31:00 +0000 (00:31 +0100)
committerAndreas Schwab <schwab@linux-m68k.org>
Sun, 1 Jan 2023 23:31:49 +0000 (00:31 +0100)
* src/gnutls.c (key_file2_aux): Use GNUTLS_PKCS_* constants only
if defined.

src/gnutls.c

index 40a0da6c7060390273461f52fdf67c383f3a9b03..8320c928a4e9078d4c58d70c1f7aa8fe823513d3 100644 (file)
@@ -1804,24 +1804,40 @@ key_file2_aux (Lisp_Object flags)
       Lisp_Object flag = XCAR (tail);
       if (EQ (flag, Qgnutls_pkcs_plain))
        rv |= GNUTLS_PKCS_PLAIN;
+#ifdef GNUTLS_PKCS_PKCS12_3DES
       else if (EQ (flag, Qgnutls_pkcs_pkcs12_3des))
        rv |= GNUTLS_PKCS_PKCS12_3DES;
+#endif
+#ifdef GNUTLS_PKCS_PKCS12_ARCFOUR
       else if (EQ (flag, Qgnutls_pkcs_pkcs12_arcfour))
        rv |= GNUTLS_PKCS_PKCS12_ARCFOUR;
+#endif
+#ifdef GNUTLS_PKCS_PKCS12_RC2_40
       else if (EQ (flag, Qgnutls_pkcs_pkcs12_rc2_40))
        rv |= GNUTLS_PKCS_PKCS12_RC2_40;
+#endif
+#ifdef GNUTLS_PKCS_PBES2_3DES
       else if (EQ (flag, Qgnutls_pkcs_pbes2_3des))
        rv |= GNUTLS_PKCS_PBES2_3DES;
+#endif
+#ifdef GNUTLS_PKCS_PBES2_AES_128
       else if (EQ (flag, Qgnutls_pkcs_pbes2_aes_128))
        rv |= GNUTLS_PKCS_PBES2_AES_128;
+#endif
+#ifdef GNUTLS_PKCS_PBES2_AES_192
       else if (EQ (flag, Qgnutls_pkcs_pbes2_aes_192))
        rv |= GNUTLS_PKCS_PBES2_AES_192;
+#endif
+#ifdef GNUTLS_PKCS_PBES2_AES_256
       else if (EQ (flag, Qgnutls_pkcs_pbes2_aes_256))
        rv |= GNUTLS_PKCS_PBES2_AES_256;
+#endif
       else if (EQ (flag, Qgnutls_pkcs_null_password))
        rv |= GNUTLS_PKCS_NULL_PASSWORD;
+#ifdef GNUTLS_PKCS_PBES2_DES
       else if (EQ (flag, Qgnutls_pkcs_pbes2_des))
        rv |= GNUTLS_PKCS_PBES2_DES;
+#endif
 #ifdef GNUTLS_PKCS_PBES1_DES_MD5
       else if (EQ (flag, Qgnutls_pkcs_pbes1_des_md5))
        rv |= GNUTLS_PKCS_PBES1_DES_MD5;