aboutsummaryrefslogtreecommitdiffstats
path: root/doc/crypto/X509_NAME_get_index_by_NID.pod
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2015-07-09 16:41:34 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2015-07-09 16:41:34 +0000
commitc07d7b3a386974c338492659291008bed07948e6 (patch)
tree4a088fbc0af7599e38a1d2eec27cb4a34e6b18ae /doc/crypto/X509_NAME_get_index_by_NID.pod
parent15533bcc3525a52ecfe00631bc36167d65c6b187 (diff)
downloadsrc-c07d7b3a386974c338492659291008bed07948e6.tar.gz
src-c07d7b3a386974c338492659291008bed07948e6.zip
Import OpenSSL 1.0.1p.vendor/openssl/1.0.1p
Notes
Notes: svn path=/vendor-crypto/openssl/dist/; revision=285327 svn path=/vendor-crypto/openssl/1.0.1p/; revision=285328; tag=vendor/openssl/1.0.1p
Diffstat (limited to 'doc/crypto/X509_NAME_get_index_by_NID.pod')
-rw-r--r--doc/crypto/X509_NAME_get_index_by_NID.pod7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/crypto/X509_NAME_get_index_by_NID.pod b/doc/crypto/X509_NAME_get_index_by_NID.pod
index c8a812879561..109f56132498 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>.
@@ -63,6 +64,10 @@ The list of all relevant B<NID_*> and B<OBJ_* codes> can be found in
the source code header files E<lt>openssl/obj_mac.hE<gt> and/or
E<lt>openssl/objects.hE<gt>.
+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:
@@ -95,6 +100,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.