Home
last modified time | relevance | path

Searched refs:buf (Results 1 – 25 of 364) sorted by relevance

12345678910>>...15

/openssl-master/apps/
A Dpasswd.c722 b64_from_24bit (buf[0], buf[10], buf[20], 4); in shacrypt()
723 b64_from_24bit (buf[21], buf[1], buf[11], 4); in shacrypt()
724 b64_from_24bit (buf[12], buf[22], buf[2], 4); in shacrypt()
725 b64_from_24bit (buf[3], buf[13], buf[23], 4); in shacrypt()
726 b64_from_24bit (buf[24], buf[4], buf[14], 4); in shacrypt()
727 b64_from_24bit (buf[15], buf[25], buf[5], 4); in shacrypt()
728 b64_from_24bit (buf[6], buf[16], buf[26], 4); in shacrypt()
729 b64_from_24bit (buf[27], buf[7], buf[17], 4); in shacrypt()
730 b64_from_24bit (buf[18], buf[28], buf[8], 4); in shacrypt()
731 b64_from_24bit (buf[9], buf[19], buf[29], 4); in shacrypt()
[all …]
/openssl-master/test/
A Drdrand_sanitytest.c20 size_t OPENSSL_ia32_rdrand_bytes(unsigned char *buf, size_t len);
21 size_t OPENSSL_ia32_rdseed_bytes(unsigned char *buf, size_t len);
27 unsigned char prior[31] = {0}, buf[31] = {0}, check[7]; in sanity_check_bytes() local
36 generated = rng(buf, sizeof(buf)); in sanity_check_bytes()
37 if (generated == sizeof(buf)) in sanity_check_bytes()
48 for (j = 0; j < sizeof(buf) - 1; j++) { in sanity_check_bytes()
49 if (buf[j] == 0 && buf[j+1] == 0) { in sanity_check_bytes()
54 if (!TEST_int_eq(generated, sizeof(buf))) in sanity_check_bytes()
56 if (!TEST_false(!memcmp(prior, buf, sizeof(buf)))) in sanity_check_bytes()
60 unsigned char *tail = &buf[sizeof(buf) - sizeof(check)]; in sanity_check_bytes()
[all …]
A Dhexstr_test.c67 unsigned char *buf = NULL; in test_hexstr_sep_to_from() local
72 || !TEST_mem_eq(buf, len, test->expected, test->expected_len) in test_hexstr_sep_to_from()
73 || !TEST_ptr(out = ossl_buf2hexstr_sep(buf, len, test->sep)) in test_hexstr_sep_to_from()
79 OPENSSL_free(buf); in test_hexstr_sep_to_from()
88 unsigned char *buf = NULL; in test_hexstr_to_from() local
93 if (!TEST_ptr(buf = OPENSSL_hexstr2buf(test->in, &len)) in test_hexstr_to_from()
95 || !TEST_ptr(out = OPENSSL_buf2hexstr(buf, len))) in test_hexstr_to_from()
104 if (!TEST_ptr_null(buf = OPENSSL_hexstr2buf(test->in, &len))) in test_hexstr_to_from()
109 OPENSSL_free(buf); in test_hexstr_to_from()
118 unsigned char buf[64]; in test_hexstr_ex_to_from() local
[all …]
A Dbio_callback_test.c54 char buf[16]; in test_bio_callback_ex() local
82 i = BIO_read(bio, buf, sizeof(buf)); in test_bio_callback_ex()
83 if (!TEST_mem_eq(buf, i, test1, test1len) in test_bio_callback_ex()
87 || !TEST_ptr_eq(my_param_argp[0], buf) in test_bio_callback_ex()
102 i = BIO_read(bio, buf, sizeof(buf)); in test_bio_callback_ex()
139 i = BIO_read(bio, buf, sizeof(buf)); in test_bio_callback_ex()
226 char buf[16]; in test_bio_callback() local
253 i = BIO_read(bio, buf, sizeof(buf)); in test_bio_callback()
254 if (!TEST_mem_eq(buf, i, test1, test1len) in test_bio_callback()
272 i = BIO_read(bio, buf, sizeof(buf)); in test_bio_callback()
[all …]
A Dwpackettest.c29 static BUF_MEM *buf; variable
44 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_init()
118 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_set_max_size()
166 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_start_sub_packet()
181 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_start_sub_packet()
191 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_start_sub_packet()
208 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_start_sub_packet()
221 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_start_sub_packet()
248 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_set_flags()
429 if (!TEST_ptr(buf = BUF_MEM_new())) in setup_tests()
[all …]
A Dparams_api_test.c156 memset(buf, 0, sizeof(buf)); in test_param_int()
183 memset(buf, 0, sizeof(buf)); in test_param_long()
209 memset(buf, 0, sizeof(buf)); in test_param_uint()
236 memset(buf, 0, sizeof(buf)); in test_param_ulong()
263 memset(buf, 0, sizeof(buf)); in test_param_int32()
290 memset(buf, 0, sizeof(buf)); in test_param_uint32()
317 memset(buf, 0, sizeof(buf)); in test_param_int64()
344 memset(buf, 0, sizeof(buf)); in test_param_uint64()
371 memset(buf, 0, sizeof(buf)); in test_param_size_t()
398 memset(buf, 0, sizeof(buf)); in test_param_time_t()
[all …]
A Dcmactest.c110 unsigned char buf[AES_BLOCK_SIZE]; in test_cmac_run() local
122 p = pt(buf, len); in test_cmac_run()
132 p = pt(buf, len); in test_cmac_run()
140 p = pt(buf, len); in test_cmac_run()
148 p = pt(buf, len); in test_cmac_run()
158 p = pt(buf, len); in test_cmac_run()
172 unsigned char buf[AES_BLOCK_SIZE]; in test_cmac_copy() local
188 p = pt(buf, len); in test_cmac_copy()
202 static char buf[80]; in pt() local
205 sprintf(&(buf[i * 2]), "%02x", md[i]); in pt()
[all …]
A Dx509aux.c44 unsigned char *buf = NULL; in test_certs() local
83 enclen = (long) (bufp - buf); in test_certs()
89 if (memcmp(buf, data, len) != 0) { in test_certs()
94 p = buf; in test_certs()
107 OPENSSL_free(buf); in test_certs()
108 buf = NULL; in test_certs()
111 enclen = i2d(cert, &buf); in test_certs()
126 OPENSSL_free(buf); in test_certs()
127 buf = NULL; in test_certs()
130 enclen = i2d(cert, &buf); in test_certs()
[all …]
A Drc5test.c188 unsigned char buf[8], buf2[8]; in test_rc5_ecb() local
193 RC5_32_ecb_encrypt(&RC5plain[n][0], buf, &key, RC5_ENCRYPT); in test_rc5_ecb()
194 if (!TEST_mem_eq(&RC5cipher[n][0], sizeof(RC5cipher[0]), buf, sizeof(buf))) in test_rc5_ecb()
197 RC5_32_ecb_encrypt(buf, buf2, &key, RC5_DECRYPT); in test_rc5_ecb()
209 unsigned char buf[8], buf2[8], ivb[8]; in test_rc5_cbc() local
218 RC5_32_cbc_encrypt(&rc5_cbc_plain[n][0], buf, 8, in test_rc5_cbc()
222 buf, sizeof(buf))) in test_rc5_cbc()
226 RC5_32_cbc_encrypt(buf, buf2, 8, &key, &ivb[0], RC5_DECRYPT); in test_rc5_cbc()
/openssl-master/crypto/bio/
A Dbss_mem.c89 if (buf == NULL) { in BIO_new_mem_buf()
97 b = bb->buf; in BIO_new_mem_buf()
99 b->data = (void *)buf; in BIO_new_mem_buf()
198 bm = bbm->buf; in mem_read()
251 bm = bbm->buf; in mem_ctrl()
255 bo = bbm->buf; in mem_ctrl()
262 bm = bbm->buf; in mem_ctrl()
304 bbm->buf = ptr; in mem_ctrl()
350 bm = bbm->buf; in mem_gets()
356 *buf = '\0'; in mem_gets()
[all …]
A Dbss_bio.c103 OPENSSL_free(b->buf); in bio_free()
168 memcpy(buf, peer_b->buf + peer_b->offset, chunk); in bio_read()
176 buf += chunk; in bio_read()
232 if (buf != NULL) in bio_nread0()
233 *buf = peer_b->buf + peer_b->offset; in bio_nread0()
282 assert(b->buf != NULL); in bio_write()
324 memcpy(b->buf + write_offset, buf, chunk); in bio_write()
331 buf += chunk; in bio_write()
386 if (buf != NULL) in bio_nwrite0()
387 *buf = b->buf + write_offset; in bio_nwrite0()
[all …]
A Dbio_dump.c20 #define SPACE(buf, pos, n) (sizeof(buf) - (pos) > (n)) argument
33 char buf[288 + 1]; in BIO_dump_indent_cb() local
48 n = BIO_snprintf(buf, sizeof(buf), "%*s%04x - ", indent, "", in BIO_dump_indent_cb()
51 if (SPACE(buf, n, 3)) { in BIO_dump_indent_cb()
62 if (SPACE(buf, n, 2)) { in BIO_dump_indent_cb()
63 strcpy(buf + n, " "); in BIO_dump_indent_cb()
69 if (SPACE(buf, n, 1)) { in BIO_dump_indent_cb()
78 buf[n] = '\0'; in BIO_dump_indent_cb()
81 if (SPACE(buf, n, 1)) { in BIO_dump_indent_cb()
82 buf[n++] = '\n'; in BIO_dump_indent_cb()
[all …]
/openssl-master/apps/lib/
A Dapp_params.c45 printed_len = BIO_snprintf(buf, bufsz, "%s: ", param->key); in describe_param_type()
47 buf += printed_len; in describe_param_type()
50 printed_len = BIO_snprintf(buf, bufsz, "%s%s", type_mod, type); in describe_param_type()
52 buf += printed_len; in describe_param_type()
58 buf += printed_len; in describe_param_type()
63 printed_len = BIO_snprintf(buf, bufsz, " (arbitrary size)"); in describe_param_type()
68 buf += printed_len; in describe_param_type()
71 *buf = '\0'; in describe_param_type()
88 char buf[200]; /* This should be ample space */ in print_param_types() local
90 describe_param_type(buf, sizeof(buf), pdefs); in print_param_types()
[all …]
/openssl-master/crypto/ec/
A Dec_deprecated.c27 unsigned char *buf; in EC_POINT_point2bn() local
34 ret = BN_bin2bn(buf, buf_len, ret); in EC_POINT_point2bn()
36 OPENSSL_free(buf); in EC_POINT_point2bn()
45 unsigned char *buf; in EC_POINT_bn2point() local
50 if ((buf = OPENSSL_malloc(buf_len)) == NULL) { in EC_POINT_bn2point()
55 if (BN_bn2binpad(bn, buf, buf_len) < 0) { in EC_POINT_bn2point()
56 OPENSSL_free(buf); in EC_POINT_bn2point()
62 OPENSSL_free(buf); in EC_POINT_bn2point()
68 if (!EC_POINT_oct2point(group, ret, buf, buf_len, ctx)) { in EC_POINT_bn2point()
71 OPENSSL_free(buf); in EC_POINT_bn2point()
[all …]
/openssl-master/crypto/asn1/
A Df_int.c20 char buf[2]; in i2a_ASN1_INTEGER() local
44 if (BIO_write(bp, buf, 2) != 2) in i2a_ASN1_INTEGER()
63 bufsize = BIO_gets(bp, buf, size); in a2i_ASN1_INTEGER()
68 if (buf[i - 1] == '\n') in a2i_ASN1_INTEGER()
69 buf[--i] = '\0'; in a2i_ASN1_INTEGER()
72 if (buf[i - 1] == '\r') in a2i_ASN1_INTEGER()
73 buf[--i] = '\0'; in a2i_ASN1_INTEGER()
76 again = (buf[i - 1] == '\\'); in a2i_ASN1_INTEGER()
79 if (!ossl_isxdigit(buf[j])) in a2i_ASN1_INTEGER()
85 buf[i] = '\0'; in a2i_ASN1_INTEGER()
[all …]
A Df_string.c20 char buf[2]; in i2a_ASN1_STRING() local
38 if (BIO_write(bp, buf, 2) != 2) in i2a_ASN1_STRING()
55 bufsize = BIO_gets(bp, buf, size); in a2i_ASN1_STRING()
66 if (buf[i - 1] == '\n') in a2i_ASN1_STRING()
67 buf[--i] = '\0'; in a2i_ASN1_STRING()
70 if (buf[i - 1] == '\r') in a2i_ASN1_STRING()
71 buf[--i] = '\0'; in a2i_ASN1_STRING()
74 again = (buf[i - 1] == '\\'); in a2i_ASN1_STRING()
77 if (!ossl_isxdigit(buf[j])) { in a2i_ASN1_STRING()
82 buf[i] = '\0'; in a2i_ASN1_STRING()
[all …]
/openssl-master/crypto/
A Do_str.c187 unsigned char *buf; in ossl_hexstr2buf_sep() local
196 if ((buf = OPENSSL_malloc(buf_n)) == NULL) { in ossl_hexstr2buf_sep()
207 return buf; in ossl_hexstr2buf_sep()
209 OPENSSL_free(buf); in ossl_hexstr2buf_sep()
240 for (i = 0, p = buf; i < buflen; i++, p++) { in buf2hexstr_sep()
297 return !strerror_s(buf, buflen, errnum); in openssl_strerror_r()
306 err = strerror_r(errnum, buf, buflen); in openssl_strerror_r()
316 if (err != buf) in openssl_strerror_r()
317 OPENSSL_strlcpy(buf, err, buflen); in openssl_strerror_r()
326 return !strerror_r(errnum, buf, buflen); in openssl_strerror_r()
[all …]
A Dpacket.c52 if (pkt->buf != NULL && (pkt->buf->length - pkt->written < len)) { in WPACKET_reserve_bytes()
56 reflen = (len > pkt->buf->length) ? len : pkt->buf->length; in WPACKET_reserve_bytes()
137 pkt->staticbuf = buf; in WPACKET_init_static_len()
138 pkt->buf = NULL; in WPACKET_init_static_len()
151 pkt->staticbuf = buf; in WPACKET_init_der()
152 pkt->buf = NULL; in WPACKET_init_der()
166 pkt->buf = buf; in WPACKET_init_len()
181 pkt->buf = NULL; in WPACKET_init_null()
191 pkt->buf = NULL; in WPACKET_init_null_der()
264 if (buf != NULL in wpacket_intern_close()
[all …]
/openssl-master/crypto/err/
A Derr_blocks.c52 char *buf = NULL; in ERR_vset_error() local
66 buf = es->err_data[i]; in ERR_vset_error()
85 buf = rbuf; in ERR_vset_error()
89 if (buf != NULL) { in ERR_vset_error()
90 printed_len = BIO_vsnprintf(buf, buf_size, fmt, args); in ERR_vset_error()
94 if (buf != NULL) in ERR_vset_error()
95 buf[printed_len] = '\0'; in ERR_vset_error()
104 buf = rbuf; in ERR_vset_error()
106 buf[printed_len] = '\0'; in ERR_vset_error()
109 if (buf != NULL) in ERR_vset_error()
[all …]
/openssl-master/include/openssl/
A Drand.h41 int (*seed) (const void *buf, int num);
42 int (*bytes) (unsigned char *buf, int num);
44 int (*add) (const void *buf, int num, double randomness);
45 int (*pseudorand) (unsigned char *buf, int num);
61 int RAND_bytes(unsigned char *buf, int num);
62 int RAND_priv_bytes(unsigned char *buf, int num);
68 int RAND_priv_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num,
75 int RAND_bytes_ex(OSSL_LIB_CTX *ctx, unsigned char *buf, size_t num,
91 void RAND_seed(const void *buf, int num);
97 void RAND_add(const void *buf, int num, double randomness);
[all …]
/openssl-master/providers/implementations/ciphers/
A Dciphercommon_block.c56 size_t ossl_cipher_fillblock(unsigned char *buf, size_t *buflen, in ossl_cipher_fillblock() argument
68 memcpy(buf + *buflen, *in, bufremain); in ossl_cipher_fillblock()
91 memcpy(buf + *buflen, *in, *inlen); in ossl_cipher_trailingdata()
99 void ossl_cipher_padblock(unsigned char *buf, size_t *buflen, size_t blocksize) in ossl_cipher_padblock() argument
105 buf[i] = pad; in ossl_cipher_padblock()
122 pad = buf[blocksize - 1]; in ossl_cipher_unpadblock()
128 if (buf[--len] != pad) { in ossl_cipher_unpadblock()
159 unsigned char *buf, size_t *buflen, in ossl_cipher_tlsunpadblock() argument
168 return ssl3_cbc_remove_padding_and_mac(buflen, *buflen, buf, mac, in ossl_cipher_tlsunpadblock()
178 buf += blocksize; in ossl_cipher_tlsunpadblock()
[all …]
/openssl-master/providers/implementations/rands/seeding/
A Drand_cpu_x86.c20 size_t OPENSSL_ia32_rdseed_bytes(unsigned char *buf, size_t len);
21 size_t OPENSSL_ia32_rdrand_bytes(unsigned char *buf, size_t len);
24 static size_t get_hardware_random_value(unsigned char *buf, size_t len);
61 static size_t get_hardware_random_value(unsigned char *buf, size_t len) in get_hardware_random_value() argument
74 memcpy(buf, random_buffer, sizeof(random_value)); in get_hardware_random_value()
76 buf += sizeof(random_value); in get_hardware_random_value()
78 memcpy(buf, in get_hardware_random_value()
91 static size_t get_hardware_random_value(unsigned char *buf, size_t len) { in get_hardware_random_value() argument
94 if (OPENSSL_ia32_rdseed_bytes(buf, len) != len) in get_hardware_random_value()
97 if (OPENSSL_ia32_rdrand_bytes(buf, len) != len) in get_hardware_random_value()
/openssl-master/fuzz/
A Dbignum.c30 int FuzzerTestOneInput(const uint8_t *buf, size_t len) in FuzzerTestOneInput() argument
55 l1 = (buf[0] * len) / 255; in FuzzerTestOneInput()
56 ++buf; in FuzzerTestOneInput()
57 l2 = (buf[0] * (len - l1)) / 255; in FuzzerTestOneInput()
58 ++buf; in FuzzerTestOneInput()
61 s1 = buf[0] & 1; in FuzzerTestOneInput()
62 s3 = buf[0] & 4; in FuzzerTestOneInput()
63 ++buf; in FuzzerTestOneInput()
65 OPENSSL_assert(BN_bin2bn(buf, l1, b1) == b1); in FuzzerTestOneInput()
67 OPENSSL_assert(BN_bin2bn(buf + l1, l2, b2) == b2); in FuzzerTestOneInput()
[all …]
/openssl-master/crypto/rand/
A Drandfile.c152 i = fread(buf, 1, n, in); in RAND_load_file()
163 RAND_add(buf, i, (double)i); in RAND_load_file()
171 OPENSSL_cleanse(buf, sizeof(buf)); in RAND_load_file()
183 unsigned char buf[RAND_BUF_SIZE]; in RAND_write_file() local
197 if (RAND_priv_bytes(buf, (int)sizeof(buf)) != 1) in RAND_write_file()
254 OPENSSL_cleanse(buf, RAND_BUF_SIZE); in RAND_write_file()
309 strcpy(buf, s); in RAND_file_name()
313 strcpy(buf, s); in RAND_file_name()
315 strcat(buf, "/"); in RAND_file_name()
317 strcat(buf, RFILE); in RAND_file_name()
[all …]
/openssl-master/ssl/record/
A Dssl3_buffer.c16 memcpy(b->buf, d, n); in SSL3_BUFFER_set_data()
33 OPENSSL_free(b->buf); in SSL3_BUFFER_release()
34 b->buf = NULL; in SSL3_BUFFER_release()
54 if (b->buf == NULL) { in ssl3_setup_read_buffer()
72 b->buf = p; in ssl3_setup_read_buffer()
117 if (thiswb->buf == NULL) { in ssl3_setup_write_buffer()
134 thiswb->buf = p; in ssl3_setup_write_buffer()
167 OPENSSL_free(wb->buf); in ssl3_release_write_buffer()
168 wb->buf = NULL; in ssl3_release_write_buffer()
182 OPENSSL_free(b->buf); in ssl3_release_read_buffer()
[all …]

Completed in 155 milliseconds

12345678910>>...15