47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll/*
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Common Public License Version 0.5
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * THIS COMMON PUBLIC LICENSE ("AGREEMENT"). ANY USE,
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * 1. DEFINITIONS
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * "Contribution" means:
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * a) in the case of the initial Contributor, the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * initial code and documentation distributed under
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * this Agreement, and
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * b) in the case of each subsequent Contributor:
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * i) changes to the Program, and
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * ii) additions to the Program;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * where such changes and/or additions to the Program
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * originate from and are distributed by that
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * particular Contributor. A Contribution 'originates'
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * from a Contributor if it was added to the Program
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * by such Contributor itself or anyone acting on such
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributor's behalf. Contributions do not include
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * additions to the Program which: (i) are separate
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * modules of software distributed in conjunction with
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * the Program under their own license agreement, and
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * (ii) are not derivative works of the Program.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * "Contributor" means any person or entity that distributes
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * the Program.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * "Licensed Patents " mean patent claims licensable by a
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributor which are necessarily infringed by the use or
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * sale of its Contribution alone or when combined with the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Program.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * "Program" means the Contributions distributed in
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * accordance with this Agreement.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * "Recipient" means anyone who receives the Program under
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * this Agreement, including all Contributors.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * 2. GRANT OF RIGHTS
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * a) Subject to the terms of this Agreement, each
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributor hereby grants Recipient a
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * no - exclusive, worldwide, royalt - free copyright
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * license to reproduce, prepare derivative works of,
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * publicly display, publicly perform, distribute and
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * sublicense the Contribution of such Contributor, if
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * any, and such derivative works, in source code and
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * object code form.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * b) Subject to the terms of this Agreement, each
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributor hereby grants Recipient a
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * no - exclusive, worldwide, royalt - free patent
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * license under Licensed Patents to make, use, sell,
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * offer to sell, import and otherwise transfer the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contribution of such Contributor, if any, in source
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * code and object code form. This patent license
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * shall apply to the combination of the Contribution
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * and the Program if, at the time the Contribution is
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * added by the Contributor, such addition of the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contribution causes such combination to be covered
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * by the Licensed Patents. The patent license shall
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * not apply to any other combinations which include
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * the Contribution. No hardware per se is licensed
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * hereunder.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * c) Recipient understands that although each
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributor grants the licenses to its
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributions set forth herein, no assurances are
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * provided by any Contributor that the Program does
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * not infringe the patent or other intellectual
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * property rights of any other entity. Each
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributor disclaims any liability to Recipient
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * for claims brought by any other entity based on
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * infringement of intellectual property rights or
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * otherwise. As a condition to exercising the rights
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * and licenses granted hereunder, each Recipient
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * hereby assumes sole responsibility to secure any
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * other intellectual property rights needed, if any.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * For example, if a third party patent license is
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * required to allow Recipient to distribute the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Program, it is Recipient's responsibility to
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * acquire that license before distributing the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Program.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * d) Each Contributor represents that to its
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * knowledge it has sufficient copyright rights in its
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contribution, if any, to grant the copyright
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * license set forth in this Agreement.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * 3. REQUIREMENTS
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * A Contributor may choose to distribute the Program in
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * object code form under its own license agreement, provided
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * that:
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * a) it complies with the terms and conditions of
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * this Agreement; and
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * b) its license agreement:
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * i) effectively disclaims on behalf of all
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributors all warranties and conditions, express
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * and implied, including warranties or conditions of
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * title and no - infringement, and implied warranties
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * or conditions of merchantability and fitness for a
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * particular purpose;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * ii) effectively excludes on behalf of all
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributors all liability for damages, including
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * direct, indirect, special, incidental and
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * consequential damages, such as lost profits;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * iii) states that any provisions which differ from
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * this Agreement are offered by that Contributor
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * alone and not by any other party; and
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * iv) states that source code for the Program is
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * available from such Contributor, and informs
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * licensees how to obtain it in a reasonable manner
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * on or through a medium customarily used for
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * software exchange.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * When the Program is made available in source code form:
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * a) it must be made available under this Agreement;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * and
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * b) a copy of this Agreement must be included with
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * each copy of the Program.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributors may not remove or alter any copyright notices
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * contained within the Program.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Each Contributor must identify itself as the originator of
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * its Contribution, if any, in a manner that reasonably
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * allows subsequent Recipients to identify the originator of
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * the Contribution.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * 4. COMMERCIAL DISTRIBUTION
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Commercial distributors of software may accept certain
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * responsibilities with respect to end users, business
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * partners and the like. While this license is intended to
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * facilitate the commercial use of the Program, the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributor who includes the Program in a commercial
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * product offering should do so in a manner which does not
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * create potential liability for other Contributors.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Therefore, if a Contributor includes the Program in a
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * commercial product offering, such Contributor ("Commercial
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributor") hereby agrees to defend and indemnify every
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * other Contributor ("Indemnified Contributor") against any
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * losses, damages and costs (collectively "Losses") arising
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * from claims, lawsuits and other legal actions brought by a
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * third party against the Indemnified Contributor to the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * extent caused by the acts or omissions of such Commercial
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributor in connection with its distribution of the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Program in a commercial product offering. The obligations
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * in this section do not apply to any claims or Losses
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * relating to any actual or alleged intellectual property
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * infringement. In order to qualify, an Indemnified
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributor must: a) promptly notify the Commercial
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributor in writing of such claim, and b) allow the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Commercial Contributor to control, and cooperate with the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Commercial Contributor in, the defense and any related
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * settlement negotiations. The Indemnified Contributor may
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * participate in any such claim at its own expense.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * For example, a Contributor might include the Program in a
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * commercial product offering, Product X. That Contributor
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * is then a Commercial Contributor. If that Commercial
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributor then makes performance claims, or offers
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * warranties related to Product X, those performance claims
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * and warranties are such Commercial Contributor's
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * responsibility alone. Under this section, the Commercial
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributor would have to defend claims against the other
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributors related to those performance claims and
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * warranties, and if a court requires any other Contributor
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * to pay any damages as a result, the Commercial Contributor
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * must pay those damages.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * 5. NO WARRANTY
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * CONDITIONS OF TITLE, NO - INFRINGEMENT, MERCHANTABILITY OR
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * responsible for determining the appropriateness of using
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * and distributing the Program and assumes all risks
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * associated with its exercise of rights under this
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Agreement, including but not limited to the risks and
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * costs of program errors, compliance with applicable laws,
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * damage to or loss of data, programs or equipment, and
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * unavailability or interruption of operations.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * 6. DISCLAIMER OF LIABILITY
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * POSSIBILITY OF SUCH DAMAGES.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * 7. GENERAL
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * If any provision of this Agreement is invalid or
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * unenforceable under applicable law, it shall not affect
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * the validity or enforceability of the remainder of the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * terms of this Agreement, and without further action by the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * parties hereto, such provision shall be reformed to the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * minimum extent necessary to make such provision valid and
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * enforceable.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * If Recipient institutes patent litigation against a
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributor with respect to a patent applicable to
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * software (including a cros - claim or counterclaim in a
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * lawsuit), then any patent licenses granted by that
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Contributor to such Recipient under this Agreement shall
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * terminate as of the date such litigation is filed. In
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * addition, If Recipient institutes patent litigation
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * against any entity (including a cros - claim or
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * counterclaim in a lawsuit) alleging that the Program
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * itself (excluding combinations of the Program with other
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * software or hardware) infringes such Recipient's
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * patent(s), then such Recipient's rights granted under
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Section 2(b) shall terminate as of the date such
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * litigation is filed.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * All Recipient's rights under this Agreement shall
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * terminate if it fails to comply with any of the material
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * terms or conditions of this Agreement and does not cure
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * such failure in a reasonable period of time after becoming
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * aware of such noncompliance. If all Recipient's rights
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * under this Agreement terminate, Recipient agrees to cease
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * use and distribution of the Program as soon as reasonably
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * practicable. However, Recipient's obligations under this
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Agreement and any licenses granted by Recipient relating
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * to the Program shall continue and survive.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Everyone is permitted to copy and distribute copies of
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * this Agreement, but in order to avoid inconsistency the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Agreement is copyrighted and may only be modified in the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * following manner. The Agreement Steward reserves the right
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * to publish new versions (including revisions) of this
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Agreement from time to time. No one other than the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Agreement Steward has the right to modify this Agreement.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * IBM is the initial Agreement Steward. IBM may assign the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * responsibility to serve as the Agreement Steward to a
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * suitable separate entity. Each new version of the
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Agreement will be given a distinguishing version number.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * The Program (including Contributions) may always be
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * distributed subject to the version of the Agreement under
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * which it was received. In addition, after a new version of
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * the Agreement is published, Contributor may elect to
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * distribute the Program (including its Contributions) under
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * the new version. Except as expressly stated in Sections
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * 2(a) and 2(b) above, Recipient receives no rights or
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * licenses to the intellectual property of any Contributor
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * under this Agreement, whether expressly, by implication,
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * estoppel or otherwise. All rights in the Program not
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * expressly granted under this Agreement are reserved.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * This Agreement is governed by the laws of the State of New
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * York and the intellectual property laws of the United
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * States of America. No party to this Agreement will bring a
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * legal action under this Agreement more than one year after
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * the cause of action arose. Each party waives its rights to
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * a jury trial in any resulting litigation.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * (C) COPYRIGHT International Business Machines Corp. 2001, 2002
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll */
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll/*
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Use is subject to license terms.
33f5ff17089e3a43e6e730bf80384c233123dbd9Milan Jurik * Copyright 2012 Milan Jurik. All rights reserved.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll */
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll#include "tpmtok_int.h"
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll/*
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * cert_check_required_attributes
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Checks for required attributes for generic CKO_CERTIFICATE objects
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * CKA_CERTIFICATE_TYPE : must be present on MODE_CREATE.
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll */
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersollstatic CK_RV
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersollcert_check_required_attributes(TEMPLATE *tmpl, CK_ULONG mode)
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll{
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll CK_ATTRIBUTE * attr = NULL;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll CK_BBOOL found;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll if (! tmpl)
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (CKR_FUNCTION_FAILED);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll if (mode == MODE_CREATE) {
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll found = template_attribute_find(tmpl,
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll CKA_CERTIFICATE_TYPE, &attr);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll if (found == FALSE) {
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (CKR_TEMPLATE_INCOMPLETE);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll }
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll }
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (template_check_required_base_attributes(tmpl, mode));
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll}
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll/*
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * cert_validate_attribute()
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll */
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys IngersollCK_RV
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersollcert_validate_attribute(TEMPLATE *tmpl, CK_ATTRIBUTE *attr, CK_ULONG mode)
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll{
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll CK_CERTIFICATE_TYPE type;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll switch (attr->type) {
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll case CKA_CERTIFICATE_TYPE:
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll if (mode != MODE_CREATE) {
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (CKR_ATTRIBUTE_READ_ONLY);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll }
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll type = *(CK_CERTIFICATE_TYPE *)attr->pValue;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll if (type == CKC_X_509 || type >= CKC_VENDOR_DEFINED)
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (CKR_OK);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll else {
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (CKR_ATTRIBUTE_VALUE_INVALID);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll }
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll default:
33f5ff17089e3a43e6e730bf80384c233123dbd9Milan Jurik return (
33f5ff17089e3a43e6e730bf80384c233123dbd9Milan Jurik template_validate_base_attribute(tmpl, attr, mode));
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll }
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll}
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys IngersollCK_RV
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersollcert_x509_check_required_attributes(TEMPLATE *tmpl, CK_ULONG mode) {
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll CK_ATTRIBUTE *attr = NULL;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll CK_BBOOL found;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll found = template_attribute_find(tmpl, CKA_SUBJECT, &attr);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll if (! found) {
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (CKR_TEMPLATE_INCOMPLETE);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll }
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll found = template_attribute_find(tmpl, CKA_VALUE, &attr);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll if (! found) {
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (CKR_TEMPLATE_INCOMPLETE);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll }
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (cert_check_required_attributes(tmpl, mode));
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll}
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll/*
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * cert_x509_set_default_attributes()
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * Set the default attributes for X.509 certificates
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll *
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * CKA_ID : empty string
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * CKA_ISSUER : empty string
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll * CKA_SERIAL_NUMBER : empty string
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll */
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys IngersollCK_RV
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersollcert_x509_set_default_attributes(TEMPLATE *tmpl, CK_ULONG mode)
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll{
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll CK_ATTRIBUTE * id_attr = NULL;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll CK_ATTRIBUTE * issuer_attr = NULL;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll CK_ATTRIBUTE * serial_attr = NULL;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll if (mode)
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll id_attr = NULL;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll id_attr = (CK_ATTRIBUTE *)malloc(sizeof (CK_ATTRIBUTE));
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll issuer_attr = (CK_ATTRIBUTE *)malloc(sizeof (CK_ATTRIBUTE));
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll serial_attr = (CK_ATTRIBUTE *)malloc(sizeof (CK_ATTRIBUTE));
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll if (! id_attr || ! issuer_attr || ! serial_attr) {
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll if (id_attr) free(id_attr);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll if (issuer_attr) free(issuer_attr);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll if (serial_attr) free(serial_attr);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (CKR_HOST_MEMORY);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll }
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll id_attr->type = CKA_ID;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll id_attr->ulValueLen = 0;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll id_attr->pValue = NULL;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll issuer_attr->type = CKA_ISSUER;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll issuer_attr->ulValueLen = 0;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll issuer_attr->pValue = NULL;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll serial_attr->type = CKA_SERIAL_NUMBER;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll serial_attr->ulValueLen = 0;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll serial_attr->pValue = NULL;
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll (void) template_update_attribute(tmpl, id_attr);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll (void) template_update_attribute(tmpl, issuer_attr);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll (void) template_update_attribute(tmpl, serial_attr);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (CKR_OK);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll}
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys IngersollCK_RV
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersollcert_x509_validate_attribute(TEMPLATE *tmpl,
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys IngersollCK_ATTRIBUTE *attr, CK_ULONG mode)
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll{
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll switch (attr->type) {
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll case CKA_SUBJECT:
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll if (mode != MODE_CREATE)
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (CKR_ATTRIBUTE_READ_ONLY);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll else
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (CKR_OK);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll case CKA_ID:
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll case CKA_ISSUER:
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll case CKA_SERIAL_NUMBER:
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (CKR_OK);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll case CKA_VALUE:
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll if (mode != MODE_CREATE)
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (CKR_ATTRIBUTE_READ_ONLY);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll else
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (CKR_OK);
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll default:
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (cert_validate_attribute(tmpl, attr, mode));
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll }
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll}
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys IngersollCK_RV
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersollcert_vendor_check_required_attributes(TEMPLATE *tmpl, CK_ULONG mode)
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll{
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (cert_check_required_attributes(tmpl, mode));
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll}
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys IngersollCK_RV
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersollcert_vendor_validate_attribute(TEMPLATE *tmpl,
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll CK_ATTRIBUTE *attr, CK_ULONG mode)
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll{
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll return (cert_validate_attribute(tmpl, attr, mode));
47e946e784719ae402ace34695f67b0e6e76ae5cWyllys Ingersoll}