diff options
Diffstat (limited to 'security/nss/lib/pkix/src/Attribute')
39 files changed, 0 insertions, 4153 deletions
diff --git a/security/nss/lib/pkix/src/Attribute/AddValue.c b/security/nss/lib/pkix/src/Attribute/AddValue.c deleted file mode 100644 index aad082c50..000000000 --- a/security/nss/lib/pkix/src/Attribute/AddValue.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_AddValue - * - * This routine adds the specified attribute value to the set in - * the specified NSSPKIXAttribute. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAttribute_AddValue -( - NSSPKIXAttribute *attribute, - NSSPKIXAttributeValue *value -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_AddValue(attribute, value); -} - diff --git a/security/nss/lib/pkix/src/Attribute/Create.c b/security/nss/lib/pkix/src/Attribute/Create.c deleted file mode 100644 index 9fe406b2d..000000000 --- a/security/nss/lib/pkix/src/Attribute/Create.c +++ /dev/null @@ -1,141 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_Create - * - * This routine creates an NSSPKIXAttribute from specified components. - * This routine may return NULL upon error, in which case it will have - * created an error stack. If the optional arena argument is non-NULL, - * that arena will be used for the required memory. There must be at - * least one attribute value specified. The final argument must be - * NULL, to indicate the end of the set of attribute values. - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_OID - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_INSUFFICIENT_VALUES - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -NSSPKIXAttribute_Create -( - NSSArena *arenaOpt, - NSSPKIXAttributeType *typeOid, - NSSPKIXAttributeValue *value1, - ... -) -{ - va_list ap; - NSSPKIXAttribute *rv; - PRUint32 count; - - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - if( PR_SUCCESS != nssOID_verifyPointer(typeOid) ) { - return (NSSPKIXAttribute *)NULL; - } - - if( (NSSPKIXAttributeValue *)NULL == value1 ) { - nss_SetError(NSS_ERROR_INSUFFICIENT_VALUES); - return (NSSPKIXAttribute *)NULL; - } - - { - va_start(ap, typeOid); - - while( 1 ) { - NSSPKIXAttributeValue *v; - v = (NSSPKIXAttributeValue *)va_arg(ap, NSSPKIXAttributeValue *); - if( (NSSPKIXAttributeValue *)NULL == v ) { - break; - } - - if( PR_SUCCESS != nssItem_verifyPointer(v) ) { - va_end(ap); - return (NSSPKIXAttribute *)NULL; - } - } - - va_end(ap); - } -#endif /* DEBUG */ - - va_start(ap, typeOid); - - for( count = 0; ; count++ ) { - NSSPKIXAttributeValue *v; - v = (NSSPKIXAttributeValue *)va_arg(ap, NSSPKIXAttributeValue *); - if( (NSSPKIXAttributeValue *)NULL == v ) { - break; - } - -#ifdef PEDANTIC - if( count == 0xFFFFFFFF ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - va_end(ap); - return (NSSPKIXAttribute *)NULL; - } -#endif /* PEDANTIC */ - } - - va_end(ap); - - va_start(ap, typeOid); - rv = nss_pkix_Attribute_V_Create(arenaOpt, typeOid, count, ap); - va_end(ap); - - return rv; -} diff --git a/security/nss/lib/pkix/src/Attribute/CreateFromArray.c b/security/nss/lib/pkix/src/Attribute/CreateFromArray.c deleted file mode 100644 index 2928c3bcc..000000000 --- a/security/nss/lib/pkix/src/Attribute/CreateFromArray.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_CreateFromArray - * - * This routine creates an NSSPKIXAttribute from specified components. - * This routine may return NULL upon error, in which case it will have - * created an error stack. If the optional arena argument is non-NULL, - * that arena will be used for the required memory. There must be at - * least one attribute value specified. The final argument must be - * NULL, to indicate the end of the set of attribute values. - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_OID - * NSS_ERROR_INVALID_ITEM - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -NSSPKIXAttribute_CreateFromArray -( - NSSArena *arenaOpt, - NSSPKIXAttributeType *typeOid, - PRUint32 count, - NSSPKIXAttributeValue values[] -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - if( PR_SUCCESS != nssOID_verifyPointer(typeOid) ) { - return (NSSPKIXAttribute *)NULL; - } - - { - PRUint32 i; - - for( i = 0; i < count; i++ ) { - if( PR_SUCCESS != nssItem_verifyPointer(&values[i]) ) { - return (NSSPKIXAttribute *)NULL; - } - } - } -#endif /* DEBUG */ - - return nssPKIXAttribute_CreateFromArray(arenaOpt, typeOid, count, values); -} diff --git a/security/nss/lib/pkix/src/Attribute/Decode.c b/security/nss/lib/pkix/src/Attribute/Decode.c deleted file mode 100644 index a16f195cd..000000000 --- a/security/nss/lib/pkix/src/Attribute/Decode.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_Decode - * - * This routine creates an NSSPKIXAttribute by decoding a BER- - * or DER-encoded Attribute as defined in RFC 2459. This - * routine may return NULL upon error, in which case it will - * have created an error stack. If the optional arena argument - * is non-NULL, that arena will be used for the required memory. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_BER - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_ITEM - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -NSSPKIXAttribute_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXAttribute *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_Decode(arenaOpt, ber); -} diff --git a/security/nss/lib/pkix/src/Attribute/Destroy.c b/security/nss/lib/pkix/src/Attribute/Destroy.c deleted file mode 100644 index bd9454fca..000000000 --- a/security/nss/lib/pkix/src/Attribute/Destroy.c +++ /dev/null @@ -1,74 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_Destroy - * - * This routine destroys an NSSPKIXAttribute. It should be called on - * all such objects created without an arena. It does not need to be - * called for objects created with an arena, but it may be. This - * routine returns a PRStatus value. Upon error, it will create an - * error stack and return PR_FAILURE. - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_EXTERN PRStatus -NSSPKIXAttribute_Destroy -( - NSSPKIXAttribute *attribute -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_Destroy(attribute); -} diff --git a/security/nss/lib/pkix/src/Attribute/Duplicate.c b/security/nss/lib/pkix/src/Attribute/Duplicate.c deleted file mode 100644 index 146a49610..000000000 --- a/security/nss/lib/pkix/src/Attribute/Duplicate.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_Duplicate - * - * This routine duplicates an NSSPKIXAttribute. {arenaOpt} - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -NSSPKIXAttribute_Duplicate -( - NSSPKIXAttribute *attribute, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return (NSSPKIXAttribute *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXAttribute_Duplicate(attribute, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/Attribute/Encode.c b/security/nss/lib/pkix/src/Attribute/Encode.c deleted file mode 100644 index 179bd3d68..000000000 --- a/security/nss/lib/pkix/src/Attribute/Encode.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_Encode - * - * This routine returns an ASN.1 encoding of the specified - * NSSPKIXAttribute. {usual rules about itemOpt and arenaOpt} - * This routine indicates an error (NSS_ERROR_INVALID_DATA) - * if there are no attribute values (i.e., the last one was removed). - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_DATA - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSBER * -NSSPKIXAttribute_Encode -( - NSSPKIXAttribute *attribute, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return (NSSBER *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSBER *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXAttribute_Encode(attribute, encoding, rvOpt, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/Attribute/Equal.c b/security/nss/lib/pkix/src/Attribute/Equal.c deleted file mode 100644 index d91782aea..000000000 --- a/security/nss/lib/pkix/src/Attribute/Equal.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_Equal - * - * This routine compares two NSSPKIXAttribute's for equality. - * It returns PR_TRUE if they are equal, PR_FALSE otherwise. - * This routine also returns PR_FALSE upon error; if you're - * that worried about it, check for an error stack. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_IMPLEMENT PRBool -NSSPKIXAttribute_Equal -( - NSSPKIXAttribute *one, - NSSPKIXAttribute *two, - PRStatus *statusOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(one) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - - return PR_FALSE; - } - - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(two) ) { - if( (PRStatus *)NULL != statusOpt ) { - *statusOpt = PR_FAILURE; - } - - return PR_FALSE; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_Equal(one, two); -} diff --git a/security/nss/lib/pkix/src/Attribute/FindValue.c b/security/nss/lib/pkix/src/Attribute/FindValue.c deleted file mode 100644 index ba725051f..000000000 --- a/security/nss/lib/pkix/src/Attribute/FindValue.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_FindValue - * - * This routine searches the set of attribute values in the specified - * NSSPKIXAttribute for the provided data. If an exact match is found, - * then that value's index is returned. If an exact match is not - * found, -1 is returned. If there is more than one exact match, one - * index will be returned. {notes about unorderdness of SET, etc} - * If the index may not be represented as an integer, an error is - * indicated. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_NOT_FOUND - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value - * The index of the specified attribute value upon success - * -1 upon failure. - */ - -NSS_IMPLEMENT PRInt32 -NSSPKIXAttribute_FindValue -( - NSSPKIXAttribute *attribute, - NSSPKIXAttributeValue *value -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_FindValue(attribute, value); -} diff --git a/security/nss/lib/pkix/src/Attribute/GetType.c b/security/nss/lib/pkix/src/Attribute/GetType.c deleted file mode 100644 index 0bae2b988..000000000 --- a/security/nss/lib/pkix/src/Attribute/GetType.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_GetType - * - * This routine returns the attribute type oid of the specified - * NSSPKIXAttribute. - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSPKIXAttributeType pointer upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttributeType * -NSSPKIXAttribute_GetType -( - NSSPKIXAttribute *attribute -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return (NSSPKIXAttributeType *)NULL; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_GetType(attribute); -} diff --git a/security/nss/lib/pkix/src/Attribute/GetValue.c b/security/nss/lib/pkix/src/Attribute/GetValue.c deleted file mode 100644 index afce8d135..000000000 --- a/security/nss/lib/pkix/src/Attribute/GetValue.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_GetValue - * - * This routine returns the i'th attribute value of the set of - * values in the specified NSSPKIXAttribute. Although the set - * is unordered, an arbitrary ordering will be maintained until - * the data in the attribute is changed. {usual comments about - * itemOpt and arenaOpt} - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXAttributeValue upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeValue * -NSSPKIXAttribute_GetValue -( - NSSPKIXAttribute *attribute, - PRInt32 i, - NSSPKIXAttributeValue *itemOpt, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return (NSSPKIXAttributeValue *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttributeValue *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXAttribute_GetValue(attribute, i, itemOpt, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/Attribute/GetValueCount.c b/security/nss/lib/pkix/src/Attribute/GetValueCount.c deleted file mode 100644 index 0cdc36b60..000000000 --- a/security/nss/lib/pkix/src/Attribute/GetValueCount.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_GetValueCount - * - * This routine returns the number of attribute values present in - * the specified NSSPKIXAttribute. This routine returns a PRInt32. - * Upon error, this routine returns -1. This routine indicates an - * error if the number of values cannot be expressed as a PRInt32. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value: - * Nonnegative integer upon success - * -1 upon failure. - */ - -NSS_IMPLEMENT PRInt32 -NSSPKIXAttribute_GetValueCount -( - NSSPKIXAttribute *attribute -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return -1; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_GetValueCount(attribute); -} - diff --git a/security/nss/lib/pkix/src/Attribute/GetValues.c b/security/nss/lib/pkix/src/Attribute/GetValues.c deleted file mode 100644 index 986af03d1..000000000 --- a/security/nss/lib/pkix/src/Attribute/GetValues.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_GetValues - * - * This routine returns all of the attribute values in the specified - * NSSPKIXAttribute. If the optional pointer to an array of NSSItems - * is non-null, then that array will be used and returned; otherwise, - * an array will be allocated and returned. If the limit is nonzero - * (which is must be if the specified array is nonnull), then an - * error is indicated if it is smaller than the value count. - * {arenaOpt} - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_ARRAY_TOO_SMALL - * - * Return value: - * A valid pointer to an array of NSSItem's upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttributeValue * -NSSPKIXAttribute_GetValues -( - NSSPKIXAttribute *attribute, - NSSPKIXAttributeValue rvOpt[], - PRInt32 limit, - NSSArena *arenaOpt -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return (NSSPKIXAttributeValue *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyOpt(attribute) ) { - return (NSSPKIXAttributeValue *)NULL; - } - } -#endif /* DEBUG */ - - return nssPKIXAttribute_GetValues(attribute, rvOpt, limit, arenaOpt); -} diff --git a/security/nss/lib/pkix/src/Attribute/MClear.c b/security/nss/lib/pkix/src/Attribute/MClear.c deleted file mode 100644 index 6fb77ba7d..000000000 --- a/security/nss/lib/pkix/src/Attribute/MClear.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nss_pkix_Attribute_Clear - * - * Wipes out cached data. - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_Attribute_Clear -( - NSSPKIXAttribute *a -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( (NSSBER *)NULL != a->ber ) { - nss_ZFreeIf(a->ber->data); - nss_ZFreeIf(a->ber); - } - - if( (NSSDER *)NULL != a->der ) { - nss_ZFreeIf(a->der->data); - nss_ZFreeIf(a->der); - } - - return PR_SUCCESS; -} diff --git a/security/nss/lib/pkix/src/Attribute/MCount.c b/security/nss/lib/pkix/src/Attribute/MCount.c deleted file mode 100644 index abb0831cb..000000000 --- a/security/nss/lib/pkix/src/Attribute/MCount.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIXM_H -#include "pkixm.h" -#endif /* PKIXM_H */ - -/* - * nss_pkix_Attribute_Count - * - * This module-private routine sets the valuesCount part of the - * NSSPKIXAttribute argument. It does no checking, and is intended - * only for use inside the NSSPKIXAttribute implementation itself. - * There is no error return. There is no return value. - */ - -NSS_IMPLEMENT void -nss_pkix_Attribute_Count -( - NSSPKIXAttribute *a -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return; - } -#endif /* NSSDEBUG */ - - PR_ASSERT((nssASN1Item **)NULL != a->asn1values); - if( (nssASN1Item *)NULL == a->asn1values ) { - nss_SetError(NSS_ERROR_ASSERTION_FAILED); - return; - } - - if( 0 == a->valuesCount ) { - PRUint32 i; - for( i = 0; i < 0xFFFFFFFF; i++ ) { - if( (nssASN1Item *)NULL == a->asn1values[i] ) { - break; - } - } - -#ifdef PEDANTIC - if( 0xFFFFFFFF == i ) { - return; - } -#endif /* PEDANTIC */ - - a->valuesCount = i; - } - - return; -} diff --git a/security/nss/lib/pkix/src/Attribute/MVCreate.c b/security/nss/lib/pkix/src/Attribute/MVCreate.c deleted file mode 100644 index 1a54026d4..000000000 --- a/security/nss/lib/pkix/src/Attribute/MVCreate.c +++ /dev/null @@ -1,165 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIXM_H -#include "pkixm.h" -#endif /* PKIXM_H */ - -/* - * nss_pkix_Attribute_V_Create - * - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_OID - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_INTERNAL_ERROR; - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -nss_pkix_Attribute_V_Create -( - NSSArena *arenaOpt, - NSSPKIXAttributeType *typeOid, - PRUint32 count, - va_list ap -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXAttribute *rv = (NSSPKIXAttribute *)NULL; - PRStatus status; - PRUint32 i; - - if( (NSSArena *)NULL == arenaOpt ) { - arena = nssArena_Create(); - if( (NSSArena *)NULL == arena ) { - goto loser; - } - arena_allocated = PR_TRUE; - } else { - arena = arenaOpt; - mark = nssArena_Mark(arena); - if( (nssArenaMark *)NULL == mark ) { - goto loser; - } - } - - rv = nss_ZNEW(arena, NSSPKIXAttribute); - if( (NSSPKIXAttribute *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - - rv->type = typeOid; - { - NSSItem typeder; - NSSItem *x = nssOID_GetDEREncoding(rv->type, &typeder, arena); - if( (NSSItem *)NULL == x ) { - goto loser; - } - - rv->asn1type.size = typeder.size; - rv->asn1type.data = typeder.data; - } - - rv->valuesCount = count; - - rv->asn1values = nss_ZNEWARRAY(arena, nssASN1Item *, count); - if( (nssASN1Item **)NULL == rv->asn1values ) { - goto loser; - } - - for( i = 0; i < count; i++ ) { - NSSItem tmp; - NSSPKIXAttributeValue *v = (NSSPKIXAttributeValue *) - va_arg(ap, NSSPKIXAttributeValue *); - - rv->asn1values[i] = nss_ZNEW(arena, nssASN1Item); - if( (nssASN1Item *)NULL == rv->asn1values[i] ) { - goto loser; - } - - if( (NSSItem *)NULL == nssItem_Duplicate(v, arena, &tmp) ) { - goto loser; - } - - rv->asn1values[i].size = tmp.size; - rv->asn1values[i].data = tmp.data; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_Attribute_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != - nssArena_registerDestructor(arena, - nss_pkix_Attribute_remove_pointer, - rv) ) { - (void)nss_pkix_Attribute_remove_pointer(rv); - goto loser; - } -#endif /* DEBUG */ - - return rv; - - loser: - if( (nssArenaMark *)NULL != mark ) { - (void)nssArena_Release(arena, mark); - } - - if( PR_TRUE == arena_allocated ) { - (void)nssArena_Destroy(arena); - } - - return (NSSPKIXAttribute *)NULL; -} diff --git a/security/nss/lib/pkix/src/Attribute/PAddValue.c b/security/nss/lib/pkix/src/Attribute/PAddValue.c deleted file mode 100644 index 732845490..000000000 --- a/security/nss/lib/pkix/src/Attribute/PAddValue.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_AddValue - * - * This routine adds the specified attribute value to the set in - * the specified NSSPKIXAttribute. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAttribute_AddValue -( - NSSPKIXAttribute *a, - NSSPKIXAttributeValue *value -) -{ - PRUint32 newcount; - nssASN1Item **new_asn1_items = (nssASN1Item **)NULL; - NSSItem tmp; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - PR_ASSERT((nssASN1Item **)NULL != a->asn1values); - if( (nssASN1Item **)NULL == a->asn1values ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - return PR_FAILURE; - } - - if( 0 == a->valuesCount ) { - PRUint32 i; - - for( i = 0; i < 0xFFFFFFFF; i++ ) { - if( (nssASN1Item *)NULL == a->asn1values[i] ) { - break; - } - } - -#ifdef PEDANTIC - if( 0xFFFFFFFF == i ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - /* Internal error is that we don't handle them this big */ - return PR_FAILURE; - } -#endif /* PEDANTIC */ - - a->valuesCount = i; - } - - newcount = a->valuesCount + 1; - /* Check newcount for a rollover. */ - - /* Remember that our asn1values array is NULL-terminated */ - new_asn1_items = (nssASN1Item **)nss_ZRealloc(a->asn1values, - ((newcount+1) * sizeof(nssASN1Item *))); - if( (nssASN1Item **)NULL == new_asn1_items ) { - goto loser; - } - - new_asn1_items[ a->valuesCount ] = nss_ZNEW(a->arena, nssASN1Item); - if( (nssASN1Item *)NULL == new_asn1_items[ a->valuesCount ] ) { - goto loser; - } - - if( (NSSItem *)NULL == nssItem_Duplicate(value, a->arena, &tmp) ) { - goto loser; - } - - new_asn1_items[ a->valuesCount ]->size = tmp.size; - new_asn1_items[ a->valuesCount ]->data = tmp.data; - - a->valuesCount++; - a->asn1values = new_asn1_items; - - return nss_pkix_Attribute_Clear(a); - - loser: - if( (nssASN1Item **)NULL != new_asn1_items ) { - nss_ZFreeIf(new_asn1_items[ newcount-1 ]); - /* We could realloc back down, but we actually know it's a no-op */ - a->asn1values = new_asn1_items; - } - - return PR_FAILURE; -} diff --git a/security/nss/lib/pkix/src/Attribute/PCreate.c b/security/nss/lib/pkix/src/Attribute/PCreate.c deleted file mode 100644 index 40dc5c07c..000000000 --- a/security/nss/lib/pkix/src/Attribute/PCreate.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_Create - * - * This routine creates an NSSPKIXAttribute from specified components. - * This routine may return NULL upon error, in which case it will have - * created an error stack. If the optional arena argument is non-NULL, - * that arena will be used for the required memory. There must be at - * least one attribute value specified. The final argument must be - * NULL, to indicate the end of the set of attribute values. - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_OID - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_INSUFFICIENT_VALUES - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_EXTERN NSSPKIXAttribute * -nssPKIXAttribute_Create -( - NSSArena *arenaOpt, - NSSPKIXAttributeType *typeOid, - NSSPKIXAttributeValue *value1, - ... -) -{ - va_list ap; - NSSPKIXAttribute *rv; - PRUint32 count; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - if( PR_SUCCESS != nssOID_verifyPointer(typeOid) ) { - return (NSSPKIXAttribute *)NULL; - } - - if( (NSSPKIXAttributeValue *)NULL == value1 ) { - nss_SetError(NSS_ERROR_INSUFFICIENT_VALUES); - return (NSSPKIXAttribute *)NULL; - } - - { - va_start(ap, typeOid); - - while( 1 ) { - NSSPKIXAttributeValue *v; - v = (NSSPKIXAttributeValue *)va_arg(ap, NSSPKIXAttributeValue *); - if( (NSSPKIXAttributeValue *)NULL == v ) { - break; - } - - if( PR_SUCCESS != nssItem_verifyPointer(v) ) { - va_end(ap); - return (NSSPKIXAttribute *)NULL; - } - } - - va_end(ap); - } -#endif /* NSSDEBUG */ - - va_start(ap, typeOid); - - for( count = 0; ; count++ ) { - NSSPKIXAttributeValue *v; - v = (NSSPKIXAttributeValue *)va_arg(ap, NSSPKIXAttributeValue *); - if( (NSSPKIXAttributeValue *)NULL == v ) { - break; - } - -#ifdef PEDANTIC - if( count == 0xFFFFFFFF ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - va_end(ap); - return (NSSPKIXAttribute *)NULL; - } -#endif /* PEDANTIC */ - } - - va_end(ap); - - va_start(ap, typeOid); - rv = nss_pkix_Attribute_V_Create(arenaOpt, typeOid, count, ap); - va_end(ap); - - return rv; -} diff --git a/security/nss/lib/pkix/src/Attribute/PCreateFromArray.c b/security/nss/lib/pkix/src/Attribute/PCreateFromArray.c deleted file mode 100644 index c2d301d12..000000000 --- a/security/nss/lib/pkix/src/Attribute/PCreateFromArray.c +++ /dev/null @@ -1,191 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -#ifndef ASN1_H -#include "asn1.h" -#endif /* ASN1_H */ - -/* - * nssPKIXAttribute_CreateFromArray - * - * This routine creates an NSSPKIXAttribute from specified components. - * This routine may return NULL upon error, in which case it will have - * created an error stack. If the optional arena argument is non-NULL, - * that arena will be used for the required memory. There must be at - * least one attribute value specified. The final argument must be - * NULL, to indicate the end of the set of attribute values. - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_OID - * NSS_ERROR_INVALID_ITEM - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -nssPKIXAttribute_CreateFromArray -( - NSSArena *arenaOpt, - NSSPKIXAttributeType *typeOid, - PRUint32 count, - NSSPKIXAttributeValue values[] -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXAttribute *rv = (NSSPKIXAttribute *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - if( PR_SUCCESS != nssOID_verifyPointer(typeOid) ) { - return (NSSPKIXAttribute *)NULL; - } - - for( i = 0; i < count; i++ ) { - if( PR_SUCCESS != nssItem_verifyPointer(&values[i]) ) { - return (NSSPKIXAttribute *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( (NSSArena *)NULL == arenaOpt ) { - arena = nssArena_Create(); - if( (NSSArena *)NULL == arena ) { - goto loser; - } - arena_allocated = PR_TRUE; - } else { - arena = arenaOpt; - mark = nssArena_Mark(arena); - if( (nssArenaMark *)NULL == mark ) { - goto loser; - } - } - - rv = nss_ZNEW(arena, NSSPKIXAttribute); - if( (NSSPKIXAttribute *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - - rv->type = typeOid; - { - NSSItem typeder; - NSSItem *x = nssOID_GetDEREncoding(rv->type, &typeder, arena); - if( (NSSItem *)NULL == x ) { - goto loser; - } - - rv->asn1type.size = typeder.size; - rv->asn1type.data = typeder.data; - } - - rv->valuesCount = count; - - rv->asn1values = nss_ZNEWARRAY(arena, nssASN1Item *, count); - if( (nssASN1Item **)NULL == rv->asn1values ) { - goto loser; - } - - for( i = 0; i < count; i++ ) { - NSSItem tmp; - NSSPKIXAttributeValue *v = &values[i]; - - rv->asn1values[i] = nss_ZNEW(arena, nssASN1Item); - if( (nssASN1Item *)NULL == rv->asn1values[i] ) { - goto loser; - } - - if( (NSSItem *)NULL == nssItem_Duplicate(v, arena, &tmp) ) { - goto loser; - } - - rv->asn1values[i].size = tmp.size; - rv->asn1values[i].data = tmp.data; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_Attribute_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != - nssArena_registerDestructor(arena, - nss_pkix_Attribute_remove_pointer, - rv) ) { - (void)nss_pkix_Attribute_remove_pointer(rv); - goto loser; - } -#endif /* DEBUG */ - - return rv; - - loser: - if( (nssArenaMark *)NULL != mark ) { - (void)nssArena_Release(arena, mark); - } - - if( PR_TRUE == arena_allocated ) { - (void)nssArena_Destroy(arena); - } - - return (NSSPKIXAttribute *)NULL; -} diff --git a/security/nss/lib/pkix/src/Attribute/PDecode.c b/security/nss/lib/pkix/src/Attribute/PDecode.c deleted file mode 100644 index 49a059404..000000000 --- a/security/nss/lib/pkix/src/Attribute/PDecode.c +++ /dev/null @@ -1,153 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -#ifndef ASN1_H -#include "asn1.h" -#endif /* ASN1_H */ - -/* - * nssPKIXAttribute_Decode - * - * This routine creates an NSSPKIXAttribute by decoding a BER- - * or DER-encoded Attribute as defined in RFC 2459. This - * routine may return NULL upon error, in which case it will - * have created an error stack. If the optional arena argument - * is non-NULL, that arena will be used for the required memory. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_BER - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_INVALID_ITEM - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -nssPKIXAttribute_Decode -( - NSSArena *arenaOpt, - NSSBER *ber -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXAttribute *rv = (NSSPKIXAttribute *)NULL; - PRStatus status; - PRUint32 i; - -#ifdef NSSDEBUG - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttribute *)NULL; - } - } - - if( PR_SUCCESS != nssItem_verifyPointer(ber) ) { - return (NSSPKIXAttribute *)NULL; - } -#endif /* NSSDEBUG */ - - if( (NSSArena *)NULL == arenaOpt ) { - arena = nssArena_Create(); - if( (NSSArena *)NULL == arena ) { - goto loser; - } - arena_allocated = PR_TRUE; - } else { - arena = arenaOpt; - mark = nssArena_Mark(arena); - if( (nssArenaMark *)NULL == mark ) { - goto loser; - } - } - - rv = nss_ZNEW(arena, NSSPKIXAttribute); - if( (NSSPKIXAttribute *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - rv->ber = nssItem_Duplicate(ber, arena, (NSSItem *)NULL); - if( (NSSItem *)NULL == rv->ber ) { - goto loser; - } - - status = nssASN1_DecodeBER(arena, rv, nssPKIXAttribute_template, ber); - if( PR_SUCCESS != status ) { - goto loser; - } - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_Attribute_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != nssArena_registerDestructor(arena, - nss_pkix_Attribute_remove_pointer, rv) ) { - (void)nss_pkix_Attribute_remove_pointer(rv); - goto loser; - } -#endif /* DEBUG */ - - return rv; - - loser: - if( (nssArenaMark *)NULL != mark ) { - (void)nssArena_Release(arena, mark); - } - - if( PR_TRUE == arena_allocated ) { - (void)nssArena_Destroy(arena); - } - - return (NSSPKIXAttribute *)NULL; -} diff --git a/security/nss/lib/pkix/src/Attribute/PDestroy.c b/security/nss/lib/pkix/src/Attribute/PDestroy.c deleted file mode 100644 index 5f2b5a135..000000000 --- a/security/nss/lib/pkix/src/Attribute/PDestroy.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_Destroy - * - * This routine destroys an NSSPKIXAttribute. It should be called on - * all such objects created without an arena. It does not need to be - * called for objects created with an arena, but it may be. This - * routine returns a PRStatus value. Upon error, it place an error on - * the error stack and return PR_FAILURE. - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAttribute_Destroy -( - NSSPKIXAttribute *attribute -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - -#ifdef DEBUG - (void)nss_pkix_Attribute_remove_pointer(attribute); - (void)nssArena_RemoveDestructor(arena, nss_pkix_Attribute_remove_pointer, - attribute); -#endif /* DEBUG */ - - if( PR_TRUE == attribute->i_allocated_arena ) { - return nssArena_Destroy(attribute->arena); - } - - return PR_SUCCESS; -} diff --git a/security/nss/lib/pkix/src/Attribute/PDuplicate.c b/security/nss/lib/pkix/src/Attribute/PDuplicate.c deleted file mode 100644 index 765510e59..000000000 --- a/security/nss/lib/pkix/src/Attribute/PDuplicate.c +++ /dev/null @@ -1,189 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_Duplicate - * - * This routine duplicates an NSSPKIXAttribute. {arenaOpt} - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid pointer to an NSSPKIXAttribute upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttribute * -nssPKIXAttribute_Duplicate -( - NSSPKIXAttribute *attribute, - NSSArena *arenaOpt -) -{ - NSSArena *arena; - PRBool arena_allocated = PR_FALSE; - nssArenaMark *mark = (nssArenaMark *)NULL; - NSSPKIXAttribute *rv = (NSSPKIXAttribute *)NULL; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return PR_FAILURE; - } - } -#endif /* NSSDEBUG */ - - if( (NSSArena *)NULL == arenaOpt ) { - arena = nssArena_Create(); - if( (NSSArena *)NULL == arena ) { - goto loser; - } - arena_allocated = PR_TRUE; - } else { - arena = arenaOpt; - mark = nssArena_Mark(arena); - if( (nssArenaMark *)NULL == mark ) { - goto loser; - } - } - - rv = nss_ZNEW(arena, NSSPKIXAttribute); - if( (NSSPKIXAttribute *)NULL == rv ) { - goto loser; - } - - rv->arena = arena; - rv->i_allocated_arena = arena_allocated; - - if( (NSSBER *)NULL != attribute->ber ) { - rv->ber = nssItem_Duplicate(arena, attribute->ber, (NSSItem *)NULL); - if( (NSSBER *)NULL == rv->ber ) { - goto loser; - } - } - - if( (NSSDER *)NULL != attribute->der ) { - rv->der = nssItem_Duplicate(arena, attribute->der, (NSSItem *)NULL); - if( (NSSDER *)NULL == rv->der ) { - goto loser; - } - } - - if( (void *)NULL != attribute->asn1type.data ) { - rv->asn1type.size = attribute->asn1type.size; - rv->asn1type.data = nss_ZAlloc(arena, attribute->asn1type.size); - if( (void *)NULL == rv->asn1type.data ) { - goto loser; - } - (void)nsslibc_memcpy(rv->asn1type.data, attribute->asn1type.data, - rv->asn1type.size); - } - - if( (nssASN1Item **)NULL != attribute->asn1values ) { - rv->asn1values = nss_ZNEWARRAY(arena, nssASN1Item *, attribute->valuesCount); - if( (nssASN1Item **)NULL == rv->asn1values ) { - goto loser; - } - - for( i = 0; i < attribute->valuesCount; i++ ) { - nssASN1Item *src; - nssASN1Item *dst; - - src = attribute->asn1values[i]; - dst = nss_ZNEW(arena, nssASN1Item); - if( (nssASN1Item *)NULL == dst ) { - goto loser; - } - - rv->asn1values[i] = dst; - - dst->size = src->size; - dst->data = nss_ZAlloc(arena, dst->size); - if( (void *)NULL == dst->data ) { - goto loser; - } - (void)nsslibc_memcpy(dst->data, src->data, src->size); - } - } - - rv->type = attribute->type; /* NULL or otherwise */ - rv->valuescount = attribute->valuesCount; - - if( (nssArenaMark *)NULL != mark ) { - if( PR_SUCCESS != nssArena_Unmark(arena, mark) ) { - goto loser; - } - } - -#ifdef DEBUG - if( PR_SUCCESS != nss_pkix_Attribute_add_pointer(rv) ) { - goto loser; - } - - if( PR_SUCCESS != - nssArena_registerDestructor(arena, - nss_pkix_Attribute_remove_pointer, - rv) ) { - (void)nss_pkix_Attribute_remove_pointer(rv); - goto loser; - } -#endif /* DEBUG */ - - return rv; - - loser: - if( (nssArenaMark *)NULL != mark ) { - (void)nssArena_Release(arena, mark); - } - - if( PR_TRUE == arena_allocated ) { - (void)nssArena_Destroy(arena); - } - - return (NSSPKIXAttribute *)NULL; -} diff --git a/security/nss/lib/pkix/src/Attribute/PEncode.c b/security/nss/lib/pkix/src/Attribute/PEncode.c deleted file mode 100644 index 7fc647ed2..000000000 --- a/security/nss/lib/pkix/src/Attribute/PEncode.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -#ifndef ASN1_H -#include "asn1.h" -#endif /* ASN1_H */ - -/* - * nssPKIXAttribute_Encode - * - * This routine returns an ASN.1 encoding of the specified - * NSSPKIXAttribute. {usual rules about itemOpt and arenaOpt} - * This routine indicates an error (NSS_ERROR_INVALID_DATA) - * if there are no attribute values (i.e., the last one was removed). - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_DATA - * - * Return value: - * A valid NSSBER pointer upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSBER * -nssPKIXAttribute_Encode -( - NSSPKIXAttribute *a, - NSSASN1EncodingType encoding, - NSSBER *rvOpt, - NSSArena *arenaOpt -) -{ - NSSBER *it; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return (NSSBER *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSBER *)NULL; - } - } -#endif /* NSSDEBUG */ - - switch( encoding ) { - case NSSASN1BER: - if( (NSSBER *)NULL != a->ber ) { - it = a->ber; - goto done; - } - /*FALLTHROUGH*/ - case NSSASN1DER: - if( (NSSDER *)NULL != a->der ) { - it = a->der; - goto done; - } - break; - default: - nss_SetError(NSS_ERROR_UNSUPPORTED_ENCODING); - return (NSSBER *)NULL; - } - - it = nssASN1_EncodeItem(a->arena, (NSSItem *)NULL, a, - nssPKIXAttribute_template, encoding); - if( (NSSBER *)NULL == it ) { - return (NSSBER *)NULL; - } - - switch( encoding ) { - case NSSASN1BER: - a->ber = it; - break; - case NSSASN1DER: - a->der = it; - break; - default: - PR_ASSERT(0); - break; - } - - done: - return nssItem_Duplicate(it, arenaOpt, rvOpt); -} diff --git a/security/nss/lib/pkix/src/Attribute/PEqual.c b/security/nss/lib/pkix/src/Attribute/PEqual.c deleted file mode 100644 index 247bfd575..000000000 --- a/security/nss/lib/pkix/src/Attribute/PEqual.c +++ /dev/null @@ -1,164 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_Equal - * - * This routine compares two NSSPKIXAttribute's for equality. - * It returns PR_TRUE if they are equal, PR_FALSE otherwise. - * This routine also returns PR_FALSE upon error; if you're - * that worried about it, check for an error stack. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * - * Return value: - * PR_TRUE if the two objects have equal values - * PR_FALSE otherwise - * PR_FALSE upon error - */ - -NSS_IMPLEMENT PRBool -nssPKIXAttribute_Equal -( - NSSPKIXAttribute *one, - NSSPKIXAttribute *two, - PRStatus *statusOpt -) -{ - PRStatus dummyStatus = PR_SUCCESS; /* quiet warnings */ - PRStatus *status; - PRUint32 i; - - if( (PRStatus *)NULL != statusOpt ) { - status = statusOpt; - *status = PR_SUCCESS; - } else { - status = &dummyStatus; - } - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(one) ) { - *status = PR_FAILURE; - return PR_FALSE; - } - - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(two) ) { - *status = PR_FAILURE; - return PR_FALSE; - } -#endif /* NSSDEBUG */ - - if( ((NSSDER *)NULL != one->der) && ((NSSDER *)NULL != two->der) ) { - return nssItem_Equal(one->der, two->der, statusOpt); - } - - if( (NSSPKIXAttributeType *)NULL == one->type ) { - NSSItem berOid; - berOid.size = one->asn1type.size; - berOid.data = one->asn1type.data; - one->type = (NSSPKIXAttributeType *)NSSOID_CreateFromBER(&berOid); - } - - if( (NSSPKIXAttributeType *)NULL == two->type ) { - NSSItem berOid; - berOid.size = two->asn1type.size; - berOid.data = two->asn1type.data; - two->type = (NSSPKIXAttributeType *)NSSOID_CreateFromBER(&berOid); - } - - if( one->type != two->type ) { - return PR_FALSE; - } - - if( 0 == one->valuesCount ) { - nss_pkix_Attribute_Count(one); - } - -#ifdef PEDANTIC - if( 0 == one->valuesCount ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - *statusOpt = PR_FAILURE; - return PR_FALSE; - } -#endif /* PEDANTIC */ - - if( 0 == two->valuesCount ) { - nss_pkix_Attribute_Count(two); - } - -#ifdef PEDANTIC - if( 0 == two->valuesCount ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - *statusOpt = PR_FAILURE; - return PR_FALSE; - } -#endif /* PEDANTIC */ - - if( one->valuesCount != two->valuesCount ) { - return PR_FALSE; - } - - *status = nss_pkix_Attribute_Distinguish(one); - if( PR_FAILURE == *status ) { - return PR_FALSE; - } - - *status = nss_pkix_Attribute_Distinguish(two); - if( PR_FAILURE == *status ) { - return PR_FALSE; - } - - for( i == 0; i < one->valuesCount; i++ ) { - NSSItem onetmp, twotmp; - - onetmp.size = one->asn1values[i]->size; - onetmp.data = one->asn1values[i]->data; - twotmp.size = two->asn1values[i]->size; - twotmp.data = two->asn1values[i]->data; - - if( PR_FALSE == nssItem_Equal(&one, &two, statusOpt) ) { - return PR_FALSE; - } - } - - return PR_TRUE; -} diff --git a/security/nss/lib/pkix/src/Attribute/PFindValue.c b/security/nss/lib/pkix/src/Attribute/PFindValue.c deleted file mode 100644 index 0f1095f0c..000000000 --- a/security/nss/lib/pkix/src/Attribute/PFindValue.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_FindValue - * - * This routine searches the set of attribute values in the specified - * NSSPKIXAttribute for the provided data. If an exact match is found, - * then that value's index is returned. If an exact match is not - * found, -1 is returned. If there is more than one exact match, one - * index will be returned. {notes about unorderdness of SET, etc} - * If the index may not be represented as an integer, an error is - * indicated. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_NOT_FOUND - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value - * The index of the specified attribute value upon success - * -1 upon failure. - */ - -NSS_IMPLEMENT PRInt32 -nssPKIXAttribute_FindValue -( - NSSPKIXAttribute *a, - NSSPKIXAttributeValue *attributeValue -) -{ - PRUint32 i; - nssASN1Item **a; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - PR_ASSERT((nssASN1Item **)NULL != a->asn1values); - if( (nssASN1Item **)NULL == a->asn1values ) { - nss_SetError(NSS_ERROR_ASSERTION_FAILED); - return -1; - } - - for( i = 0, a = &a->asn1values[0]; *a; a++, (i > 0x7fffffff) || i++ ) { - NSSItem tmp; - - tmp.size = (*a)->size; - tmp.data = (*a)->data; - - if( PR_TRUE == nssItem_Equal(attributeValue, &tmp, (PRStatus *)NULL) ) { - if( i > 0x7fffffff ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return -1; - } - return (PRInt32)i; - } - } - - nss_SetError(NSS_ERROR_NOT_FOUND); - return -1; -} diff --git a/security/nss/lib/pkix/src/Attribute/PGetType.c b/security/nss/lib/pkix/src/Attribute/PGetType.c deleted file mode 100644 index 4b61431b8..000000000 --- a/security/nss/lib/pkix/src/Attribute/PGetType.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_GetType - * - * This routine returns the attribute type oid of the specified - * NSSPKIXAttribute. - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_NO_MEMORY - * - * Return value: - * A valid NSSPKIXAttributeType pointer upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttributeType * -nssPKIXAttribute_GetType -( - NSSPKIXAttribute *a -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return (NSSPKIXAttributeType *)NULL; - } -#endif /* NSSDEBUG */ - - if( (NSSPKIXAttributeType *)NULL == a->type ) { - NSSItem ber; - - ber.size = a->asn1type.size; - ber.data = a->asn1type.data; - - a->type = (NSSPKIXAttributeType *)NSSOID_CreateFromBER(&ber); - } - - return a->type; -} diff --git a/security/nss/lib/pkix/src/Attribute/PGetValue.c b/security/nss/lib/pkix/src/Attribute/PGetValue.c deleted file mode 100644 index bbf12ca67..000000000 --- a/security/nss/lib/pkix/src/Attribute/PGetValue.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_GetValue - * - * This routine returns the i'th attribute value of the set of - * values in the specified NSSPKIXAttribute. Although the set - * is unordered, an arbitrary ordering will be maintained until - * the data in the attribute is changed. {usual comments about - * itemOpt and arenaOpt} [0,valueCount) - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INVALID_ARENA - * - * Return value: - * A valid pointer to an NSSPKIXAttributeValue upon success - * NULL upon failure - */ - -NSS_IMPLEMENT NSSPKIXAttributeValue * -nssPKIXAttribute_GetValue -( - NSSPKIXAttribute *attribute, - PRInt32 i, - NSSPKIXAttributeValue *itemOpt, - NSSArena *arenaOpt -) -{ - NSSItem tmp; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return (NSSPKIXAttributeValue *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyPointer(arenaOpt) ) { - return (NSSPKIXAttributeValue *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( 0 == attribute->valuesCount ) { - nss_pkix_Attribute_Count(attribute); - } - - if( (i < 0) || (i >= attribute->valuesCount) ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return (NSSPKIXAttributeValue *)NULL; - } - - tmp.size = attribute->asn1values[i]->size; - tmp.data = attribute->asn1values[i]->data; - - return nssItem_Duplicate(&tmp, arenaOpt, itemOpt); -} diff --git a/security/nss/lib/pkix/src/Attribute/PGetValueCount.c b/security/nss/lib/pkix/src/Attribute/PGetValueCount.c deleted file mode 100644 index ada1d403d..000000000 --- a/security/nss/lib/pkix/src/Attribute/PGetValueCount.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_GetValueCount - * - * This routine returns the number of attribute values present in - * the specified NSSPKIXAttribute. This routine returns a PRInt32. - * Upon error, this routine returns -1. This routine indicates an - * error if the number of values cannot be expressed as a PRInt32. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * - * Return value: - * Nonnegative integer upon success - * -1 upon failure. - */ - -NSS_IMPLEMENT PRInt32 -nssPKIXAttribute_GetValueCount -( - NSSPKIXAttribute *attribute -) -{ -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return -1; - } -#endif /* NSSDEBUG */ - - if( 0 == attribute->valuesCount ) { - nss_pkix_Attribute_Count(attribute); - } - -#ifdef PEDANTIC - if( 0 == attribute->valuesCount ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return -1; - } -#endif /* PEDANTIC */ - - if( attribute->valuesCount > 0x7fffffff ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return -1; - } - - return (PRInt32)(attribute->valuesCount); -} diff --git a/security/nss/lib/pkix/src/Attribute/PGetValues.c b/security/nss/lib/pkix/src/Attribute/PGetValues.c deleted file mode 100644 index ccc11dbe0..000000000 --- a/security/nss/lib/pkix/src/Attribute/PGetValues.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_GetValues - * - * This routine returns all of the attribute values in the specified - * NSSPKIXAttribute. If the optional pointer to an array of NSSItems - * is non-null, then that array will be used and returned; otherwise, - * an array will be allocated and returned. If the limit is nonzero - * (which is must be if the specified array is nonnull), then an - * error is indicated if it is smaller than the value count. - * {arenaOpt} - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_ARENA - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_ARRAY_TOO_SMALL - * - * Return value: - * A valid pointer to an array of NSSItem's upon success - * NULL upon failure. - */ - -NSS_IMPLEMENT NSSPKIXAttributeValue * -nssPKIXAttribute_GetValues -( - NSSPKIXAttribute *attribute, - NSSPKIXAttributeValue rvOpt[], - PRInt32 limit, - NSSArena *arenaOpt -) -{ - NSSPKIXAttributeValue *rv = (NSSPKIXAttributeValue *)NULL; - PRUint32 i; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return (NSSPKIXAttributeValue *)NULL; - } - - if( (NSSArena *)NULL != arenaOpt ) { - if( PR_SUCCESS != nssArena_verifyOpt(attribute) ) { - return (NSSPKIXAttributeValue *)NULL; - } - } -#endif /* NSSDEBUG */ - - if( 0 == attribute->valuesCount ) { - nss_pkix_Attribute_Count(attribute); - } - -#ifdef PEDANTIC - if( 0 == attribute->valuesCount ) { - if( 0 == limit ) { - nss_SetError(NSS_ERROR_NO_MEMORY); - } else { - nss_SetError(NSS_ERROR_ARRAY_TOO_SMALL); - } - return (NSSPKIXAttributeValue *)NULL; - } -#endif /* PEDANTIC */ - - if( (limit < attribute->valuesCount) && - !((0 == limit) && ((NSSPKIXAttributeValue *)NULL == rvOpt)) ) { - nss_SetError(NSS_ERROR_ARRAY_TOO_SMALL); - return (NSSPKIXAttributeValue *)NULL; - } - - limit = attribute->valuesCount; - if( (NSSPKIXAttributeValue *)NULL == rvOpt ) { - rv = nss_ZNEWARRAY(arenaOpt, NSSPKIXAttributeValue, limit); - if( (NSSPKIXAttributeValue *)NULL == rv ) { - return (NSSPKIXAttributeValue *)NULL; - } - } else { - rv = rvOpt; - } - - for( i = 0; i < limit; i++ ) { - NSSAttributeValue tmp; - nssASN1Item *p = attribute->asn1values[i]; - NSSAttributeValue *r = &rv[i]; - - tmp.size = p->size; - tmp.data = p->data; - - if( (NSSItem *)NULL == nssItem_Duplicate(&tmp, arenaOpt, r) ) { - goto loser; - } - } - - return rv; - - loser: - for( i = 0; i < limit; i++ ) { - NSSAttributeValue *r = &rv[i]; - nss_ZFreeIf(r->data); - } - - if( rv != rvOpt ) { - nss_ZFreeIf(rv); - } - - return (NSSAttributeValue *)NULL; -} diff --git a/security/nss/lib/pkix/src/Attribute/PRemoveValue.c b/security/nss/lib/pkix/src/Attribute/PRemoveValue.c deleted file mode 100644 index 6da2ebc07..000000000 --- a/security/nss/lib/pkix/src/Attribute/PRemoveValue.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_RemoveValue - * - * This routine removes the i'th attribute value of the set in the - * specified NSSPKIXAttribute. An attempt to remove the last value - * will fail. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_AT_MINIMUM - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -PR_IMPLEMENET(PRStatus) -nssPKIXAttribute_RemoveValue -( - NSSPKIXAttribute *a, - PRInt32 i -) -{ - nssASN1Item **ip; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( 0 == a->valuesCount ) { - nss_pkix_Attribute_Count(a); - } - - if( i < 0 ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } - - if( 1 == a->valuesCount ) { - nss_SetError(NSS_ERROR_AT_MINIMUM); - return PR_FAILURE; - } - -#ifdef PEDANTIC - if( 0 == a->valuesCount ) { - /* Too big.. but we can still remove one */ - nss_ZFreeIf(a->asn1values[i].data); - for( ip = &a->asn1values[i]; *ip; ip++ ) { - ip[0] = ip[1]; - } - } else -#endif /* PEDANTIC */ - - { - nssASN1Item *si; - PRUint32 end; - - if( i >= a->valueCount ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } - - end = a->valuesCount - 1; - - si = a->asn1values[i]; - a->asn1values[i] = a->asn1values[ end ]; - a->asn1values[ end ] = (nssASN1Item *)NULL; - - nss_ZFreeIf(si->data); - nss_ZFreeIf(si); - - /* We could realloc down, but we know it's a no-op */ - a->valuesCount = end; - } - - return nss_pkix_Attribute_Clear(a); -} diff --git a/security/nss/lib/pkix/src/Attribute/PSetType.c b/security/nss/lib/pkix/src/Attribute/PSetType.c deleted file mode 100644 index 8f430aab3..000000000 --- a/security/nss/lib/pkix/src/Attribute/PSetType.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_SetType - * - * This routine sets the attribute type oid of the indicated - * NSSPKIXAttribute to the specified value. Since attributes - * may be application-defined, no checking can be done on - * either the correctness of the attribute type oid value nor - * the suitability of the set of attribute values. - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_OID - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAttribute_SetType -( - NSSPKIXAttribute *a, - NSSPKIXAttributeType *attributeType -) -{ - NSSDER tmp; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssOID_verifyPointer(attributeType) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - a->type = attributeType; - - nss_ZFreeIf(a->asn1type.data); - if( (NSSDER *)NULL == nssOID_GetDEREncoding(a->type, &tmp, a->arena) ) { - return PR_FAILURE; - } - - a->asn1type.size = tmp.size; - a->asn1type.data = tmp.data; - - return nss_pkix_Attribute_Clear(a); -} diff --git a/security/nss/lib/pkix/src/Attribute/PSetValue.c b/security/nss/lib/pkix/src/Attribute/PSetValue.c deleted file mode 100644 index 4fd490a6a..000000000 --- a/security/nss/lib/pkix/src/Attribute/PSetValue.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_SetValue - * - * This routine sets the i'th attribute value {blah blah; copies - * memory contents over..} - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAttribute_SetValue -( - NSSPKIXAttribute *a, - PRInt32 i, - NSSPKIXAttributeValue *value -) -{ - NSSItem tmp; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - if( i < 0 ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } - - if( 0 == a->valuesCount ) { - nss_pkix_Attribute_Count(a); - } - - if( (0 != a->valuesCount) && (i > a->valuesCount) ) { - nss_SetError(NSS_ERROR_VALUE_OUT_OF_RANGE); - return PR_FAILURE; - } - - if( (NSSItem *)NULL == nssItem_Duplicate(value, a->arena, &tmp) ) { - return PR_FAILURE; - } - - nss_ZFreeIf(a->asn1values[i]->data); - a->asn1values[i]->size = tmp.size; - a->asn1values[i]->data = tmp.data; - - return nss_pkix_Attribute_Clear(a); -} diff --git a/security/nss/lib/pkix/src/Attribute/PSetValues.c b/security/nss/lib/pkix/src/Attribute/PSetValues.c deleted file mode 100644 index 64df8eb55..000000000 --- a/security/nss/lib/pkix/src/Attribute/PSetValues.c +++ /dev/null @@ -1,135 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * nssPKIXAttribute_SetValues - * - * This routine sets all of the values of the specified - * NSSPKIXAttribute to the values in the specified NSSItem array. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_POINTER - * NSS_ERROR_ARRAY_TOO_SMALL - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAttribute_SetValues -( - NSSPKIXAttribute *a, - NSSPKIXAttributeValue values[], - PRInt32 count -) -{ - nssASN1Item **ip; - nssASN1Item *newarray; - PRUint32 i; - nssArenaMark *mark; - -#ifdef NSSDEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(a) ) { - return PR_FAILURE; - } - - if( (NSSPKIXAttributeValue *)NULL == values ) { - nss_SetError(NSS_ERROR_INVALID_POINTER); - return PR_FAILURE; - } - - if( count < 1 ) { - nss_SetError(NSS_ERROR_ARRAY_TOO_SMALL); - return PR_FAILURE; - } -#endif /* NSSDEBUG */ - - PR_ASSERT((nssASN1Item **)NULL != a->asn1values); - if( (nssASN1Item **)NULL == a->asn1values ) { - nss_SetError(NSS_ERROR_ASSERTION_FAILED); - return PR_FAILURE; - } - - mark = nssArena_Mark(a->arena); - if( (nssArenaMark *)NULL == mark ) { - return PR_FAILURE; - } - - newarray = nss_ZNEWARRAY(a->arena, nssASN1Item *, count); - if( (nssASN1Item *)NULL == newarray ) { - return PR_FAILURE; - } - - for( i = 0; i < count; i++ ) { - NSSItem tmp; - - newarray[i] = nss_ZNEW(a->arena, nssASN1Item); - if( (nssASN1Item *)NULL == newarray[i] ) { - goto loser; - } - - if( (NSSItem *)NULL == nssItem_Duplicate(&values[i], a->arena, &tmp) ) { - goto loser; - } - - newarray[i]->size = tmp.size; - newarray[i]->data = tmp.data; - } - - for( ip = &a->asn1values[0]; *ip; ip++ ) { - nss_ZFreeIf((*ip)->data); - nss_ZFreeIf(*ip); - } - - nss_ZFreeIf(a->asn1values); - - a->asn1values = newarray; - a->valuesCount = count; - - (void)nss_pkix_Attribute_Clear(a); - return nssArena_Unmark(a->arena, mark); - - loser: - (void)nssArena_Release(a->arena, mark); - return PR_FAILURE; -} diff --git a/security/nss/lib/pkix/src/Attribute/RemoveValue.c b/security/nss/lib/pkix/src/Attribute/RemoveValue.c deleted file mode 100644 index e869fd96a..000000000 --- a/security/nss/lib/pkix/src/Attribute/RemoveValue.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_RemoveValue - * - * This routine removes the i'th attribute value of the set in the - * specified NSSPKIXAttribute. An attempt to remove the last value - * will fail. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_AT_MINIMUM - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAttribute_RemoveValue -( - NSSPKIXAttribute *attribute, - PRInt32 i -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_RemoveValue(attribute, i); -} - diff --git a/security/nss/lib/pkix/src/Attribute/SetType.c b/security/nss/lib/pkix/src/Attribute/SetType.c deleted file mode 100644 index 4975c8f8a..000000000 --- a/security/nss/lib/pkix/src/Attribute/SetType.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_SetType - * - * This routine sets the attribute type oid of the indicated - * NSSPKIXAttribute to the specified value. Since attributes - * may be application-defined, no checking can be done on - * either the correctness of the attribute type oid value nor - * the suitability of the set of attribute values. - * - * The error value may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_OID - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAttribute_SetType -( - NSSPKIXAttribute *attribute, - NSSPKIXAttributeType *attributeType -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssOID_verifyPointer(attributeType) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_SetType(attribute, attributeType); -} diff --git a/security/nss/lib/pkix/src/Attribute/SetValue.c b/security/nss/lib/pkix/src/Attribute/SetValue.c deleted file mode 100644 index 43f74ad26..000000000 --- a/security/nss/lib/pkix/src/Attribute/SetValue.c +++ /dev/null @@ -1,80 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_SetValue - * - * This routine sets the i'th attribute value {blah blah; copies - * memory contents over..} - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_VALUE_OUT_OF_RANGE - * NSS_ERROR_INVALID_ITEM - * NSS_ERROR_NO_MEMORY - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAttribute_SetValue -( - NSSPKIXAttribute *attribute, - PRInt32 i, - NSSPKIXAttributeValue *value -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } - - if( PR_SUCCESS != nssItem_verifyPointer(value) ) { - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKIXAttribute_SetValue(attribute, i, value); -} diff --git a/security/nss/lib/pkix/src/Attribute/SetValues.c b/security/nss/lib/pkix/src/Attribute/SetValues.c deleted file mode 100644 index 7c3645cf7..000000000 --- a/security/nss/lib/pkix/src/Attribute/SetValues.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -/* - * NSSPKIXAttribute_SetValues - * - * This routine sets all of the values of the specified - * NSSPKIXAttribute to the values in the specified NSSItem array. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * NSS_ERROR_INVALID_POINTER - * NSS_ERROR_ARRAY_TOO_SMALL - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -NSSPKIXAttribute_SetValues -( - NSSPKIXAttribute *attribute, - NSSPKIXAttributeValue values[], - PRInt32 count -) -{ - nss_ClearErrorStack(); - -#ifdef DEBUG - if( PR_SUCCESS != nssPKIXAttribute_verifyPointer(attribute) ) { - return PR_FAILURE; - } - - if( (NSSPKIXAttributeValue *)NULL == values ) { - nss_SetError(NSS_ERROR_INVALID_POINTER); - return PR_FAILURE; - } - - if( count < 1 ) { - nss_SetError(NSS_ERROR_ARRAY_TOO_SMALL); - return PR_FAILURE; - } -#endif /* DEBUG */ - - return nssPKXIAttribute_SetValues(attribute, values, count); -} diff --git a/security/nss/lib/pkix/src/Attribute/template.c b/security/nss/lib/pkix/src/Attribute/template.c deleted file mode 100644 index 850b6a9b0..000000000 --- a/security/nss/lib/pkix/src/Attribute/template.c +++ /dev/null @@ -1,58 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIX_H -#include "pkix.h" -#endif /* PKIX_H */ - -#ifndef ASN1_H -#include "asn1.h" -#endif /* ASN1_H */ - -/* - * nssPKIXAttribute_template - * - * - */ - -const nssASN1Template nssPKIXAttribute_template[] = { - { nssASN1_SEQUENCE, 0, NULL, sizeof(NSSPKIXAttribute) }, - { nssASN1_OBJECT_ID, offsetof(NSSPKIXAttribute, asn1type) }, - { nssASN1_SET_OF, offsetof(NSSPKIXAttribute, asn1values), - nssASN1Template_Any }, - { 0 } -}; diff --git a/security/nss/lib/pkix/src/Attribute/verifyPointer.c b/security/nss/lib/pkix/src/Attribute/verifyPointer.c deleted file mode 100644 index c0ae3ed84..000000000 --- a/security/nss/lib/pkix/src/Attribute/verifyPointer.c +++ /dev/null @@ -1,170 +0,0 @@ -/* - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is the Netscape security libraries. - * - * The Initial Developer of the Original Code is Netscape - * Communications Corporation. Portions created by Netscape are - * Copyright (C) 1994-2000 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the - * terms of the GNU General Public License Version 2 or later (the - * "GPL"), in which case the provisions of the GPL are applicable - * instead of those above. If you wish to allow use of your - * version of this file only under the terms of the GPL and not to - * allow others to use your version of this file under the MPL, - * indicate your decision by deleting the provisions above and - * replace them with the notice and other provisions required by - * the GPL. If you do not delete the provisions above, a recipient - * may use your version of this file under either the MPL or the - * GPL. - */ - -#ifdef DEBUG -static const char CVS_ID[] = "@(#) $Source$ $Revision$ $Date$ $Name$"; -#endif /* DEBUG */ - -#ifndef PKIXM_H -#include "pkixm.h" -#endif /* PKIXM_H */ - -#ifdef DEBUG - -extern const NSSError NSS_ERROR_INTERNAL_ERROR; - -static nssPointerTracker pkix_attribute_pointer_tracker; - -/* - * nss_pkix_Attribute_add_pointer - * - * This method is only present in debug builds. - * - * This module-private routine adds an NSSPKIXAttribute pointer to - * the internal pointer-tracker. This routine should only be used - * by the NSSPKIX module. This routine returns a PRStatus value; - * upon error it will place an error on the error stack and return - * PR_FAILURE. - * - * The error may be one of the following values: - * NSS_ERROR_NO_MEMORY - * NSS_ERROR_INTERNAL_ERROR - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_Attribute_add_pointer -( - const NSSPKIXAttribute *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_attribute_pointer_tracker); - if( PR_SUCCESS != rv ) { - return rv; - } - - rv = nssPointerTracker_add(&pkix_attribute_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - NSSError e = NSS_GetError(); - if( NSS_ERROR_NO_MEMORY != e ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - } - - return rv; - } - - return PR_SUCCESS; -} - -/* - * nss_pkix_Attribute_remove_pointer - * - * This method is only present in debug builds. - * - * This module-private routine removes a valid NSSPKIXAttribute - * pointer from the internal pointer-tracker. This routine should - * only be used by the NSSPKIX module. This routine returns a - * PRStatus value; upon error it will place an error on the error - * stack and return PR_FAILURE. - * - * The error may be one of the following values: - * NSS_ERROR_INTERNAL_ERROR - * - * Return value: - * PR_SUCCESS upon success - * PR_FAILURE upon failure - */ - -NSS_IMPLEMENT PRStatus -nss_pkix_Attribute_remove_pointer -( - const NSSPKIXAttribute *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_remove(&pkix_attribute_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INTERNAL_ERROR); - } - - return rv; -} - -/* - * nssPKIXAttribute_verifyPointer - * - * This method is only present in debug builds. - * - * If the specified pointer is a valid pointer to an NSSPKIXAttribute - * object, this routine will return PR_SUCCESS. Otherwise, it will - * put an error on the error stack and return PR_FAILURE. - * - * The error may be one of the following values: - * NSS_ERROR_INVALID_PKIX_ATTRIBUTE - * - * Return value: - * PR_SUCCESS if the pointer is valid - * PR_FAILURE if it isn't - */ - -NSS_IMPLEMENT PRStatus -nssPKIXAttribute_verifyPointer -( - NSSPKIXAttribute *p -) -{ - PRStatus rv; - - rv = nssPointerTracker_initialize(&pkix_attribute_pointer_tracker); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INVALID_PKIX_ATTRIBUTE); - return PR_FAILURE; - } - - rv = nssPointerTracker_verify(&pkix_attribute_pointer_tracker, p); - if( PR_SUCCESS != rv ) { - nss_SetError(NSS_ERROR_INVALID_PKIX_ATTRIBUTE); - return PR_FAILURE; - } - - return PR_SUCCESS; -} - -#endif /* DEBUG */ - |