Bug 1117897, don't export, but rather remove CERT_FindCertURLExtension, r=rrelyea NSS_3_18_RC2
authorKai Engert <kaie@kuix.de>
Tue, 17 Mar 2015 00:03:08 +0100
changeset 11397 c89e2dedb1277ec0acda8e8fccfbeb5034addc4c
parent 11396 a771bd050a744cbaa26455dc43372028c09469e4
child 11398 b01f280a73e940731d24ab37740ee5fa14264cef
push id597
push userkaie@kuix.de
push dateMon, 16 Mar 2015 23:03:57 +0000
reviewersrrelyea
bugs1117897
Bug 1117897, don't export, but rather remove CERT_FindCertURLExtension, r=rrelyea
lib/certdb/cert.h
lib/certdb/certv3.c
lib/nss/nss.def
--- a/lib/certdb/cert.h
+++ b/lib/certdb/cert.h
@@ -927,21 +927,16 @@ extern SECStatus CERT_FindCertExtension
 extern SECStatus CERT_FindNSCertTypeExtension
    (CERTCertificate *cert, SECItem *value);
 
 extern char * CERT_FindNSStringExtension (CERTCertificate *cert, int oidtag);
 
 extern SECStatus CERT_FindCertExtensionByOID
    (CERTCertificate *cert, SECItem *oid, SECItem *value);
 
-/* Find a URL extension in the cert.
-** The caller must free the result string using PORT_Free.
-*/
-extern char *CERT_FindCertURLExtension (CERTCertificate *cert, SECOidTag tag);
-
 /* Returns the decoded value of the authKeyID extension.
 **   Note that this uses passed in the arena to allocate storage for the result
 */
 extern CERTAuthKeyID * CERT_FindAuthKeyIDExten (PLArenaPool *arena,CERTCertificate *cert);
 
 /* Returns the decoded value of the basicConstraint extension.
  */
 extern SECStatus CERT_FindBasicConstraintExten
--- a/lib/certdb/certv3.c
+++ b/lib/certdb/certv3.c
@@ -38,82 +38,16 @@ SetExts(void *object, CERTCertExtension 
 }
 
 void *
 CERT_StartCertExtensions(CERTCertificate *cert)
 {
     return (cert_StartExtensions ((void *)cert, cert->arena, SetExts));
 }
 
-/* find a URL extension in the cert
- */
-char *
-CERT_FindCertURLExtension(CERTCertificate *cert, SECOidTag tag)
-{
-    SECStatus rv;
-    SECItem urlitem = {siBuffer,0};
-    SECItem urlstringitem = {siBuffer,0};
-    PLArenaPool *arena = NULL;
-    char *urlstring = NULL;
-    char *str;
-    int len;
-    
-    if (!cert) {
-        PORT_SetError(SEC_ERROR_INVALID_ARGS);
-        return NULL;
-    }
-
-    arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
-    if ( ! arena ) {
-	goto loser;
-    }
-    
-    rv = cert_FindExtension(cert->extensions, tag, &urlitem);
-    if ( rv != SECSuccess ) {
-	goto loser;
-    }
-
-    rv = SEC_QuickDERDecodeItem(arena, &urlstringitem,
-                                SEC_ASN1_GET(SEC_IA5StringTemplate), &urlitem);
-
-    if ( rv != SECSuccess ) {
-	goto loser;
-    }
-    
-    len = urlstringitem.len + 1;
-    
-    str = urlstring = (char *)PORT_Alloc(len);
-    if ( urlstring == NULL ) {
-	goto loser;
-    }
-    
-    /* copy the URL */
-    PORT_Memcpy(str, urlstringitem.data, urlstringitem.len);
-    str += urlstringitem.len;
-    
-    *str = '\0';
-    goto done;
-    
-loser:
-    if ( urlstring ) {
-	PORT_Free(urlstring);
-    }
-    
-    urlstring = NULL;
-done:
-    if ( arena ) {
-	PORT_FreeArena(arena, PR_FALSE);
-    }
-    if ( urlitem.data ) {
-	PORT_Free(urlitem.data);
-    }
-
-    return(urlstring);
-}
-
 /*
  * get the value of the Netscape Certificate Type Extension
  */
 SECStatus
 CERT_FindNSCertTypeExtension(CERTCertificate *cert, SECItem *retItem)
 {
 
     return (CERT_FindBitStringExtension
--- a/lib/nss/nss.def
+++ b/lib/nss/nss.def
@@ -1060,14 +1060,13 @@ CERT_GetGeneralNameTypeFromString;
 PK11_PubEncrypt;
 PK11_PrivDecrypt;
 ;+    local:
 ;+       *;
 ;+};
 ;+NSS_3.18 { 	# NSS 3.18 release
 ;+    global:
 __PK11_SetCertificateNickname;
-CERT_FindCertURLExtension;
 SEC_CheckCrlTimes;
 SEC_GetCrlTimes;
 ;+    local:
 ;+       *;
 ;+};