Constify i2t_ASN1_OBJECT, i2d_ASN1_OBJECT, i2a_ASN1_OBJECT.
[openssl.git] / doc / crypto / OBJ_nid2obj.pod
index 01f5c6eec568ad56e3d53485f75877e899b309ab..3ada6679cf92b7d47e68e1532a562cdaa7a4ebbb 100644 (file)
@@ -25,7 +25,7 @@ OBJ_dup, OBJ_txt2obj, OBJ_obj2txt, OBJ_create, OBJ_cleanup
  ASN1_OBJECT *OBJ_txt2obj(const char *s, int no_name);
  int OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name);
 
- int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a);
+ int i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a);
 
  int OBJ_cmp(const ASN1_OBJECT *a, const ASN1_OBJECT *b);
  ASN1_OBJECT *OBJ_dup(const ASN1_OBJECT *o);
@@ -45,11 +45,11 @@ Deprecated:
 
 The ASN1 object utility functions process ASN1_OBJECT structures which are
 a representation of the ASN1 OBJECT IDENTIFIER (OID) type.
-For convenience, OID's are usually represented in source code as numeric
-identifiers, or B<NID>'s.  OpenSSL has an internal table of OID's that
-are generated when the library is built, and their corresponding NID's
-are available as define'd constants.  For the functions below, application
-code should treat all returned values -- OID's, NID's, or names -- as
+For convenience, OIDs are usually represented in source code as numeric
+identifiers, or B<NID>s.  OpenSSL has an internal table of OIDs that
+are generated when the library is built, and their corresponding NIDs
+are available as defined constants.  For the functions below, application
+code should treat all returned values -- OIDs, NIDs, or names -- as
 constants.
 
 OBJ_nid2obj(), OBJ_nid2ln() and OBJ_nid2sn() convert the NID B<n> to
@@ -129,6 +129,10 @@ exists for a particular algorithm). As a result they B<cannot> be encoded or
 decoded as part of ASN.1 structures. Applications can determine if there
 is a corresponding OBJECT IDENTIFIER by checking OBJ_length() is not zero.
 
+These functions cannot return B<const> because an B<ASN1_OBJECT> can
+represent both an internal, constant, OID and a dynamically-created one.
+The latter cannot be constant because it needs to be freed after use.
+
 =head1 EXAMPLES
 
 Create an object for B<commonName>:
@@ -163,9 +167,6 @@ Instead B<buf> must point to a valid buffer and B<buf_len> should
 be set to a positive value. A buffer length of 80 should be more
 than enough to handle any OID encountered in practice.
 
-Many of the functions here should probably be changed to return B<const>
-pointers. But the lack of consistency makes that too awkward to do.
-
 =head1 RETURN VALUES
 
 OBJ_nid2obj() returns an B<ASN1_OBJECT> structure or B<NULL> is an