Const-correct ASN1_OBJECT_create.

The implementation is a little goofy, but OBJ_dup internally makes a
copy of all the data.

Change-Id: I58e6804ede00100211ac112f03e26a34a2d29b5a
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/47125
Reviewed-by: Adam Langley <agl@google.com>
grpc-202302
David Benjamin 4 years ago committed by Adam Langley
parent 354cd48f51
commit 782d9b6cf7
  1. 2
      crypto/asn1/a_object.c
  2. 3
      include/openssl/asn1.h

@ -263,7 +263,7 @@ void ASN1_OBJECT_free(ASN1_OBJECT *a)
OPENSSL_free(a);
}
ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len,
ASN1_OBJECT *ASN1_OBJECT_create(int nid, const unsigned char *data, int len,
const char *sn, const char *ln)
{
ASN1_OBJECT o;

@ -883,7 +883,8 @@ OPENSSL_EXPORT int i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type);
OPENSSL_EXPORT int i2t_ASN1_OBJECT(char *buf, int buf_len,
const ASN1_OBJECT *a);
OPENSSL_EXPORT ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,
OPENSSL_EXPORT ASN1_OBJECT *ASN1_OBJECT_create(int nid,
const unsigned char *data,
int len, const char *sn,
const char *ln);

Loading…
Cancel
Save