OpenSSL: use nondeprecated EC-group functions under 3.0.0.
[exim.git] / src / src / match.c
index 5f6c1fb01c04f9c7c21c35d59a3589903654a854..6415b993d02d8d2c035d9abeafa22ce90741d6b1 100644 (file)
@@ -3,7 +3,7 @@
 *************************************************/
 
 /* Copyright (c) University of Cambridge 1995 - 2018 */
-/* Copyright (c) The Exim Maintainers 2020 */
+/* Copyright (c) The Exim Maintainers 2020 - 2021 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 /* Functions for matching strings */
@@ -128,9 +128,9 @@ required. */
 
 if (pattern[0] == '^')
   {
-  const pcre * re = regex_must_compile(pattern, cb->caseless, FALSE);
+  const pcre2_code * re = regex_must_compile(pattern, cb->caseless, FALSE);
   if (expand_setup < 0
-      ? pcre_exec(re, NULL, CCS s, Ustrlen(s), 0, PCRE_EOPT, NULL, 0) < 0
+      ? !regex_match(re, s, -1, NULL)
       : !regex_match_and_setup(re, s, 0, expand_setup)
      )
     return FAIL;
@@ -500,7 +500,7 @@ else
 /* For an unnamed list, use the expanded version in comments */
 #define LIST_LIMIT_PR 2048
 
-HDEBUG(D_any) if (!ot) 
+HDEBUG(D_any) if (!ot)
   {
   int n, m;
   gstring * g = string_fmt_append(NULL, "%s in \"%n%.*s%n\"",
@@ -1284,7 +1284,7 @@ provided that "caseless" is set. (It is FALSE for calls for matching rewriting
 patterns.) Otherwise just the domain is lower cases. A magic item "+caseful" in
 the list can be used to restore a caseful copy of the local part from the
 original address.
-Limit the subject address size to avoid mem-exhastion attacks.  The size chosen
+Limit the subject address size to avoid mem-exhaustion attacks.  The size chosen
 is historical (we used to use big_buffer here). */
 
 if ((len = Ustrlen(address)) > BIG_BUFFER_SIZE) len = BIG_BUFFER_SIZE;