Skip to content

Commit

Permalink
Bug 1117897, don't export, but rather remove CERT_FindCertURLExtensio…
Browse files Browse the repository at this point in the history
…n, r=rrelyea
  • Loading branch information
kaie committed Mar 16, 2015
1 parent d976221 commit b4348b1
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 72 deletions.
5 changes: 0 additions & 5 deletions lib/certdb/cert.h
Expand Up @@ -932,11 +932,6 @@ 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
*/
Expand Down
66 changes: 0 additions & 66 deletions lib/certdb/certv3.c
Expand Up @@ -43,72 +43,6 @@ 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
*/
Expand Down
1 change: 0 additions & 1 deletion lib/nss/nss.def
Expand Up @@ -1065,7 +1065,6 @@ PK11_PrivDecrypt;
;+NSS_3.18 { # NSS 3.18 release
;+ global:
__PK11_SetCertificateNickname;
CERT_FindCertURLExtension;
SEC_CheckCrlTimes;
SEC_GetCrlTimes;
;+ local:
Expand Down

0 comments on commit b4348b1

Please sign in to comment.