• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ASN1_item_free函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ASN1_item_free函数的典型用法代码示例。如果您正苦于以下问题:C++ ASN1_item_free函数的具体用法?C++ ASN1_item_free怎么用?C++ ASN1_item_free使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ASN1_item_free函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: do_ext_nconf

/* char *value:  Value    */
static X509_EXTENSION *
do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, int crit, char *value)
{
	const X509V3_EXT_METHOD *method;
	X509_EXTENSION *ext;
	STACK_OF(CONF_VALUE) *nval;
	void *ext_struc;

	if (ext_nid == NID_undef) {
		X509V3err(X509V3_F_DO_EXT_NCONF,
		    X509V3_R_UNKNOWN_EXTENSION_NAME);
		return NULL;
	}
	if (!(method = X509V3_EXT_get_nid(ext_nid))) {
		X509V3err(X509V3_F_DO_EXT_NCONF, X509V3_R_UNKNOWN_EXTENSION);
		return NULL;
	}
	/* Now get internal extension representation based on type */
	if (method->v2i) {
		if (*value == '@')
			nval = NCONF_get_section(conf, value + 1);
		else
			nval = X509V3_parse_list(value);
		if (sk_CONF_VALUE_num(nval) <= 0) {
			X509V3err(X509V3_F_DO_EXT_NCONF,
			    X509V3_R_INVALID_EXTENSION_STRING);
			ERR_asprintf_error_data("name=%s,section=%s",
			    OBJ_nid2sn(ext_nid), value);
			return NULL;
		}
		ext_struc = method->v2i(method, ctx, nval);
		if (*value != '@')
			sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);
		if (!ext_struc)
			return NULL;
	} else if (method->s2i) {
		if (!(ext_struc = method->s2i(method, ctx, value)))
			return NULL;
	} else if (method->r2i) {
		if (!ctx->db || !ctx->db_meth) {
			X509V3err(X509V3_F_DO_EXT_NCONF,
			    X509V3_R_NO_CONFIG_DATABASE);
			return NULL;
		}
		if (!(ext_struc = method->r2i(method, ctx, value)))
			return NULL;
	} else {
		X509V3err(X509V3_F_DO_EXT_NCONF,
		    X509V3_R_EXTENSION_SETTING_NOT_SUPPORTED);
		ERR_asprintf_error_data("name=%s", OBJ_nid2sn(ext_nid));
		return NULL;
	}

	ext = do_ext_i2d(method, ext_nid, crit, ext_struc);
	if (method->it)
		ASN1_item_free(ext_struc, ASN1_ITEM_ptr(method->it));
	else
		method->ext_free(ext_struc);
	return ext;
}
开发者ID:SylvestreG,项目名称:bitrig,代码行数:61,代码来源:v3_conf.c


示例2: FuzzerTestOneInput

int FuzzerTestOneInput(const uint8_t *buf, size_t len) {
    for (int n = 0; item_type[n] != NULL; ++n) {
        const uint8_t *b = buf;
        ASN1_VALUE *o = ASN1_item_d2i(NULL, &b, len, item_type[n]);
        ASN1_item_free(o, item_type[n]);
    }
    return 0;
}
开发者ID:1234-,项目名称:openssl,代码行数:8,代码来源:asn1.c


示例3: X509V3_EXT_free

int X509V3_EXT_free(int nid, void *ext_data)
{
    const X509V3_EXT_METHOD *ext_method = X509V3_EXT_get_nid(nid);
    if (ext_method == NULL) {
        OPENSSL_PUT_ERROR(X509V3, X509V3_R_CANNOT_FIND_FREE_FUNCTION);
        return 0;
    }

    if (ext_method->it != NULL)
        ASN1_item_free(ext_data, ASN1_ITEM_ptr(ext_method->it));
    else if (ext_method->ext_free != NULL)
        ext_method->ext_free(ext_data);
    else {
        OPENSSL_PUT_ERROR(X509V3, X509V3_R_CANNOT_FIND_FREE_FUNCTION);
        return 0;
    }

    return 1;
}
开发者ID:0x64616E69656C,项目名称:boringssl,代码行数:19,代码来源:v3_lib.c


示例4: NETSCAPE_SPKAC_free

void
NETSCAPE_SPKAC_free(NETSCAPE_SPKAC *a)
{
	ASN1_item_free((ASN1_VALUE *)a, &NETSCAPE_SPKAC_it);
}
开发者ID:2trill2spill,项目名称:nextgen,代码行数:5,代码来源:x_spki.c


示例5: ESS_SIGNING_CERT_free

void
ESS_SIGNING_CERT_free(ESS_SIGNING_CERT *a)
{
	ASN1_item_free((ASN1_VALUE *)a, &ESS_SIGNING_CERT_it);
}
开发者ID:Heratom,项目名称:Firefly-project,代码行数:5,代码来源:ts_asn1.c


示例6: X509_ATTRIBUTE_free

void
X509_ATTRIBUTE_free(X509_ATTRIBUTE *a)
{
	ASN1_item_free((ASN1_VALUE *)a, &X509_ATTRIBUTE_it);
}
开发者ID:MiKTeX,项目名称:miktex,代码行数:5,代码来源:x_attrib.c


示例7: X509_free

void
X509_free(X509 *a)
{
	ASN1_item_free((ASN1_VALUE *)a, &X509_it);
}
开发者ID:robertbachmann,项目名称:openbsd-libssl,代码行数:5,代码来源:x_x509.c


示例8: PKCS12_SAFEBAG_free

void
PKCS12_SAFEBAG_free(PKCS12_SAFEBAG *a)
{
	ASN1_item_free((ASN1_VALUE *)a, &PKCS12_SAFEBAG_it);
}
开发者ID:mr-moai-2016,项目名称:znk_project,代码行数:5,代码来源:p12_asn.c


示例9: PKCS12_MAC_DATA_free

void
PKCS12_MAC_DATA_free(PKCS12_MAC_DATA *a)
{
	ASN1_item_free((ASN1_VALUE *)a, &PKCS12_MAC_DATA_it);
}
开发者ID:mr-moai-2016,项目名称:znk_project,代码行数:5,代码来源:p12_asn.c


示例10: PROXY_POLICY_free

void
PROXY_POLICY_free(PROXY_POLICY *a)
{
	ASN1_item_free((ASN1_VALUE *)a, &PROXY_POLICY_it);
}
开发者ID:MiKTeX,项目名称:miktex,代码行数:5,代码来源:v3_pcia.c


示例11: EDIPARTYNAME_free

void
EDIPARTYNAME_free(EDIPARTYNAME *a)
{
	ASN1_item_free((ASN1_VALUE *)a, &EDIPARTYNAME_it);
}
开发者ID:2trill2spill,项目名称:nextgen,代码行数:5,代码来源:v3_genn.c


示例12: OTHERNAME_free

void
OTHERNAME_free(OTHERNAME *a)
{
	ASN1_item_free((ASN1_VALUE *)a, &OTHERNAME_it);
}
开发者ID:2trill2spill,项目名称:nextgen,代码行数:5,代码来源:v3_genn.c


示例13: ASN1_INTEGER_free

void ASN1_INTEGER_free(ASN1_INTEGER *a)
{
    ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(ASN1_INTEGER));
}
开发者ID:kobemiller,项目名称:mycode,代码行数:4,代码来源:asn1_note.c


示例14: X509_EXTENSION_free

void
X509_EXTENSION_free(X509_EXTENSION *a)
{
	ASN1_item_free((ASN1_VALUE *)a, &X509_EXTENSION_it);
}
开发者ID:Heratom,项目名称:Firefly-project,代码行数:5,代码来源:x_exten.c


示例15: X509_PUBKEY_free

void
X509_PUBKEY_free(X509_PUBKEY *a)
{
	ASN1_item_free((ASN1_VALUE *)a, &X509_PUBKEY_it);
}
开发者ID:mr-moai-2016,项目名称:znk_project,代码行数:5,代码来源:x_pubkey.c


示例16: openssl_new_xextension

static X509_EXTENSION* openssl_new_xextension(lua_State*L, int idx, int v3)
{
  int nid;
  int critical = 0;
  ASN1_OCTET_STRING* value = NULL;
  X509_EXTENSION* y = NULL;

  lua_getfield(L, idx, "object");
  nid = openssl_get_nid(L, -1);
  lua_pop(L, 1);

  lua_getfield(L, idx, "critical");
  critical = lua_isnil(L, -1) ? 0 : lua_toboolean(L, -1);
  lua_pop(L, 1);

  if (nid == NID_undef)
  {
    lua_pushfstring(L, "%s is not valid object id", lua_tostring(L, -1));
    luaL_argerror(L, idx, lua_tostring(L, -1));
  }
  lua_getfield(L, idx, "value");

  luaL_argcheck(L, lua_isstring(L, -1) || auxiliar_isgroup(L, "openssl.asn1group", -1),
                1, "field value must be string or openssl.asn1group object");
  if (lua_isstring(L, -1))
  {
    size_t size;
    const char* data = lua_tolstring(L, -1, &size);
    if (v3)
    {
      const X509V3_EXT_METHOD *method = X509V3_EXT_get_nid(nid);
      if (method)
      {
        void *ext_struc = NULL;
        STACK_OF(CONF_VALUE) *nval = X509V3_parse_list(data);
        /* Now get internal extension representation based on type */
        if (method->v2i && nval)
        {
          if (sk_CONF_VALUE_num(nval) > 0)
          {
            ext_struc = method->v2i(method, NULL, nval);
          }
        }
        else if (method->s2i)
        {
          ext_struc = method->s2i(method, NULL, data);
        }
        if (nval)
          sk_CONF_VALUE_pop_free(nval, X509V3_conf_free);

        if (ext_struc)
        {
          unsigned char *ext_der = NULL;
          int ext_len;
          /* Convert internal representation to DER */
          if (method->it)
          {
            ext_der = NULL;
            ext_len = ASN1_item_i2d(ext_struc, &ext_der, ASN1_ITEM_ptr(method->it));
            if (ext_len < 0)
            {
              ext_der = NULL;
            }
          }
          else
          {
            ext_len = method->i2d(ext_struc, NULL);
            ext_der = OPENSSL_malloc(ext_len);
            if (ext_der)
            {
              unsigned char* p = ext_der;
              method->i2d(ext_struc, &p);
            }
          }
          if (ext_der)
          {
            value = ASN1_STRING_type_new(V_ASN1_OCTET_STRING);
            ASN1_STRING_set(value, ext_der, ext_len);
          }
          else
            value = NULL;

          if (method->it) ASN1_item_free(ext_struc, ASN1_ITEM_ptr(method->it));
          else method->ext_free(ext_struc);
        }
      }
    }
    else
    {
      value = ASN1_STRING_type_new(V_ASN1_OCTET_STRING);
      ASN1_STRING_set(value, data, size);
    }
    if (value)
    {
      y = X509_EXTENSION_create_by_NID(NULL, nid, critical, value);
      ASN1_STRING_free(value);
      return y;
    }
    else
    {
//.........这里部分代码省略.........
开发者ID:witchu,项目名称:lua-openssl,代码行数:101,代码来源:xexts.c


示例17: TS_MSG_IMPRINT_free

void
TS_MSG_IMPRINT_free(TS_MSG_IMPRINT *a)
{
	ASN1_item_free((ASN1_VALUE *)a, &TS_MSG_IMPRINT_it);
}
开发者ID:Heratom,项目名称:Firefly-project,代码行数:5,代码来源:ts_asn1.c


示例18: NETSCAPE_SPKI_free

void
NETSCAPE_SPKI_free(NETSCAPE_SPKI *a)
{
	ASN1_item_free((ASN1_VALUE *)a, &NETSCAPE_SPKI_it);
}
开发者ID:2trill2spill,项目名称:nextgen,代码行数:5,代码来源:x_spki.c


示例19: PROXY_CERT_INFO_EXTENSION_free

void
PROXY_CERT_INFO_EXTENSION_free(PROXY_CERT_INFO_EXTENSION *a)
{
	ASN1_item_free((ASN1_VALUE *)a, &PROXY_CERT_INFO_EXTENSION_it);
}
开发者ID:MiKTeX,项目名称:miktex,代码行数:5,代码来源:v3_pcia.c


示例20: GENERAL_NAMES_free

void
GENERAL_NAMES_free(GENERAL_NAMES *a)
{
	ASN1_item_free((ASN1_VALUE *)a, &GENERAL_NAMES_it);
}
开发者ID:2trill2spill,项目名称:nextgen,代码行数:5,代码来源:v3_genn.c



注:本文中的ASN1_item_free函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ASN1_item_i2d函数代码示例发布时间:2022-05-30
下一篇:
C++ ASN1_item_d2i_fp函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap