Lines Matching refs:str
58 static char *sec_alloc_realloc(BUF_MEM *str, size_t len) in sec_alloc_realloc() argument
63 if (str->data != NULL) { in sec_alloc_realloc()
65 memcpy(ret, str->data, str->length); in sec_alloc_realloc()
66 OPENSSL_secure_clear_free(str->data, str->length); in sec_alloc_realloc()
67 str->data = NULL; in sec_alloc_realloc()
73 size_t BUF_MEM_grow(BUF_MEM *str, size_t len) in BUF_MEM_grow() argument
78 if (str->length >= len) { in BUF_MEM_grow()
79 str->length = len; in BUF_MEM_grow()
82 if (str->max >= len) { in BUF_MEM_grow()
83 if (str->data != NULL) in BUF_MEM_grow()
84 memset(&str->data[str->length], 0, len - str->length); in BUF_MEM_grow()
85 str->length = len; in BUF_MEM_grow()
94 if ((str->flags & BUF_MEM_FLAG_SECURE)) in BUF_MEM_grow()
95 ret = sec_alloc_realloc(str, n); in BUF_MEM_grow()
97 ret = OPENSSL_realloc(str->data, n); in BUF_MEM_grow()
102 str->data = ret; in BUF_MEM_grow()
103 str->max = n; in BUF_MEM_grow()
104 memset(&str->data[str->length], 0, len - str->length); in BUF_MEM_grow()
105 str->length = len; in BUF_MEM_grow()
110 size_t BUF_MEM_grow_clean(BUF_MEM *str, size_t len) in BUF_MEM_grow_clean() argument
115 if (str->length >= len) { in BUF_MEM_grow_clean()
116 if (str->data != NULL) in BUF_MEM_grow_clean()
117 memset(&str->data[len], 0, str->length - len); in BUF_MEM_grow_clean()
118 str->length = len; in BUF_MEM_grow_clean()
121 if (str->max >= len) { in BUF_MEM_grow_clean()
122 memset(&str->data[str->length], 0, len - str->length); in BUF_MEM_grow_clean()
123 str->length = len; in BUF_MEM_grow_clean()
132 if ((str->flags & BUF_MEM_FLAG_SECURE)) in BUF_MEM_grow_clean()
133 ret = sec_alloc_realloc(str, n); in BUF_MEM_grow_clean()
135 ret = OPENSSL_clear_realloc(str->data, str->max, n); in BUF_MEM_grow_clean()
140 str->data = ret; in BUF_MEM_grow_clean()
141 str->max = n; in BUF_MEM_grow_clean()
142 memset(&str->data[str->length], 0, len - str->length); in BUF_MEM_grow_clean()
143 str->length = len; in BUF_MEM_grow_clean()