Go to the documentation of this file.
65 #include "../internal.h"
79 *out_padding_bits =
len == 0 ? 0 :
str->flags & 0x07;
85 while (
len > 0 &&
str->data[
len - 1] == 0) {
92 for (; padding_bits < 7; padding_bits++) {
93 if (last & (1 << padding_bits)) {
98 *out_padding_bits = padding_bits;
105 if (padding_bits != 0) {
137 const unsigned char **
pp,
long len)
140 const unsigned char *
p;
154 if ((
a == NULL) || ((*
a) == NULL)) {
169 uint8_t padding_mask = (1 << padding) - 1;
171 (
len < 1 || (
p[
len - 1] & padding_mask) != 0)) {
203 if ((
ret != NULL) && ((
a == NULL) || (*
a !=
ret)))
217 v = 1 << (7 - (
n & 0x07));
227 if ((
a->length < (w + 1)) || (
a->data == NULL)) {
238 if (w + 1 -
a->length > 0)
243 a->data[w] = ((
a->data[w]) & iv) |
v;
244 while ((
a->length > 0) && (
a->data[
a->length - 1] == 0))
254 v = 1 << (7 - (
n & 0x07));
255 if ((
a == NULL) || (
a->length < (w + 1)) || (
a->data == NULL))
257 return ((
a->data[w] &
v) != 0);
267 const unsigned char *
flags,
int flags_len)
278 for (
i = 0;
i <
a->length &&
ok; ++
i) {
279 unsigned char mask =
i < flags_len ? ~
flags[
i] : 0xff;
281 ok = (
a->data[
i] & mask) == 0;
#define OPENSSL_PUT_ERROR(library, reason)
#define ASN1_R_INVALID_BIT_STRING_BITS_LEFT
static void * OPENSSL_memset(void *dst, int c, size_t n)
#define ASN1_R_STRING_TOO_LONG
OPENSSL_EXPORT ASN1_BIT_STRING * ASN1_BIT_STRING_new(void)
ASN1_BIT_STRING * c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **pp, long len)
int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, const unsigned char *flags, int flags_len)
int i2c_ASN1_BIT_STRING(const ASN1_BIT_STRING *a, unsigned char **pp)
int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
static void * OPENSSL_memcpy(void *dst, const void *src, size_t n)
OPENSSL_EXPORT ASN1_BIT_STRING * bits
int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n)
#define ASN1_STRING_FLAG_BITS_LEFT
#define V_ASN1_BIT_STRING
int ASN1_BIT_STRING_num_bytes(const ASN1_BIT_STRING *str, size_t *out)
UniquePtr< SSL_SESSION > ret
#define ASN1_R_STRING_TOO_SHORT
int asn1_bit_string_length(const ASN1_BIT_STRING *str, uint8_t *out_padding_bits)
OPENSSL_EXPORT void ASN1_BIT_STRING_free(ASN1_BIT_STRING *str)
#define ASN1_R_INVALID_BIT_STRING_PADDING
int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, const unsigned char *d, int len)
#define ERR_R_MALLOC_FAILURE
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:28