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

C++ BIO_snprintf函数代码示例

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

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



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

示例1: asn1_print_info

static int asn1_print_info(BIO *bp, int tag, int xclass, int constructed,
	     int indent)
	{
	static const char fmt[]="%-18s";
	char str[128];
	const char *p;

	if (constructed & V_ASN1_CONSTRUCTED)
		p="cons: ";
	else
		p="prim: ";
	if (BIO_write(bp,p,6) < 6) goto err;
	BIO_indent(bp,indent,128);

	p=str;
	if ((xclass & V_ASN1_PRIVATE) == V_ASN1_PRIVATE)
		BIO_snprintf(str,sizeof str,"priv [ %d ] ",tag);
	else if ((xclass & V_ASN1_CONTEXT_SPECIFIC) == V_ASN1_CONTEXT_SPECIFIC)
		BIO_snprintf(str,sizeof str,"cont [ %d ]",tag);
	else if ((xclass & V_ASN1_APPLICATION) == V_ASN1_APPLICATION)
		BIO_snprintf(str,sizeof str,"appl [ %d ]",tag);
	else if (tag > 30)
		BIO_snprintf(str,sizeof str,"<ASN1 %d>",tag);
	else
		p = ASN1_tag2str(tag);

	if (BIO_printf(bp,fmt,p) <= 0)
		goto err;
	return(1);
err:
	return(0);
	}
开发者ID:360ground,项目名称:Meda.et,代码行数:32,代码来源:asn1_par.c


示例2: ip_to_string

int ip_to_string(char* oline, int oline_len, GENERAL_NAME* gen)
{
  int i;
  unsigned char *p;
  char htmp[5];

  p = gen->d.ip->data;

  if(gen->d.ip->length == 4)
    BIO_snprintf(oline, oline_len,"%d.%d.%d.%d", p[0], p[1], p[2], p[3]);  //sizeof oline replaced by 40

  else if(gen->d.ip->length == 16){
    oline[0] = 0;
    for (i = 0; i < 8; i++){
      BIO_snprintf(htmp, sizeof htmp,"%X", p[0] << 8 | p[1]);
      p += 2;
      g_strlcat(oline, htmp, oline_len);
      if (i != 7) g_strlcat(oline, ":", oline_len);
    }
  }

  else{
    BIO_snprintf(oline, strlen((char*)oline), "IP Address <invalid>");
  }

  syslog(LOG_INFO,"IP is: %s",oline);

  return 0;

}
开发者ID:openwebos,项目名称:pmcertificatemgr,代码行数:30,代码来源:cert_x509.c


示例3: do_esc_char

static int do_esc_char(unsigned long c, unsigned char flags, char *do_quotes,
                       char_io *io_ch, void *arg)
{
    unsigned char chflgs, chtmp;
    char tmphex[HEX_SIZE(long) + 3];

    if (c > 0xffffffffL)
        return -1;
    if (c > 0xffff) {
        BIO_snprintf(tmphex, sizeof tmphex, "\\W%08lX", c);
        if (!io_ch(arg, tmphex, 10))
            return -1;
        return 10;
    }
    if (c > 0xff) {
        BIO_snprintf(tmphex, sizeof tmphex, "\\U%04lX", c);
        if (!io_ch(arg, tmphex, 6))
            return -1;
        return 6;
    }
    chtmp = (unsigned char)c;
    if (chtmp > 0x7f)
        chflgs = flags & ASN1_STRFLGS_ESC_MSB;
    else
        chflgs = char_type[chtmp] & flags;
    if (chflgs & CHARTYPE_BS_ESC) {
        /* If we don't escape with quotes, signal we need quotes */
        if (chflgs & ASN1_STRFLGS_ESC_QUOTE) {
            if (do_quotes)
                *do_quotes = 1;
            if (!io_ch(arg, &chtmp, 1))
                return -1;
            return 1;
        }
        if (!io_ch(arg, "\\", 1))
            return -1;
        if (!io_ch(arg, &chtmp, 1))
            return -1;
        return 2;
    }
    if (chflgs & (ASN1_STRFLGS_ESC_CTRL | ASN1_STRFLGS_ESC_MSB)) {
        BIO_snprintf(tmphex, 11, "\\%02X", chtmp);
        if (!io_ch(arg, tmphex, 3))
            return -1;
        return 3;
    }
    /*
     * If we get this far and do any escaping at all must escape the escape
     * character itself: backslash.
     */
    if (chtmp == '\\' && flags & ESC_FLAGS) {
        if (!io_ch(arg, "\\\\", 2))
            return -1;
        return 2;
    }
    if (!io_ch(arg, &chtmp, 1))
        return -1;
    return 1;
}
开发者ID:endlessm,项目名称:shim,代码行数:59,代码来源:a_strex.c


示例4: ERR_error_string_n

void ERR_error_string_n(unsigned long e, char *buf, size_t len)
{
    char lsbuf[64], fsbuf[64], rsbuf[64];
    const char *ls, *fs, *rs;
    unsigned long l, f, r;

    if (len == 0)
        return;

    l = ERR_GET_LIB(e);
    f = ERR_GET_FUNC(e);
    r = ERR_GET_REASON(e);

    ls = ERR_lib_error_string(e);
    fs = ERR_func_error_string(e);
    rs = ERR_reason_error_string(e);

    if (ls == NULL)
        BIO_snprintf(lsbuf, sizeof(lsbuf), "lib(%lu)", l);
    if (fs == NULL)
        BIO_snprintf(fsbuf, sizeof(fsbuf), "func(%lu)", f);
    if (rs == NULL)
        BIO_snprintf(rsbuf, sizeof(rsbuf), "reason(%lu)", r);

    BIO_snprintf(buf, len, "error:%08lX:%s:%s:%s", e, ls ? ls : lsbuf,
                 fs ? fs : fsbuf, rs ? rs : rsbuf);
    if (strlen(buf) == len - 1) {
        /*
         * output may be truncated; make sure we always have 5
         * colon-separated fields, i.e. 4 colons ...
         */
#define NUM_COLONS 4
        if (len > NUM_COLONS) { /* ... if possible */
            int i;
            char *s = buf;

            for (i = 0; i < NUM_COLONS; i++) {
                char *colon = strchr(s, ':');
                if (colon == NULL || colon > &buf[len - 1] - NUM_COLONS + i) {
                    /*
                     * set colon no. i at last possible position (buf[len-1]
                     * is the terminating 0)
                     */
                    colon = &buf[len - 1] - NUM_COLONS + i;
                    *colon = ':';
                }
                s = colon + 1;
            }
        }
    }
}
开发者ID:winstard,项目名称:GmSSL,代码行数:51,代码来源:err.c


示例5: if

ASN1_TIME *asn1_time_from_tm(ASN1_TIME *s, struct tm *ts, int type)
{
    char* p;
    ASN1_TIME *tmps = NULL;
    const size_t len = 20;

    if (type == V_ASN1_UNDEF) {
        if (is_utc(ts->tm_year))
            type = V_ASN1_UTCTIME;
        else
            type = V_ASN1_GENERALIZEDTIME;
    } else if (type == V_ASN1_UTCTIME) {
        if (!is_utc(ts->tm_year))
            goto err;
    } else if (type != V_ASN1_GENERALIZEDTIME) {
        goto err;
    }

    if (s == NULL)
        tmps = ASN1_STRING_new();
    else
        tmps = s;
    if (tmps == NULL)
        return NULL;

    if (!ASN1_STRING_set(tmps, NULL, len))
        goto err;

    tmps->type = type;
    p = (char*)tmps->data;

    if (type == V_ASN1_GENERALIZEDTIME)
        tmps->length = BIO_snprintf(p, len, "%04d%02d%02d%02d%02d%02dZ",
                                    ts->tm_year + 1900, ts->tm_mon + 1,
                                    ts->tm_mday, ts->tm_hour, ts->tm_min,
                                    ts->tm_sec);
    else
        tmps->length = BIO_snprintf(p, len, "%02d%02d%02d%02d%02d%02dZ",
                                    ts->tm_year % 100, ts->tm_mon + 1,
                                    ts->tm_mday, ts->tm_hour, ts->tm_min,
                                    ts->tm_sec);

#ifdef CHARSET_EBCDIC_not
    ebcdic2ascii(tmps->data, tmps->data, tmps->length);
#endif
    return tmps;
 err:
    if (tmps != s)
        ASN1_STRING_free(tmps);
    return NULL;
}
开发者ID:Ana06,项目名称:openssl,代码行数:51,代码来源:a_time.c


示例6: shouldfail

/*
 * See if the current malloc should fail.
 */
static int shouldfail(void)
{
    int roll = (int)(random() % 100);
    int shoulditfail = roll < md_fail_percent;
# ifndef _WIN32
/* suppressed on Windows as POSIX-like file descriptors are non-inheritable */
    int len;
    char buff[80];

    if (md_tracefd > 0) {
        BIO_snprintf(buff, sizeof(buff),
                     "%c C%ld %%%d R%d\n",
                     shoulditfail ? '-' : '+', md_count, md_fail_percent, roll);
        len = strlen(buff);
        if (write(md_tracefd, buff, len) != len)
            perror("shouldfail write failed");
#  ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
        if (shoulditfail) {
            void *addrs[30];
            int num = backtrace(addrs, OSSL_NELEM(addrs));

            backtrace_symbols_fd(addrs, num, md_tracefd);
        }
#  endif
    }
# endif

    if (md_count) {
        /* If we used up this one, go to the next. */
        if (--md_count == 0)
            parseit();
    }

    return shoulditfail;
}
开发者ID:ngoyal,项目名称:openssl,代码行数:38,代码来源:mem.c


示例7: file_find

static int file_find(OSSL_STORE_LOADER_CTX *ctx, OSSL_STORE_SEARCH *search)
{
    /*
     * If ctx == NULL, the library is looking to know if this loader supports
     * the given search type.
     */

    if (OSSL_STORE_SEARCH_get_type(search) == OSSL_STORE_SEARCH_BY_NAME) {
        unsigned long hash = 0;

        if (ctx == NULL)
            return 1;

        if (ctx->type != is_dir) {
            OSSL_STOREerr(OSSL_STORE_F_FILE_FIND,
                          OSSL_STORE_R_SEARCH_ONLY_SUPPORTED_FOR_DIRECTORIES);
            return 0;
        }

        hash = X509_NAME_hash(OSSL_STORE_SEARCH_get0_name(search));
        BIO_snprintf(ctx->_.dir.search_name, sizeof(ctx->_.dir.search_name),
                     "%08lx", hash);
        return 1;
    }

    if (ctx != NULL)
        OSSL_STOREerr(OSSL_STORE_F_FILE_FIND,
                      OSSL_STORE_R_UNSUPPORTED_SEARCH_TYPE);
    return 0;
}
开发者ID:InfoHunter,项目名称:openssl,代码行数:30,代码来源:loader_file.c


示例8: test_handshake

static int test_handshake(int idx)
{
    SETUP_SSL_TEST_FIXTURE();
    BIO_snprintf(fixture.test_app, sizeof(fixture.test_app),
                 "test-%d", idx);
    EXECUTE_SSL_TEST();
}
开发者ID:Bloody99,项目名称:openssl,代码行数:7,代码来源:ssl_test.c


示例9: padlock_bind_helper

/* Prepare the ENGINE structure for registration */
static int
padlock_bind_helper(ENGINE *e)
{
	/* Check available features */
	padlock_available();

#if 1	/* disable RNG for now, see commentary in vicinity of RNG code */
	padlock_use_rng=0;
#endif

	/* Generate a nice engine name with available features */
	BIO_snprintf(padlock_name, sizeof(padlock_name),
		"VIA PadLock (%s, %s)", 
		 padlock_use_rng ? "RNG" : "no-RNG",
		 padlock_use_ace ? "ACE" : "no-ACE");

	/* Register everything or return with an error */ 
	if (!ENGINE_set_id(e, padlock_id) ||
	    !ENGINE_set_name(e, padlock_name) ||

	    !ENGINE_set_init_function(e, padlock_init) ||
#ifndef OPENSSL_NO_AES
	    (padlock_use_ace && !ENGINE_set_ciphers (e, padlock_ciphers)) ||
#endif
	    (padlock_use_rng && !ENGINE_set_RAND (e, &padlock_rand))) {
		return 0;
	}

	/* Everything looks good */
	return 1;
}
开发者ID:dframework,项目名称:cpp-common,代码行数:32,代码来源:eng_padlock.c


示例10: padlock_bind_helper

/* Prepare the ENGINE structure for registration */
static int padlock_bind_helper(ENGINE *e)
{
    /* Check available features */
    padlock_available();

    /*
     * RNG is currently disabled for reasons discussed in commentary just
     * before padlock_rand_bytes function.
     */
    padlock_use_rng = 0;

    /* Generate a nice engine name with available features */
    BIO_snprintf(padlock_name, sizeof(padlock_name),
                 "VIA PadLock (%s, %s)",
                 padlock_use_rng ? "RNG" : "no-RNG",
                 padlock_use_ace ? "ACE" : "no-ACE");

    /* Register everything or return with an error */
    if (!ENGINE_set_id(e, padlock_id) ||
        !ENGINE_set_name(e, padlock_name) ||
        !ENGINE_set_init_function(e, padlock_init) ||
#   ifndef OPENSSL_NO_AES
        (padlock_use_ace && !ENGINE_set_ciphers(e, padlock_ciphers)) ||
#   endif
        (padlock_use_rng && !ENGINE_set_RAND(e, &padlock_rand))) {
        return 0;
    }

    /* Everything looks good */
    return 1;
}
开发者ID:Dmitry-Me,项目名称:openssl,代码行数:32,代码来源:e_padlock.c


示例11: nss_cmd_evp_cert

static int
nss_cmd_evp_cert(NSS_CTX *ctx, void *p) {
    NSS_KEYCTX *keyctx = NULL;
    struct {
        EVP_PKEY *pkey;
        X509 *x509;
    } *param = p;

    switch (param->pkey->type) {
    case EVP_PKEY_RSA: {
        RSA *pkey_rsa = EVP_PKEY_get1_RSA(param->pkey);
        keyctx = RSA_get_ex_data(pkey_rsa, nss_rsa_ctx_index);
        RSA_free(pkey_rsa);
        } break;
    case EVP_PKEY_DSA: {
        DSA *pkey_dsa = EVP_PKEY_get1_DSA(param->pkey);
        keyctx = DSA_get_ex_data(pkey_dsa, nss_dsa_ctx_index);
        DSA_free(pkey_dsa);
        } break;
    default: {
        NSSerr(NSS_F_CMD_EVP_CERT, NSS_R_UNSUPPORTED_KEYTYPE);
        { /* add extra error message data */
            char msgstr[10];
            BIO_snprintf(msgstr, sizeof(msgstr), "%d", param->pkey->type);
            ERR_add_error_data(2, "KEYTYPE=", msgstr);
        }
        } break;
    }

    param->x509 = X509_from_CERTCertificate(keyctx->cert);

    return(param->x509 ? 1 : 0);
}
开发者ID:BackupTheBerlios,项目名称:enss-svn,代码行数:33,代码来源:e_nss_cmd.c


示例12: ERR_print_errors_cb

void ERR_print_errors_cb(ERR_print_errors_callback_t callback, void *ctx) {
  CRYPTO_THREADID current_thread;
  char buf[ERR_ERROR_STRING_BUF_LEN];
  char buf2[1024];
  unsigned long thread_hash;
  const char *file;
  char *data;
  int line, flags;
  uint32_t packed_error;

  CRYPTO_THREADID_current(&current_thread);
  thread_hash = CRYPTO_THREADID_hash(&current_thread);

  for (;;) {
    packed_error = ERR_get_error_line_data(&file, &line, &data, &flags);
    if (packed_error == 0) {
      break;
    }

    ERR_error_string_n(packed_error, buf, sizeof(buf));
    BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", thread_hash, buf,
                 file, line, (flags & ERR_FLAG_STRING) ? data : "");
    if (callback(buf2, strlen(buf2), ctx) <= 0) {
      break;
    }
    if (flags & ERR_FLAG_MALLOCED) {
      OPENSSL_free(data);
    }
  }
}
开发者ID:xin3liang,项目名称:platform_external_chromium_org_third_party_boringssl_src,代码行数:30,代码来源:err.c


示例13: ERR_print_errors_cb

void ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
                         void *u)
{
    unsigned long l;
    char buf[256];
    char buf2[4096];
    const char *file, *data;
    int line, flags;
    /*
     * We don't know what kind of thing CRYPTO_THREAD_ID is. Here is our best
     * attempt to convert it into something we can print.
     */
    union {
        CRYPTO_THREAD_ID tid;
        unsigned long ltid;
    } tid;

    tid.ltid = 0;
    tid.tid = CRYPTO_THREAD_get_current_id();

    while ((l = ERR_get_error_line_data(&file, &line, &data, &flags)) != 0) {
        ERR_error_string_n(l, buf, sizeof(buf));
        BIO_snprintf(buf2, sizeof(buf2), "%lu:%s:%s:%d:%s\n", tid.ltid, buf,
                     file, line, (flags & ERR_TXT_STRING) ? data : "");
        if (cb(buf2, strlen(buf2), u) <= 0)
            break;              /* abort outputting the error report */
    }
}
开发者ID:AlexanderPankiv,项目名称:node,代码行数:28,代码来源:err_prn.c


示例14: BIO_snprintf

const char *SSLeay_version(int t)
	{
	if (t == SSLEAY_VERSION)
		return OPENSSL_VERSION_TEXT;
	if (t == SSLEAY_BUILT_ON)
		{
#ifdef DATE
		static char buf[sizeof(DATE)+11];

		BIO_snprintf(buf,sizeof buf,"built on: %s",DATE);
		return(buf);
#else
		return("built on: date not available");
#endif
		}
	if (t == SSLEAY_CFLAGS)
		{
#ifdef CFLAGS
		static char buf[sizeof(CFLAGS)+11];

		BIO_snprintf(buf,sizeof buf,"compiler: %s",CFLAGS);
		return(buf);
#else
		return("compiler: information not available");
#endif
		}
	if (t == SSLEAY_PLATFORM)
		{
#ifdef PLATFORM
		static char buf[sizeof(PLATFORM)+11];

		BIO_snprintf(buf,sizeof buf,"platform: %s", PLATFORM);
		return(buf);
#else
		return("platform: information not available");
#endif
		}
	if (t == SSLEAY_DIR)
		{
#ifdef OPENSSLDIR
		return "OPENSSLDIR: \"" OPENSSLDIR "\"";
#else
		return "OPENSSLDIR: N/A";
#endif
		}
	return("not available");
	}
开发者ID:ayufan,项目名称:openssl-win32,代码行数:47,代码来源:cuversion.c


示例15: psk_client_cb

static unsigned int psk_client_cb(SSL *ssl, const char *hint, char *identity,
                                  unsigned int max_identity_len,
                                  unsigned char *psk,
                                  unsigned int max_psk_len)
{
    unsigned int psk_len = 0;
    int ret;
    BIGNUM *bn = NULL;

    if (c_debug)
        BIO_printf(bio_c_out, "psk_client_cb\n");
    if (!hint) {
        /* no ServerKeyExchange message */
        if (c_debug)
            BIO_printf(bio_c_out,
                       "NULL received PSK identity hint, continuing anyway\n");
    } else if (c_debug)
        BIO_printf(bio_c_out, "Received PSK identity hint '%s'\n", hint);

    /*
     * lookup PSK identity and PSK key based on the given identity hint here
     */
    ret = BIO_snprintf(identity, max_identity_len, "%s", psk_identity);
    if (ret < 0 || (unsigned int)ret > max_identity_len)
        goto out_err;
    if (c_debug)
        BIO_printf(bio_c_out, "created identity '%s' len=%d\n", identity,
                   ret);
    ret = BN_hex2bn(&bn, psk_key);
    if (!ret) {
        BIO_printf(bio_err, "Could not convert PSK key '%s' to BIGNUM\n",
                   psk_key);
        if (bn)
            BN_free(bn);
        return 0;
    }

    if ((unsigned int)BN_num_bytes(bn) > max_psk_len) {
        BIO_printf(bio_err,
                   "psk buffer of callback is too small (%d) for key (%d)\n",
                   max_psk_len, BN_num_bytes(bn));
        BN_free(bn);
        return 0;
    }

    psk_len = BN_bn2bin(bn, psk);
    BN_free(bn);
    if (psk_len == 0)
        goto out_err;

    if (c_debug)
        BIO_printf(bio_c_out, "created PSK len=%d\n", psk_len);

    return psk_len;
 out_err:
    if (c_debug)
        BIO_printf(bio_err, "Error in PSK client callback\n");
    return 0;
}
开发者ID:steverandy,项目名称:node,代码行数:59,代码来源:s_client.c


示例16: return

ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s,
	     time_t t, int offset_day, long offset_sec)
	{
	ASN1_GENERALIZEDTIME *alloced = NULL;

	char *p;
	struct tm *ts;
	struct tm data;
	size_t len = 20; 

	if (s == NULL)
		alloced = s=M_ASN1_GENERALIZEDTIME_new();
	if (s == NULL)
		return(NULL);

	ts=OPENSSL_gmtime(&t, &data);
	if (ts == NULL)
	{
		if(alloced)
			M_ASN1_GENERALIZEDTIME_free(alloced);
		return(NULL);
	}

	if (offset_day || offset_sec)
		{ 
		if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec))
			{
			if(alloced)
				M_ASN1_GENERALIZEDTIME_free(alloced);
			return NULL;
			}
		}

	p=(char *)s->data;
	if ((p == NULL) || ((size_t)s->length < len))
		{
		p= (char *) OPENSSL_malloc(len);
		if (p == NULL)
			{
			if(alloced)
				M_ASN1_GENERALIZEDTIME_free(alloced);
			ASN1err(ASN1_F_ASN1_GENERALIZEDTIME_ADJ,
				ERR_R_MALLOC_FAILURE);
			return(NULL);
			}
		if (s->data != NULL)
			OPENSSL_free(s->data);
		s->data=(unsigned char *)p;
		}

	BIO_snprintf(p,len,"%04d%02d%02d%02d%02d%02dZ",ts->tm_year + 1900,
		     ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
	s->length=op_strlen(p);
	s->type=V_ASN1_GENERALIZEDTIME;
#ifdef CHARSET_EBCDIC_not
	ebcdic2ascii(s->data, s->data, s->length);
#endif
	return(s);
	}
开发者ID:prestocore,项目名称:browser,代码行数:59,代码来源:a_gentm.c


示例17: ASN1err

ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t,
				int offset_day, long offset_sec)
	{
	char *p;
	struct tm *ts;
	struct tm data;
	size_t len = 20;
	int free_s = 0;

	if (s == NULL)
		{
		free_s = 1;
		s=M_ASN1_UTCTIME_new();
		}
	if (s == NULL)
		goto err;


	ts=OPENSSL_gmtime(&t, &data);
	if (ts == NULL)
		goto err;

	if (offset_day || offset_sec)
		{ 
		if (!OPENSSL_gmtime_adj(ts, offset_day, offset_sec))
			goto err;
		}

	if((ts->tm_year < 50) || (ts->tm_year >= 150))
		goto err;

	p=(char *)s->data;
	if ((p == NULL) || ((size_t)s->length < len))
		{
		p=OPENSSL_malloc(len);
		if (p == NULL)
			{
			ASN1err(ASN1_F_ASN1_UTCTIME_ADJ,ERR_R_MALLOC_FAILURE);
			goto err;
			}
		if (s->data != NULL)
			OPENSSL_free(s->data);
		s->data=(unsigned char *)p;
		}

	BIO_snprintf(p,len,"%02d%02d%02d%02d%02d%02dZ",ts->tm_year%100,
		     ts->tm_mon+1,ts->tm_mday,ts->tm_hour,ts->tm_min,ts->tm_sec);
	s->length=strlen(p);
	s->type=V_ASN1_UTCTIME;
#ifdef CHARSET_EBCDIC_not
	ebcdic2ascii(s->data, s->data, s->length);
#endif
	return(s);
	err:
	if (free_s && s)
		M_ASN1_UTCTIME_free(s);
	return NULL;
	}
开发者ID:Nymphetaminer,项目名称:dsl-n55u,代码行数:58,代码来源:a_utctm.c


示例18: BIO_snprintf

char *BN_options(void)
	{
	static int init=0;
	static char data[16];

	if (!init)
		{
		init++;
#ifdef BN_LLONG
		BIO_snprintf(data,sizeof data,"bn(%d,%d)",
			     (int)sizeof(BN_ULLONG)*8,(int)sizeof(BN_ULONG)*8);
#else
		BIO_snprintf(data,sizeof data,"bn(%d,%d)",
			     (int)sizeof(BN_ULONG)*8,(int)sizeof(BN_ULONG)*8);
#endif
		}
	return(data);
	}
开发者ID:Wampamba-Nooh,项目名称:MicroFrameworkSDK-Mono,代码行数:18,代码来源:bn_lib.cpp


示例19: test_big

static int test_big(void)
{
    char buf[80];

    /* Test excessively big number. Should fail */
    if (!TEST_int_eq(BIO_snprintf(buf, sizeof(buf),
                                  "%f\n", 2 * (double)ULONG_MAX), -1))
        return 0;
    return 1;
}
开发者ID:infinityhacks,项目名称:openssl,代码行数:10,代码来源:bioprinttest.c


示例20: test_j

static int test_j(int i)
{
    const j_data *data = &jf_data[i];
    char bio_buf[80];

    BIO_snprintf(bio_buf, sizeof(bio_buf) - 1, data->format, data->value);
    if (!TEST_str_eq(bio_buf, data->expected))
        return 0;
    return 1;
}
开发者ID:infinityhacks,项目名称:openssl,代码行数:10,代码来源:bioprinttest.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ BIO_write函数代码示例发布时间:2022-05-30
下一篇:
C++ BIO_should_retry函数代码示例发布时间: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