Ejemplo n.º 1
0
static int openssl_xext_new(lua_State* L)
{
  X509_EXTENSION *x=NULL;
  int utf8;
  luaL_checktable(L,1);
  utf8 = lua_isnoneornil(L, 2) ? 1 : lua_toboolean(L, 2);

  x = openssl_new_xextension(L, &x, 1, utf8);
  PUSH_OBJECT(x,"openssl.x509_extension");
  return 1;
};
Ejemplo n.º 2
0
static int openssl_xext_new(lua_State* L)
{
  X509_EXTENSION *x = NULL;
  int v3 = 1;
  luaL_checktable(L, 1);
  if (!lua_isnone(L, 2))
    v3 = lua_toboolean(L, 2);
  x = openssl_new_xextension(L, 1, v3);
  if (x)
  {
    PUSH_OBJECT(x, "openssl.x509_extension");
  }
  else
    lua_pushnil(L);

  return 1;
};
Ejemplo n.º 3
0
static int openssl_xext_new_sk(lua_State* L)
{
  size_t i;
  X509_EXTENSION *x=NULL;
  STACK_OF(X509_EXTENSION) *exts;
  int utf8 = lua_isnoneornil(L, 2) ? 1 : lua_toboolean(L, 2);
  
  luaL_checktable(L,1);
  exts = sk_X509_EXTENSION_new_null();

  for (i=0; i<lua_objlen(L, 1); i++)
  {
    lua_rawgeti(L,1, i+1);
    x = openssl_new_xextension(L, NULL, -1, utf8);
    sk_X509_EXTENSION_push(exts, x);
  }
  PUSH_OBJECT(exts, "openssl.stack_of_x509_extension");
  return 1;
};
Ejemplo n.º 4
0
static int openssl_xext_new_sk(lua_State* L)
{
  size_t i;
  X509_EXTENSION *x = NULL;
  STACK_OF(X509_EXTENSION) *exts;
  int v3 = 1;
  luaL_checktable(L, 1);
  if (!lua_isnone(L, 2))
    v3 = lua_toboolean(L, 2);

  exts = sk_X509_EXTENSION_new_null();

  for (i = 0; i < lua_rawlen(L, 1); i++)
  {
    lua_rawgeti(L, 1, i + 1);
    x = openssl_new_xextension(L, lua_gettop(L), v3);
    if (x)
      sk_X509_EXTENSION_push(exts, x);
  }
  PUSH_OBJECT(exts, "openssl.stack_of_x509_extension");
  return 1;
};