Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package lua-luasec for openSUSE:Factory 
checked in at 2022-08-21 14:11:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lua-luasec (Old)
 and      /work/SRC/openSUSE:Factory/.lua-luasec.new.2083 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "lua-luasec"

Sun Aug 21 14:11:00 2022 rev:7 rq:998387 version:1.2.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/lua-luasec/lua-luasec.changes    2021-12-18 
20:31:16.146276633 +0100
+++ /work/SRC/openSUSE:Factory/.lua-luasec.new.2083/lua-luasec.changes  
2022-08-21 14:11:04.134440467 +0200
@@ -1,0 +2,8 @@
+Sat Aug 20 18:06:06 UTC 2022 - Gordon Leung <[email protected]>
+
+- Update to version 1.2.0:
+  * Support passing DANE flags
+  * Add key material export method
+  * backguard compat for openssl on providers, like LTS linuxes
+
+-------------------------------------------------------------------

Old:
----
  luasec-1.0.2.tar.gz

New:
----
  luasec-1.2.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ lua-luasec.spec ++++++
--- /var/tmp/diff_new_pack.iolZbc/_old  2022-08-21 14:11:07.374449396 +0200
+++ /var/tmp/diff_new_pack.iolZbc/_new  2022-08-21 14:11:07.382449418 +0200
@@ -1,7 +1,7 @@
 #
-# spec file for package lua-luasec
+# spec file
 #
-# Copyright (c) 2020 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -24,16 +24,16 @@
 %else
 Name:           %{flavor}-%{mod_name}
 %endif
-Version:        1.0.2
+Version:        1.2.0
 Release:        0
 Summary:        A Lua binding for OpenSSL
 License:        MIT
 URL:            https://github.com/brunoos/luasec
 Source:         
https://github.com/brunoos/%{mod_name}/archive/v%{version}/%{mod_name}-%{version}.tar.gz
 BuildRequires:  %{flavor}-devel
-BuildRequires:  lua-macros
 BuildRequires:  %{flavor}-luasocket
 BuildRequires:  libopenssl-devel
+BuildRequires:  lua-macros
 Requires:       %{flavor}
 Requires:       %{flavor}-luasocket
 %lua_provides

++++++ luasec-1.0.2.tar.gz -> luasec-1.2.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/CHANGELOG new/luasec-1.2.0/CHANGELOG
--- old/luasec-1.0.2/CHANGELOG  2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/CHANGELOG  2022-07-30 13:42:53.000000000 +0200
@@ -1,4 +1,20 @@
 
--------------------------------------------------------------------------------
+LuaSec 1.2.0
+---------------
+This version includes:
+
+* Add key material export method
+* Backguard compat for openssl on providers, like LTS linuxes
+
+--------------------------------------------------------------------------------
+LuaSec 1.1.0
+---------------
+This version includes:
+
+* Fix missing DANE flag
+* Remove unused parameter in https.lua
+
+--------------------------------------------------------------------------------
 LuaSec 1.0.2
 ---------------
 This version includes:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/INSTALL new/luasec-1.2.0/INSTALL
--- old/luasec-1.0.2/INSTALL    2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/INSTALL    2022-07-30 13:42:53.000000000 +0200
@@ -1,4 +1,4 @@
-LuaSec 1.0.2
+LuaSec 1.2.0
 ------------
 
 * OpenSSL options:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/LICENSE new/luasec-1.2.0/LICENSE
--- old/luasec-1.0.2/LICENSE    2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/LICENSE    2022-07-30 13:42:53.000000000 +0200
@@ -1,5 +1,5 @@
-LuaSec 1.0.2 license
-Copyright (C) 2006-2021 Bruno Silvestre, UFG
+LuaSec 1.2.0 license
+Copyright (C) 2006-2022 Bruno Silvestre, UFG
 
 Permission is hereby granted, free  of charge, to any person obtaining
 a  copy  of this  software  and  associated  documentation files  (the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/README.md new/luasec-1.2.0/README.md
--- old/luasec-1.0.2/README.md  2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/README.md  2022-07-30 13:42:53.000000000 +0200
@@ -1,4 +1,4 @@
-LuaSec 1.0.2
+LuaSec 1.2.0
 ===============
 LuaSec depends  on OpenSSL, and  integrates with LuaSocket to  make it
 easy to add secure connections to any Lua applications or scripts.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/luasec-1.0.2-1.rockspec 
new/luasec-1.2.0/luasec-1.0.2-1.rockspec
--- old/luasec-1.0.2/luasec-1.0.2-1.rockspec    2021-08-14 15:28:09.000000000 
+0200
+++ new/luasec-1.2.0/luasec-1.0.2-1.rockspec    1970-01-01 01:00:00.000000000 
+0100
@@ -1,105 +0,0 @@
-package = "LuaSec"
-version = "1.0.2-1"
-source = {
-  url = "git://github.com/brunoos/luasec",
-  tag = "v1.0.2",
-}
-description = {
-   summary = "A binding for OpenSSL library to provide TLS/SSL communication 
over LuaSocket.",
-   detailed = "This version delegates to LuaSocket the TCP connection 
establishment between the client and server. Then LuaSec uses this connection 
to start a secure TLS/SSL session.",
-   homepage = "https://github.com/brunoos/luasec/wiki";,
-   license = "MIT"
-}
-dependencies = {
-   "lua >= 5.1", "luasocket"
-}
-external_dependencies = {
-   platforms = {
-      unix = {
-         OPENSSL = {
-            header = "openssl/ssl.h",
-            library = "ssl"
-         }
-      },
-      windows = {
-         OPENSSL = {
-            header = "openssl/ssl.h",
-         }
-      },
-   }
-}
-build = {
-   type = "builtin",
-   copy_directories = {
-      "samples"
-   },
-   platforms = {
-      unix = {
-         install = {
-            lib = {
-               "ssl.so"
-            },
-            lua = {
-               "src/ssl.lua", ['ssl.https'] = "src/https.lua"
-            }
-         },
-         modules = {
-            ssl = {
-               defines = {
-                  "WITH_LUASOCKET", "LUASOCKET_DEBUG",
-               },
-               incdirs = {
-                  "$(OPENSSL_INCDIR)", "src/", "src/luasocket",
-               },
-               libdirs = {
-                  "$(OPENSSL_LIBDIR)"
-               },
-               libraries = {
-                  "ssl", "crypto"
-               },
-               sources = {
-                  "src/options.c", "src/config.c", "src/ec.c", 
-                  "src/x509.c", "src/context.c", "src/ssl.c", 
-                  "src/luasocket/buffer.c", "src/luasocket/io.c",
-                  "src/luasocket/timeout.c", "src/luasocket/usocket.c"
-               }
-            }
-         }
-      },
-      windows = {
-         install = {
-            lib = {
-               "ssl.dll"
-            },
-            lua = {
-               "src/ssl.lua", ['ssl.https'] = "src/https.lua"
-            }
-         },
-         modules = {
-            ssl = {
-               defines = {
-                  "WIN32", "NDEBUG", "_WINDOWS", "_USRDLL", "LSEC_EXPORTS", 
"BUFFER_DEBUG", "LSEC_API=__declspec(dllexport)",
-                  "WITH_LUASOCKET", "LUASOCKET_DEBUG",
-                  "LUASEC_INET_NTOP", "WINVER=0x0501", "_WIN32_WINNT=0x0501", 
"NTDDI_VERSION=0x05010300"
-               },
-               libdirs = {
-                  "$(OPENSSL_LIBDIR)",
-                  "$(OPENSSL_BINDIR)",
-               },
-               libraries = {
-                  "libssl32MD", "libcrypto32MD", "ws2_32"
-               },
-               incdirs = {
-                  "$(OPENSSL_INCDIR)", "src/", "src/luasocket"
-               },
-               sources = {
-                  "src/options.c", "src/config.c", "src/ec.c", 
-                  "src/x509.c", "src/context.c", "src/ssl.c", 
-                  "src/luasocket/buffer.c", "src/luasocket/io.c",
-                  "src/luasocket/timeout.c", "src/luasocket/wsocket.c"
-               }
-            }
-         }
-      }
-   }
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/luasec-1.2.0-1.rockspec 
new/luasec-1.2.0/luasec-1.2.0-1.rockspec
--- old/luasec-1.0.2/luasec-1.2.0-1.rockspec    1970-01-01 01:00:00.000000000 
+0100
+++ new/luasec-1.2.0/luasec-1.2.0-1.rockspec    2022-07-30 13:42:53.000000000 
+0200
@@ -0,0 +1,105 @@
+package = "LuaSec"
+version = "1.2.0-1"
+source = {
+  url = "git+https://github.com/brunoos/luasec";,
+  tag = "v1.2.0",
+}
+description = {
+   summary = "A binding for OpenSSL library to provide TLS/SSL communication 
over LuaSocket.",
+   detailed = "This version delegates to LuaSocket the TCP connection 
establishment between the client and server. Then LuaSec uses this connection 
to start a secure TLS/SSL session.",
+   homepage = "https://github.com/brunoos/luasec/wiki";,
+   license = "MIT"
+}
+dependencies = {
+   "lua >= 5.1", "luasocket"
+}
+external_dependencies = {
+   platforms = {
+      unix = {
+         OPENSSL = {
+            header = "openssl/ssl.h",
+            library = "ssl"
+         }
+      },
+      windows = {
+         OPENSSL = {
+            header = "openssl/ssl.h",
+         }
+      },
+   }
+}
+build = {
+   type = "builtin",
+   copy_directories = {
+      "samples"
+   },
+   platforms = {
+      unix = {
+         install = {
+            lib = {
+               "ssl.so"
+            },
+            lua = {
+               "src/ssl.lua", ['ssl.https'] = "src/https.lua"
+            }
+         },
+         modules = {
+            ssl = {
+               defines = {
+                  "WITH_LUASOCKET", "LUASOCKET_DEBUG",
+               },
+               incdirs = {
+                  "$(OPENSSL_INCDIR)", "src/", "src/luasocket",
+               },
+               libdirs = {
+                  "$(OPENSSL_LIBDIR)"
+               },
+               libraries = {
+                  "ssl", "crypto"
+               },
+               sources = {
+                  "src/options.c", "src/config.c", "src/ec.c", 
+                  "src/x509.c", "src/context.c", "src/ssl.c", 
+                  "src/luasocket/buffer.c", "src/luasocket/io.c",
+                  "src/luasocket/timeout.c", "src/luasocket/usocket.c"
+               }
+            }
+         }
+      },
+      windows = {
+         install = {
+            lib = {
+               "ssl.dll"
+            },
+            lua = {
+               "src/ssl.lua", ['ssl.https'] = "src/https.lua"
+            }
+         },
+         modules = {
+            ssl = {
+               defines = {
+                  "WIN32", "NDEBUG", "_WINDOWS", "_USRDLL", "LSEC_EXPORTS", 
"BUFFER_DEBUG", "LSEC_API=__declspec(dllexport)",
+                  "WITH_LUASOCKET", "LUASOCKET_DEBUG",
+                  "LUASEC_INET_NTOP", "WINVER=0x0501", "_WIN32_WINNT=0x0501", 
"NTDDI_VERSION=0x05010300"
+               },
+               libdirs = {
+                  "$(OPENSSL_LIBDIR)",
+                  "$(OPENSSL_BINDIR)",
+               },
+               libraries = {
+                  "libssl32MD", "libcrypto32MD", "ws2_32"
+               },
+               incdirs = {
+                  "$(OPENSSL_INCDIR)", "src/", "src/luasocket"
+               },
+               sources = {
+                  "src/options.c", "src/config.c", "src/ec.c", 
+                  "src/x509.c", "src/context.c", "src/ssl.c", 
+                  "src/luasocket/buffer.c", "src/luasocket/io.c",
+                  "src/luasocket/timeout.c", "src/luasocket/wsocket.c"
+               }
+            }
+         }
+      }
+   }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/src/compat.h 
new/luasec-1.2.0/src/compat.h
--- old/luasec-1.0.2/src/compat.h       2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/src/compat.h       2022-07-30 13:42:53.000000000 +0200
@@ -1,7 +1,7 @@
 /*--------------------------------------------------------------------------
- * LuaSec 1.0.2
+ * LuaSec 1.2.0
  *
- * Copyright (C) 2006-2021 Bruno Silvestre
+ * Copyright (C) 2006-2022 Bruno Silvestre
  *
  *--------------------------------------------------------------------------*/
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/src/config.c 
new/luasec-1.2.0/src/config.c
--- old/luasec-1.0.2/src/config.c       2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/src/config.c       2022-07-30 13:42:53.000000000 +0200
@@ -1,7 +1,7 @@
 /*--------------------------------------------------------------------------
- * LuaSec 1.0.2
+ * LuaSec 1.2.0
  *
- * Copyright (C) 2006-2021 Bruno Silvestre.
+ * Copyright (C) 2006-2022 Bruno Silvestre.
  *
  *--------------------------------------------------------------------------*/
 
@@ -77,8 +77,15 @@
 #ifdef LSEC_ENABLE_DANE
   // DANE
   lua_pushstring(L, "dane");
+#ifdef DANE_FLAG_NO_DANE_EE_NAMECHECKS
+  lua_createtable(L, 0, 1);
+  lua_pushstring(L, "no_ee_namechecks");
   lua_pushboolean(L, 1);
   lua_rawset(L, -3);
+#else
+  lua_pushboolean(L, 1);
+#endif
+  lua_rawset(L, -3);
 #endif
 
 #ifndef OPENSSL_NO_EC
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/src/context.c 
new/luasec-1.2.0/src/context.c
--- old/luasec-1.0.2/src/context.c      2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/src/context.c      2022-07-30 13:42:53.000000000 +0200
@@ -1,9 +1,9 @@
 /*--------------------------------------------------------------------------
- * LuaSec 1.0.2
+ * LuaSec 1.2.0
  *
- * Copyright (C) 2014-2021 Kim Alvefur, Paul Aurich, Tobias Markmann, 
+ * Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann, 
  *                         Matthew Wild.
- * Copyright (C) 2006-2021 Bruno Silvestre.
+ * Copyright (C) 2006-2022 Bruno Silvestre.
  *
  *--------------------------------------------------------------------------*/
 
@@ -17,6 +17,7 @@
 #include <openssl/err.h>
 #include <openssl/x509.h>
 #include <openssl/x509v3.h>
+#include <openssl/x509_vfy.h>
 #include <openssl/dh.h>
 
 #include <lua.h>
@@ -711,11 +712,31 @@
 /*
  * DANE
  */
+static int dane_options[] = {
+  /* TODO move into options.c
+   * however this symbol is not from openssl/ssl.h but rather from
+   * openssl/x509_vfy.h
+   * */
+#ifdef DANE_FLAG_NO_DANE_EE_NAMECHECKS
+  DANE_FLAG_NO_DANE_EE_NAMECHECKS,
+#endif
+  0
+};
+static const char *dane_option_names[] = {
+#ifdef DANE_FLAG_NO_DANE_EE_NAMECHECKS
+  "no_ee_namechecks",
+#endif
+  NULL
+};
+
 static int set_dane(lua_State *L)
 {
-  int ret;
+  int ret, i;
   SSL_CTX *ctx = lsec_checkcontext(L, 1);
   ret = SSL_CTX_dane_enable(ctx);
+  for (i = 2; ret > 0 && i <= lua_gettop(L); i++) {
+    ret = SSL_CTX_dane_set_flags(ctx, dane_options[luaL_checkoption(L, i, 
NULL, dane_option_names)]);
+  }
   lua_pushboolean(L, (ret > 0));
   return 1;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/src/context.h 
new/luasec-1.2.0/src/context.h
--- old/luasec-1.0.2/src/context.h      2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/src/context.h      2022-07-30 13:42:53.000000000 +0200
@@ -2,9 +2,9 @@
 #define LSEC_CONTEXT_H
 
 /*--------------------------------------------------------------------------
- * LuaSec 1.0.2
+ * LuaSec 1.2.0
  *
- * Copyright (C) 2006-2021 Bruno Silvestre
+ * Copyright (C) 2006-2022 Bruno Silvestre
  *
  *--------------------------------------------------------------------------*/
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/src/ec.h new/luasec-1.2.0/src/ec.h
--- old/luasec-1.0.2/src/ec.h   2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/src/ec.h   2022-07-30 13:42:53.000000000 +0200
@@ -1,7 +1,7 @@
 /*--------------------------------------------------------------------------
- * LuaSec 1.0.2
+ * LuaSec 1.2.0
  *
- * Copyright (C) 2006-2021 Bruno Silvestre
+ * Copyright (C) 2006-2022 Bruno Silvestre
  *
  *--------------------------------------------------------------------------*/
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/src/https.lua 
new/luasec-1.2.0/src/https.lua
--- old/luasec-1.0.2/src/https.lua      2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/src/https.lua      2022-07-30 13:42:53.000000000 +0200
@@ -1,6 +1,6 @@
 ----------------------------------------------------------------------------
--- LuaSec 1.0.2
--- Copyright (C) 2009-2021 PUC-Rio
+-- LuaSec 1.2.0
+-- Copyright (C) 2009-2022 PUC-Rio
 --
 -- Author: Pablo Musa
 -- Author: Tomas Guisasola
@@ -18,8 +18,8 @@
 -- Module
 --
 local _M = {
-  _VERSION   = "1.0.2",
-  _COPYRIGHT = "LuaSec 1.0.2 - Copyright (C) 2009-2021 PUC-Rio",
+  _VERSION   = "1.2.0",
+  _COPYRIGHT = "LuaSec 1.2.0 - Copyright (C) 2009-2022 PUC-Rio",
   PORT       = 443,
   TIMEOUT    = 60
 }
@@ -93,7 +93,7 @@
          self.sock:sni(host)
          self.sock:settimeout(_M.TIMEOUT)
          try(self.sock:dohandshake())
-         reg(self, getmetatable(self.sock))
+         reg(self)
          return 1
       end
       return conn
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/src/options.c 
new/luasec-1.2.0/src/options.c
--- old/luasec-1.0.2/src/options.c      2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/src/options.c      2022-07-30 13:42:53.000000000 +0200
@@ -1,7 +1,7 @@
 /*--------------------------------------------------------------------------
- * LuaSec 1.0.2
+ * LuaSec 1.2.0
  *
- * Copyright (C) 2006-2021 Bruno Silvestre
+ * Copyright (C) 2006-2022 Bruno Silvestre
  *
  *--------------------------------------------------------------------------*/
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/src/options.h 
new/luasec-1.2.0/src/options.h
--- old/luasec-1.0.2/src/options.h      2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/src/options.h      2022-07-30 13:42:53.000000000 +0200
@@ -2,9 +2,9 @@
 #define LSEC_OPTIONS_H
 
 /*--------------------------------------------------------------------------
- * LuaSec 1.0.2
+ * LuaSec 1.2.0
  *
- * Copyright (C) 2006-2021 Bruno Silvestre
+ * Copyright (C) 2006-2022 Bruno Silvestre
  *
  *--------------------------------------------------------------------------*/
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/src/options.lua 
new/luasec-1.2.0/src/options.lua
--- old/luasec-1.0.2/src/options.lua    2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/src/options.lua    2022-07-30 13:42:53.000000000 +0200
@@ -18,9 +18,9 @@
 local function generate(options, version)
   print([[
 /*--------------------------------------------------------------------------
- * LuaSec 1.1.1
+ * LuaSec 1.2.0
  *
- * Copyright (C) 2006-2021 Bruno Silvestre
+ * Copyright (C) 2006-2022 Bruno Silvestre
  *
  *--------------------------------------------------------------------------*/
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/src/ssl.c new/luasec-1.2.0/src/ssl.c
--- old/luasec-1.0.2/src/ssl.c  2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/src/ssl.c  2022-07-30 13:42:53.000000000 +0200
@@ -1,9 +1,9 @@
 /*--------------------------------------------------------------------------
- * LuaSec 1.0.2
+ * LuaSec 1.2.0
  *
- * Copyright (C) 2014-2021 Kim Alvefur, Paul Aurich, Tobias Markmann, 
+ * Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann, 
  *                         Matthew Wild.
- * Copyright (C) 2006-2021 Bruno Silvestre.
+ * Copyright (C) 2006-2022 Bruno Silvestre.
  *
  *--------------------------------------------------------------------------*/
 
@@ -672,6 +672,41 @@
 }
 
 /**
+ * Get some shared keying material
+ */
+static int meth_exportkeyingmaterial(lua_State *L)
+{
+  p_ssl ssl = (p_ssl)luaL_checkudata(L, 1, "SSL:Connection");
+
+  if(ssl->state != LSEC_STATE_CONNECTED) {
+    lua_pushnil(L);
+    lua_pushstring(L, "closed");
+    return 0;
+  }
+
+  size_t llen = 0;
+  size_t contextlen = 0;
+  const unsigned char *context = NULL;
+  const char *label = (const char*)luaL_checklstring(L, 2, &llen);
+  size_t olen = (size_t)luaL_checkinteger(L, 3);
+
+  if (!lua_isnoneornil(L, 4))
+    context = (const unsigned char*)luaL_checklstring(L, 4, &contextlen);
+
+  /* Temporary buffer memory-managed by Lua itself */
+  unsigned char *out = (unsigned char*)lua_newuserdata(L, olen);
+
+  if(SSL_export_keying_material(ssl->ssl, out, olen, label, llen, context, 
contextlen, context != NULL) != 1) {
+    lua_pushnil(L);
+    lua_pushstring(L, "error exporting keying material");
+    return 2;
+  }
+
+  lua_pushlstring(L, (char*)out, olen);
+  return 1;
+}
+
+/**
  * Object information -- tostring metamethod
  */
 static int meth_tostring(lua_State *L)
@@ -826,7 +861,7 @@
 
 static int meth_copyright(lua_State *L)
 {
-  lua_pushstring(L, "LuaSec 1.0.2 - Copyright (C) 2006-2021 Bruno Silvestre, 
UFG"
+  lua_pushstring(L, "LuaSec 1.2.0 - Copyright (C) 2006-2022 Bruno Silvestre, 
UFG"
 #if defined(WITH_LUASOCKET)
                     "\nLuaSocket 3.0-RC1 - Copyright (C) 2004-2013 Diego Nehab"
 #endif
@@ -876,6 +911,7 @@
   {"getpeerchain",        meth_getpeerchain},
   {"getpeerverification", meth_getpeerverification},
   {"getpeerfinished",     meth_getpeerfinished},
+  {"exportkeyingmaterial",meth_exportkeyingmaterial},
   {"getsniname",          meth_getsniname},
   {"getstats",            meth_getstats},
   {"setstats",            meth_setstats},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/src/ssl.h new/luasec-1.2.0/src/ssl.h
--- old/luasec-1.0.2/src/ssl.h  2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/src/ssl.h  2022-07-30 13:42:53.000000000 +0200
@@ -2,9 +2,9 @@
 #define LSEC_SSL_H
 
 /*--------------------------------------------------------------------------
- * LuaSec 1.0.2
+ * LuaSec 1.2.0
  *
- * Copyright (C) 2006-2021 Bruno Silvestre
+ * Copyright (C) 2006-2022 Bruno Silvestre
  *
  *--------------------------------------------------------------------------*/
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/src/ssl.lua new/luasec-1.2.0/src/ssl.lua
--- old/luasec-1.0.2/src/ssl.lua        2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/src/ssl.lua        2022-07-30 13:42:53.000000000 +0200
@@ -1,7 +1,7 @@
 ------------------------------------------------------------------------------
--- LuaSec 1.0.2
+-- LuaSec 1.2.0
 --
--- Copyright (C) 2006-2021 Bruno Silvestre
+-- Copyright (C) 2006-2022 Bruno Silvestre
 --
 ------------------------------------------------------------------------------
 
@@ -202,7 +202,11 @@
    end
 
    if config.capabilities.dane and cfg.dane then
-      context.setdane(ctx)
+      if type(cfg.dane) == "table" then
+         context.setdane(ctx, unpack(cfg.dane))
+      else
+         context.setdane(ctx)
+      end
    end
 
    return ctx
@@ -271,7 +275,7 @@
 --
 
 local _M = {
-  _VERSION        = "1.0.2",
+  _VERSION        = "1.2.0",
   _COPYRIGHT      = core.copyright(),
   config          = config,
   loadcertificate = x509.load,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/src/x509.c new/luasec-1.2.0/src/x509.c
--- old/luasec-1.0.2/src/x509.c 2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/src/x509.c 2022-07-30 13:42:53.000000000 +0200
@@ -1,7 +1,7 @@
 /*--------------------------------------------------------------------------
- * LuaSec 1.0.2
+ * LuaSec 1.2.0
  *
- * Copyright (C) 2014-2021 Kim Alvefur, Paul Aurich, Tobias Markmann
+ * Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann
  *                         Matthew Wild, Bruno Silvestre.
  *
  *--------------------------------------------------------------------------*/
@@ -655,6 +655,7 @@
   return 1;
 }
 
+#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL)
 /**
  * Get signature name.
  */
@@ -669,6 +670,7 @@
     lua_pushstring(L, name);
   return 1;
 }
+#endif
 
 /*---------------------------------------------------------------------------*/
 
@@ -698,7 +700,9 @@
   {"digest",     meth_digest},
   {"setencode",  meth_set_encode},
   {"extensions", meth_extensions},
+#if (OPENSSL_VERSION_NUMBER >= 0x1010000fL)
   {"getsignaturename", meth_get_signature_name},
+#endif
   {"issuer",     meth_issuer},
   {"notbefore",  meth_notbefore},
   {"notafter",   meth_notafter},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/luasec-1.0.2/src/x509.h new/luasec-1.2.0/src/x509.h
--- old/luasec-1.0.2/src/x509.h 2021-08-14 15:28:09.000000000 +0200
+++ new/luasec-1.2.0/src/x509.h 2022-07-30 13:42:53.000000000 +0200
@@ -1,7 +1,7 @@
 /*--------------------------------------------------------------------------
- * LuaSec 1.0.2
+ * LuaSec 1.2.0
  *
- * Copyright (C) 2014-2021 Kim Alvefur, Paul Aurich, Tobias Markmann
+ * Copyright (C) 2014-2022 Kim Alvefur, Paul Aurich, Tobias Markmann
  *                         Matthew Wild, Bruno Silvestre.
  *
  *--------------------------------------------------------------------------*/

Reply via email to