/openssl/crypto/ |
H A D | quic_vlint.c | 9 buf[0] = (uint8_t)v; in ossl_quic_vlint_encode_n() 12 buf[1] = (uint8_t)v; in ossl_quic_vlint_encode_n() 15 buf[1] = (uint8_t)(v >> 16); in ossl_quic_vlint_encode_n() 16 buf[2] = (uint8_t)(v >> 8); in ossl_quic_vlint_encode_n() 17 buf[3] = (uint8_t)v; in ossl_quic_vlint_encode_n() 20 buf[1] = (uint8_t)(v >> 48); in ossl_quic_vlint_encode_n() 26 buf[7] = (uint8_t)v; in ossl_quic_vlint_encode_n() 37 uint8_t first_byte = buf[0]; in ossl_quic_vlint_decode_unchecked() 45 | buf[1]; in ossl_quic_vlint_decode_unchecked() 51 | buf[3]; in ossl_quic_vlint_decode_unchecked() [all …]
|
H A D | o_str.c | 257 unsigned char *buf; in ossl_hexstr2buf_sep() local 275 return buf; in ossl_hexstr2buf_sep() 277 OPENSSL_free(buf); in ossl_hexstr2buf_sep() 308 q += ossl_to_hex(q, buf[i]); in buf2hexstr_sep() 361 return !strerror_s(buf, buflen, errnum); in openssl_strerror_r() 370 err = strerror_r(errnum, buf, buflen); in openssl_strerror_r() 380 if (err != buf) in openssl_strerror_r() 381 OPENSSL_strlcpy(buf, err, buflen); in openssl_strerror_r() 401 OPENSSL_strlcpy(buf, err, buflen); in openssl_strerror_r() 429 size_t ossl_to_hex(char *buf, uint8_t n) in ossl_to_hex() argument [all …]
|
H A D | packet.c | 55 if (pkt->buf != NULL && (pkt->buf->length - pkt->written < len)) { in WPACKET_reserve_bytes() 59 reflen = (len > pkt->buf->length) ? len : pkt->buf->length; in WPACKET_reserve_bytes() 138 pkt->staticbuf = buf; in WPACKET_init_static_len() 139 pkt->buf = NULL; in WPACKET_init_static_len() 152 pkt->staticbuf = buf; in WPACKET_init_der() 153 pkt->buf = NULL; in WPACKET_init_der() 167 pkt->buf = buf; in WPACKET_init_len() 182 pkt->buf = NULL; in WPACKET_init_null() 192 pkt->buf = NULL; in WPACKET_init_null_der() 279 if (buf != NULL) { in wpacket_intern_close() [all …]
|
/openssl/apps/ |
H A D | passwd.c | 721 b64_from_24bit (buf[0], buf[10], buf[20], 4); in shacrypt() 722 b64_from_24bit (buf[21], buf[1], buf[11], 4); in shacrypt() 723 b64_from_24bit (buf[12], buf[22], buf[2], 4); in shacrypt() 724 b64_from_24bit (buf[3], buf[13], buf[23], 4); in shacrypt() 725 b64_from_24bit (buf[24], buf[4], buf[14], 4); in shacrypt() 726 b64_from_24bit (buf[15], buf[25], buf[5], 4); in shacrypt() 727 b64_from_24bit (buf[6], buf[16], buf[26], 4); in shacrypt() 728 b64_from_24bit (buf[27], buf[7], buf[17], 4); in shacrypt() 729 b64_from_24bit (buf[18], buf[28], buf[8], 4); in shacrypt() 730 b64_from_24bit (buf[9], buf[19], buf[29], 4); in shacrypt() [all …]
|
/openssl/test/ |
H A D | membio_test.c | 22 char buf[80]; in test_dgram() local 50 if (!TEST_int_eq(BIO_read(bio, buf, sizeof(buf)), sizeof(msg1)) in test_dgram() 52 || !TEST_int_eq(BIO_read(bio, buf, sizeof(buf)), sizeof(msg2)) in test_dgram() 54 || !TEST_int_eq(BIO_read(bio, buf, sizeof(buf)), sizeof(msg3)) in test_dgram() 56 || !TEST_int_eq(BIO_read(bio, buf, sizeof(buf)), sizeof(msg4)) in test_dgram() 65 if (!TEST_int_eq(BIO_read(bio, buf, sizeof(buf)), sizeof(msg1)) in test_dgram() 70 if (!TEST_int_eq(BIO_read(bio, buf, sizeof(buf)), sizeof(msg2)) in test_dgram() 72 || !TEST_int_eq(BIO_read(bio, buf, sizeof(buf)), sizeof(msg3)) in test_dgram() 85 || !TEST_mem_eq(buf, 2, msg1, 2)) in test_dgram() 87 if (!TEST_int_eq(BIO_read(bio, buf, sizeof(buf)), sizeof(msg2)) in test_dgram() [all …]
|
H A D | rdcpu_sanitytest.c | 30 size_t OPENSSL_rndr_bytes(unsigned char *buf, size_t len); 31 size_t OPENSSL_rndrrs_bytes(unsigned char *buf, size_t len); 41 unsigned char prior[31] = {0}, buf[31] = {0}, check[7]; in sanity_check_bytes() local 50 generated = rng(buf, sizeof(buf)); in sanity_check_bytes() 51 if (generated == sizeof(buf)) in sanity_check_bytes() 62 for (j = 0; j < sizeof(buf) - 1; j++) { in sanity_check_bytes() 63 if (buf[j] == 0 && buf[j+1] == 0) { in sanity_check_bytes() 68 if (!TEST_int_eq(generated, sizeof(buf))) in sanity_check_bytes() 70 if (!TEST_false(!memcmp(prior, buf, sizeof(buf)))) in sanity_check_bytes() 74 unsigned char *tail = &buf[sizeof(buf) - sizeof(check)]; in sanity_check_bytes() [all …]
|
H A D | hexstr_test.c | 66 unsigned char *buf = NULL; in test_hexstr_sep_to_from() local 71 || !TEST_mem_eq(buf, len, test->expected, test->expected_len) in test_hexstr_sep_to_from() 72 || !TEST_ptr(out = ossl_buf2hexstr_sep(buf, len, test->sep)) in test_hexstr_sep_to_from() 78 OPENSSL_free(buf); in test_hexstr_sep_to_from() 87 unsigned char *buf = NULL; in test_hexstr_to_from() local 92 if (!TEST_ptr(buf = OPENSSL_hexstr2buf(test->in, &len)) in test_hexstr_to_from() 94 || !TEST_ptr(out = OPENSSL_buf2hexstr(buf, len))) in test_hexstr_to_from() 103 if (!TEST_ptr_null(buf = OPENSSL_hexstr2buf(test->in, &len))) in test_hexstr_to_from() 108 OPENSSL_free(buf); in test_hexstr_to_from() 117 unsigned char buf[64]; in test_hexstr_ex_to_from() local [all …]
|
H A D | bio_callback_test.c | 54 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 …]
|
H A D | wpackettest.c | 57 static BUF_MEM *buf; variable 72 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_init() 146 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_set_max_size() 194 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_start_sub_packet() 209 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_start_sub_packet() 219 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_start_sub_packet() 236 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_start_sub_packet() 249 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_start_sub_packet() 276 if (!TEST_true(WPACKET_init(&pkt, buf)) in test_WPACKET_set_flags() 634 if (!TEST_ptr(buf = BUF_MEM_new())) in setup_tests() [all …]
|
H A D | cmactest.c | 203 p = pt(buf, len); in test_cmac_run() 213 p = pt(buf, len); in test_cmac_run() 221 p = pt(buf, len); in test_cmac_run() 229 p = pt(buf, len); in test_cmac_run() 239 p = pt(buf, len); in test_cmac_run() 249 p = pt(buf, len); in test_cmac_run() 258 p = pt(buf, len); in test_cmac_run() 267 p = pt(buf, len); in test_cmac_run() 277 p = pt(buf, len); in test_cmac_run() 288 p = pt(buf, len); in test_cmac_run() [all …]
|
H A D | params_api_test.c | 206 memset(buf, 0, sizeof(buf)); in test_param_int() 236 memset(buf, 0, sizeof(buf)); in test_param_long() 265 memset(buf, 0, sizeof(buf)); in test_param_uint() 295 memset(buf, 0, sizeof(buf)); in test_param_ulong() 325 memset(buf, 0, sizeof(buf)); in test_param_int32() 355 memset(buf, 0, sizeof(buf)); in test_param_uint32() 385 memset(buf, 0, sizeof(buf)); in test_param_int64() 415 memset(buf, 0, sizeof(buf)); in test_param_uint64() 445 memset(buf, 0, sizeof(buf)); in test_param_size_t() 475 memset(buf, 0, sizeof(buf)); in test_param_time_t() [all …]
|
H A D | x509aux.c | 43 unsigned char *buf = NULL; in test_certs() local 82 enclen = (long) (bufp - buf); in test_certs() 88 if (memcmp(buf, data, len) != 0) { in test_certs() 93 p = buf; in test_certs() 106 OPENSSL_free(buf); in test_certs() 107 buf = NULL; in test_certs() 110 enclen = i2d(cert, &buf); in test_certs() 125 OPENSSL_free(buf); in test_certs() 126 buf = NULL; in test_certs() 129 enclen = i2d(cert, &buf); in test_certs() [all …]
|
/openssl/crypto/bio/ |
H A D | bss_mem.c | 89 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 …]
|
H A D | bss_bio.c | 103 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 …]
|
H A D | bio_dump.c | 20 #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/apps/lib/ |
H A D | app_params.c | 45 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/fuzz/ |
H A D | provider.c | 150 **res = (double) **buf; in read_double() 174 *res = (char *) *buf; in read_utf8_string() 176 *buf = *buf + found_len; /* continue after the \0 byte */ in read_utf8_string() 186 *buf += 1; in read_utf8_ptr() 215 *res = (char *) *buf; in read_octet_string() 217 r = ptr - *buf; in read_octet_string() 219 *buf = ptr; in read_octet_string() 228 if (*len > 1 && **buf == 0xFF && *(*buf + 1) == 0xFF) { in read_octet_ptr() 231 *buf += 2; in read_octet_ptr() 485 if (!EVP_MAC_final(ctx, buf, &final_l, sizeof(buf))) { in do_evp_mac() [all …]
|
/openssl/crypto/ec/ |
H A D | ec_deprecated.c | 27 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() 53 if (BN_bn2binpad(bn, buf, buf_len) < 0) { in EC_POINT_bn2point() 54 OPENSSL_free(buf); in EC_POINT_bn2point() 60 OPENSSL_free(buf); in EC_POINT_bn2point() 66 if (!EC_POINT_oct2point(group, ret, buf, buf_len, ctx)) { in EC_POINT_bn2point() 69 OPENSSL_free(buf); in EC_POINT_bn2point() [all …]
|
/openssl/crypto/asn1/ |
H A D | f_int.c | 19 char buf[2]; in i2a_ASN1_INTEGER() local 41 ossl_to_hex(buf, a->data[i]); in i2a_ASN1_INTEGER() 61 bufsize = BIO_gets(bp, buf, size); in a2i_ASN1_INTEGER() 66 if (buf[i - 1] == '\n') in a2i_ASN1_INTEGER() 67 buf[--i] = '\0'; in a2i_ASN1_INTEGER() 70 if (buf[i - 1] == '\r') in a2i_ASN1_INTEGER() 71 buf[--i] = '\0'; in a2i_ASN1_INTEGER() 74 again = (buf[i - 1] == '\\'); in a2i_ASN1_INTEGER() 77 if (!ossl_isxdigit(buf[j])) { in a2i_ASN1_INTEGER() 82 buf[i] = '\0'; in a2i_ASN1_INTEGER() [all …]
|
H A D | f_string.c | 19 char buf[2]; in i2a_ASN1_STRING() local 35 ossl_to_hex(buf, a->data[i]); in i2a_ASN1_STRING() 53 bufsize = BIO_gets(bp, buf, size); in a2i_ASN1_STRING() 64 if (buf[i - 1] == '\n') in a2i_ASN1_STRING() 65 buf[--i] = '\0'; in a2i_ASN1_STRING() 68 if (buf[i - 1] == '\r') in a2i_ASN1_STRING() 69 buf[--i] = '\0'; in a2i_ASN1_STRING() 72 again = (buf[i - 1] == '\\'); in a2i_ASN1_STRING() 75 if (!ossl_isxdigit(buf[j])) { in a2i_ASN1_STRING() 80 buf[i] = '\0'; in a2i_ASN1_STRING() [all …]
|
/openssl/crypto/err/ |
H A D | err_blocks.c | 52 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/providers/implementations/ciphers/ |
H A D | ciphercommon_block.c | 39 size_t ossl_cipher_fillblock(unsigned char *buf, size_t *buflen, in ossl_cipher_fillblock() argument 51 memcpy(buf + *buflen, *in, bufremain); in ossl_cipher_fillblock() 74 memcpy(buf + *buflen, *in, *inlen); in ossl_cipher_trailingdata() 82 void ossl_cipher_padblock(unsigned char *buf, size_t *buflen, size_t blocksize) in ossl_cipher_padblock() argument 88 buf[i] = pad; in ossl_cipher_padblock() 105 pad = buf[blocksize - 1]; in ossl_cipher_unpadblock() 111 if (buf[--len] != pad) { in ossl_cipher_unpadblock() 142 unsigned char *buf, size_t *buflen, in ossl_cipher_tlsunpadblock() argument 151 return ssl3_cbc_remove_padding_and_mac(buflen, *buflen, buf, mac, in ossl_cipher_tlsunpadblock() 161 buf += blocksize; in ossl_cipher_tlsunpadblock() [all …]
|
/openssl/crypto/rand/ |
H A D | prov_seed.c | 58 unsigned char *buf, size_t len) in ossl_rand_cleanup_entropy() argument 60 OPENSSL_secure_clear_free(buf, len); in ossl_rand_cleanup_entropy() 69 evp_rand_clear_seed(rng, buf, len); in ossl_rand_cleanup_user_entropy() 71 OPENSSL_secure_clear_free(buf, len); in ossl_rand_cleanup_user_entropy() 105 unsigned char *buf; in ossl_rand_get_user_nonce() local 111 if ((buf = OPENSSL_malloc(min_len)) == NULL) in ossl_rand_get_user_nonce() 115 OPENSSL_free(buf); in ossl_rand_get_user_nonce() 118 *pout = buf; in ossl_rand_get_user_nonce() 123 unsigned char *buf, size_t len) in ossl_rand_cleanup_nonce() argument 125 OPENSSL_clear_free(buf, len); in ossl_rand_cleanup_nonce() [all …]
|
/openssl/include/openssl/ |
H A D | rand.h | 41 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, 79 OSSL_DEPRECATEDIN_1_1_0 int RAND_pseudo_bytes(unsigned char *buf, int num); 93 void RAND_seed(const void *buf, int num); [all …]
|
/openssl/providers/implementations/rands/seeding/ |
H A D | rand_cpu_x86.c | 20 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()
|