[openssl-commits] [openssl] OpenSSL_0_9_8-stable update

Dr. Stephen Henson steve at openssl.org
Mon Jul 6 17:44:00 UTC 2015


The branch OpenSSL_0_9_8-stable has been updated
       via  9b914c7f9147c49a569108ab7f524ebaeb92eaaa (commit)
      from  2c9dfa18aacdd22537ced0815d0a53532c019d5b (commit)


- Log -----------------------------------------------------------------
commit 9b914c7f9147c49a569108ab7f524ebaeb92eaaa
Author: Dr. Stephen Henson <steve at openssl.org>
Date:   Mon Jul 6 14:17:49 2015 +0100

    document -2 return value
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    (cherry picked from commit 5727582cf51e98e5e0faa435e7da2c8929533c0d)
    
    Conflicts:
    	doc/crypto/X509_NAME_get_index_by_NID.pod

-----------------------------------------------------------------------

Summary of changes:
 doc/crypto/X509_NAME_get_index_by_NID.pod | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/doc/crypto/X509_NAME_get_index_by_NID.pod b/doc/crypto/X509_NAME_get_index_by_NID.pod
index 3b1f9ff..3618b21 100644
--- a/doc/crypto/X509_NAME_get_index_by_NID.pod
+++ b/doc/crypto/X509_NAME_get_index_by_NID.pod
@@ -29,6 +29,7 @@ and issuer names.
 X509_NAME_get_index_by_NID() and X509_NAME_get_index_by_OBJ() retrieve
 the next index matching B<nid> or B<obj> after B<lastpos>. B<lastpos>
 should initially be set to -1. If there are no more entries -1 is returned.
+If B<nid> is invalid (doesn't correspond to a valid OID) then -2 is returned.
 
 X509_NAME_entry_count() returns the total number of entries in B<name>.
 
@@ -59,6 +60,10 @@ X509_NAME_get_index_by_OBJ() should be used followed by
 X509_NAME_get_entry() on any matching indices and then the
 various B<X509_NAME_ENTRY> utility functions on the result.
 
+Applications which could pass invalid NIDs to X509_NAME_get_index_by_NID()
+should check for the return value of -2. Alternatively the NID validity
+can be determined first by checking OBJ_nid2obj(nid) is not NULL.
+
 =head1 EXAMPLES
 
 Process all entries:
@@ -91,6 +96,8 @@ Process all commonName entries:
 
 X509_NAME_get_index_by_NID() and X509_NAME_get_index_by_OBJ()
 return the index of the next matching entry or -1 if not found.
+X509_NAME_get_index_by_NID() can also return -2 if the supplied
+NID is invalid.
 
 X509_NAME_entry_count() returns the total number of entries.
 


More information about the openssl-commits mailing list