Skip to content

Commit

Permalink
Remove needless asserts
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Feb 22, 2024
1 parent 38591dc commit 396ac54
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 31 deletions.
5 changes: 0 additions & 5 deletions crypto/asn1/a_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,6 @@ ASN1_OBJECT *ASN1_OBJECT_new(void) {
if (ret == NULL) {
return NULL;
}
assert(ret->length == 0);
assert(ret->data == NULL);
assert(ret->nid == 0);
assert(ret->sn == NULL);
assert(ret->ln == NULL);
ret->flags = ASN1_OBJECT_FLAG_DYNAMIC;
return ret;
}
Expand Down
3 changes: 0 additions & 3 deletions crypto/asn1/asn1_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,7 @@ ASN1_STRING *ASN1_STRING_type_new(int type) {
if (ret == NULL) {
return NULL;
}
assert(ret->length == 0);
ret->type = type;
assert(ret->data == NULL);
assert(ret->flags == 0);
return ret;
}

Expand Down
1 change: 0 additions & 1 deletion crypto/asn1/tasn_new.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ static int ASN1_primitive_new(ASN1_VALUE **pval, const ASN1_ITEM *it) {
if (!typ) {
return 0;
}
assert(typ->value.ptr == NULL);
typ->type = -1;
*pval = (ASN1_VALUE *)typ;
break;
Expand Down
5 changes: 0 additions & 5 deletions crypto/cipher_extra/e_chacha20poly1305.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,11 +669,6 @@ static int32_t cipher_chacha20_poly1305_ctrl(EVP_CIPHER_CTX *ctx, int32_t type,
OPENSSL_PUT_ERROR(CIPHER, CIPHER_R_INITIALIZATION_ERROR);
return 0;
}
assert(cipher_ctx->len.aad == 0);
assert(cipher_ctx->len.text == 0);
assert(cipher_ctx->pad_aad == 0);
assert(cipher_ctx->poly_initialized == 0);
assert(cipher_ctx->tag_len == 0);
} else {
cipher_ctx->len.aad = 0;
cipher_ctx->len.text = 0;
Expand Down
1 change: 0 additions & 1 deletion crypto/evp_extra/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ static int bn_print(BIO *bp, const char *name, const BIGNUM *num, int off) {
return 0;
}

assert(buf[0] == 0);
BN_bn2bin(num, buf + 1);
int ret;
if (len > 0 && (buf[1] & 0x80) != 0) {
Expand Down
4 changes: 0 additions & 4 deletions crypto/fipsmodule/bn/ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,7 @@ BN_CTX *BN_CTX_new(void) {
}

// Initialise the structure
assert(ret->bignums == NULL);
BN_STACK_init(&ret->stack);
assert(ret->used == 0);
assert(ret->error == 0);
assert(ret->defer_error == 0);
return ret;
}

Expand Down
1 change: 0 additions & 1 deletion crypto/lhash/lhash.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ int OPENSSL_lh_insert(_LHASH *lh, void **old_data, void *data,

item->data = data;
item->hash = hash;
assert(item->next == NULL);
*next_ptr = item;
lh->num_items++;
lh_maybe_resize(lh);
Expand Down
4 changes: 0 additions & 4 deletions crypto/x509/x509_lu.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,7 @@ X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method) {
return NULL;
}

assert(ret->init == 0);
assert(ret->skip == 0);
ret->method = method;
assert(ret->method_data == NULL);
assert(ret->store_ctx == NULL);
if ((method->new_item != NULL) && !method->new_item(ret)) {
OPENSSL_free(ret);
return NULL;
Expand Down
7 changes: 0 additions & 7 deletions crypto/x509/x_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,6 @@ X509_INFO *X509_INFO_new(void) {
return NULL;
}

assert(ret->enc_cipher.cipher == NULL);
assert(ret->enc_len == 0);
assert(ret->enc_data == NULL);

assert(ret->x509 == NULL);
assert(ret->crl == NULL);
assert(ret->x_pkey == NULL);
return ret;
}

Expand Down

0 comments on commit 396ac54

Please sign in to comment.