*Daniel Kubec and Eugene Syromiatnikov*
+ * X509_get0_distinguishing_id now takes and returns const objects.
+
+ * Bob Beck *
+
* Added `-hmac-env` and `-hmac-stdin` options to openssl-dgst.
*Igor Ustinov*
BIO_printf(out, "%s\n", sk_OPENSSL_STRING_value(emlst, j));
X509_email_free(emlst);
} else if (i == aliasout) {
- unsigned char *alstr = X509_alias_get0(x, NULL);
+ const unsigned char *alstr = X509_alias_get0(x, NULL);
if (alstr)
BIO_printf(out, "%s\n", alstr);
/* Add a local keyid to a safebag */
-int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name,
+int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, const unsigned char *name,
int namelen)
{
if (X509at_add1_attr_by_NID(&bag->attrib, NID_localKeyID,
X509 *cert,
const char *name,
int namelen,
- unsigned char *keyid,
+ const unsigned char *keyid,
int keyidlen);
static int copy_bag_attr(PKCS12_SAFEBAG *bag, EVP_PKEY *pkey, int nid)
unsigned char keyid[EVP_MAX_MD_SIZE];
unsigned int keyidlen = 0;
int namelen = -1;
- unsigned char *pkeyid = NULL;
+ const unsigned char *pkeyid = NULL;
int pkeyidlen = -1;
/* Set defaults */
X509 *cert,
const char *name,
int namelen,
- unsigned char *keyid,
+ const unsigned char *keyid,
int keyidlen)
{
PKCS12_SAFEBAG *bag = NULL;
{
char *name = NULL;
int namelen = -1;
- unsigned char *keyid = NULL;
+ const unsigned char *keyid = NULL;
int keyidlen = -1;
/*
return x->cert_info.validity.notAfter;
}
-ASN1_TIME *X509_getm_notBefore(const X509 *x)
+ASN1_TIME *X509_getm_notBefore(X509 *x)
{
return x->cert_info.validity.notBefore;
}
-ASN1_TIME *X509_getm_notAfter(const X509 *x)
+ASN1_TIME *X509_getm_notAfter(X509 *x)
{
return x->cert_info.validity.notAfter;
}
x->distinguishing_id = d_id;
}
-ASN1_OCTET_STRING *X509_get0_distinguishing_id(X509 *x)
+const ASN1_OCTET_STRING *X509_get0_distinguishing_id(const X509 *x)
{
return x->distinguishing_id;
}
return ASN1_STRING_set(aux->keyid, id, len);
}
-unsigned char *X509_alias_get0(const X509 *x, int *len)
+const unsigned char *X509_alias_get0(const X509 *x, int *len)
{
if (!x->aux || !x->aux->alias)
return NULL;
return x->aux->alias->data;
}
-unsigned char *X509_keyid_get0(const X509 *x, int *len)
+const unsigned char *X509_keyid_get0(const X509 *x, int *len)
{
if (!x->aux || !x->aux->keyid)
return NULL;
#include <openssl/pkcs12.h>
- int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, const char *name,
+ int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, const unsigned char *name,
int namelen);
=head1 DESCRIPTION
#include <openssl/x509.h>
- ASN1_OCTET_STRING *X509_get0_distinguishing_id(X509 *x);
+ const ASN1_OCTET_STRING *X509_get0_distinguishing_id(const X509 *x);
void X509_set0_distinguishing_id(X509 *x, ASN1_OCTET_STRING *distid);
ASN1_OCTET_STRING *X509_REQ_get0_distinguishing_id(X509_REQ *x);
void X509_REQ_set0_distinguishing_id(X509_REQ *x, ASN1_OCTET_STRING *distid);
int PKCS12_pack_authsafes(PKCS12 *p12, STACK_OF(PKCS7) *safes);
STACK_OF(PKCS7) *PKCS12_unpack_authsafes(const PKCS12 *p12);
-int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, unsigned char *name,
+int PKCS12_add_localkeyid(PKCS12_SAFEBAG *bag, const unsigned char *name,
int namelen);
int PKCS12_add_friendlyname_asc(PKCS12_SAFEBAG *bag, const char *name,
int namelen);
int X509_get_signature_nid(const X509 *x);
void X509_set0_distinguishing_id(X509 *x, ASN1_OCTET_STRING *d_id);
-ASN1_OCTET_STRING *X509_get0_distinguishing_id(X509 *x);
+const ASN1_OCTET_STRING *X509_get0_distinguishing_id(const X509 *x);
void X509_REQ_set0_distinguishing_id(X509_REQ *x, ASN1_OCTET_STRING *d_id);
ASN1_OCTET_STRING *X509_REQ_get0_distinguishing_id(X509_REQ *x);
int X509_alias_set1(X509 *x, const unsigned char *name, int len);
int X509_keyid_set1(X509 *x, const unsigned char *id, int len);
-unsigned char *X509_alias_get0(const X509 *x, int *len);
-unsigned char *X509_keyid_get0(const X509 *x, int *len);
+const unsigned char *X509_alias_get0(const X509 *x, int *len);
+const unsigned char *X509_keyid_get0(const X509 *x, int *len);
DECLARE_ASN1_FUNCTIONS(X509_REVOKED)
DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO)
int X509_set_subject_name(X509 *x, const X509_NAME *name);
X509_NAME *X509_get_subject_name(const X509 *a);
const ASN1_TIME *X509_get0_notBefore(const X509 *x);
-ASN1_TIME *X509_getm_notBefore(const X509 *x);
+ASN1_TIME *X509_getm_notBefore(X509 *x);
int X509_set1_notBefore(X509 *x, const ASN1_TIME *tm);
const ASN1_TIME *X509_get0_notAfter(const X509 *x);
-ASN1_TIME *X509_getm_notAfter(const X509 *x);
+ASN1_TIME *X509_getm_notAfter(X509 *x);
int X509_set1_notAfter(X509 *x, const ASN1_TIME *tm);
int X509_up_ref(X509 *x);
int X509_get_signature_type(const X509 *x);
{
X509 *x = NULL;
int ret = 0;
- ASN1_OCTET_STRING *v = NULL, *v2 = NULL;
+ ASN1_OCTET_STRING *v = NULL;
+ const ASN1_OCTET_STRING *v2 = NULL;
char *distid = "this is an ID";
x = load_cert_from_file(bad_f);