csrcrlop.c revision 6b35cb3cf158584a9408d44b9b6796564e8e1882
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * CDDL HEADER START
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * The contents of this file are subject to the terms of the
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * Common Development and Distribution License (the "License").
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * You may not use this file except in compliance with the License.
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * See the License for the specific language governing permissions
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * and limitations under the License.
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * When distributing Covered Code, include this CDDL HEADER in each
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * If applicable, add the following below this CDDL HEADER, with the
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * fields enclosed by brackets "[]" replaced with your own identifying
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * information: Portions Copyright [yyyy] [name of copyright owner]
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * CDDL HEADER END
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * Use is subject to license terms.
06e46062ef4f5f4b687cbafb4518fb123fe23920jbelorosetup_crl_call(KMF_HANDLE_T, int, KMF_ATTRIBUTE *, KMF_PLUGIN **);
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * Name: kmf_set_csr_pubkey
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * Description:
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * This function converts the specified plugin public key to SPKI form,
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * and save it in the KMF_CSR_DATA internal structure
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * Parameters:
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * KMFkey(input) - pointer to the KMF_KEY_HANDLE structure containing the
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * public key generated by the plug-in CreateKeypair
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * Csr(input/output) - pointer to a KMF_CSR_DATA structure containing
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * A KMF_RETURN value indicating success or specifying a particular
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * error condition.
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * The value KMF_OK indicates success. All other values represent
035c74aaf2aa9c8e7803b85ed58a292b0ccba299venki * an error condition.
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro /* The keystore must extract the pubkey data */
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro if (plugin != NULL && plugin->funclist->EncodePubkeyData != NULL) {
06e46062ef4f5f4b687cbafb4518fb123fe23920jbelorokmf_set_csr_version(KMF_CSR_DATA *CsrData, uint32_t version)
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * From RFC 3280:
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro * Version ::= INTEGER { v1(0), v2(1), v3(2) }
06e46062ef4f5f4b687cbafb4518fb123fe23920jbeloro return (set_integer(&CsrData->csr.version, (void *)&version,
return (KMF_ERR_BAD_PARAMETER);
return (rv);
char *csrfile)
return (KMF_ERR_BAD_PARAMETER);
return (KMF_ERR_BAD_PARAMETER);
int len;
goto cleanup;
goto cleanup;
return (rv);
return (KMF_ERR_BAD_PARAMETER);
return (ret);
return (KMF_ERR_BAD_PARAMETER);
(void) copy_data(
return (KMF_ERR_BAD_PARAMETER);
return (KMF_OK);
return (KMF_ERR_BAD_PARAMETER);
altname);
return (ret);
return (KMF_ERR_BAD_PARAMETER);
return (ret);
int critical)
return (KMF_ERR_BAD_PARAMETER);
goto out;
goto out;
return (KMF_ERR_MEMORY);
goto out;
goto out;
goto out;
goto out;
goto out;
out:
return (ret);
static KMF_RETURN
if (!SignedCsr)
return (KMF_ERR_BAD_PARAMETER);
if (!SubjectCsr)
return (KMF_ERR_BAD_PARAMETER);
return (KMF_ERR_BAD_PARAMETER);
goto cleanup;
sizeof (KMF_OID));
goto cleanup;
if (ret)
goto cleanup;
if (ret)
goto cleanup;
goto cleanup;
goto cleanup;
return (ret);
return (err);
return (KMF_ERR_BAD_PARAMETER);
return (err);
return (KMF_ERR_BAD_PARAMETER);
return (rv);
return (rv);
sizeof (KMF_CSR_DATA)},
sizeof (KMF_ATTRIBUTE_TESTER);
return (KMF_ERR_BAD_PARAMETER);
return (rv);
return (KMF_ERR_BAD_PARAMETER);
return (rv);
&signature);
goto end;
&signature);
goto end;
&rawcsr,
end:
return (rv);
static KMF_RETURN
sizeof (KMF_ATTRIBUTE_TESTER);
return (KMF_ERR_BAD_PARAMETER);
return (ret);
return (ret);
switch (kstype) {
case KMF_KEYSTORE_NSS:
case KMF_KEYSTORE_OPENSSL:
return (KMF_ERR_PLUGIN_NOTFOUND);
return (KMF_OK);
return (ret);
return (KMF_ERR_PLUGIN_NOTFOUND);
return (KMF_ERR_FUNCTION_NOT_FOUND);
return (ret);
return (KMF_ERR_PLUGIN_NOTFOUND);
return (KMF_ERR_FUNCTION_NOT_FOUND);
return (ret);
return (KMF_ERR_PLUGIN_NOTFOUND);
return (KMF_ERR_FUNCTION_NOT_FOUND);
sizeof (KMF_KEYSTORE_TYPE)},
sizeof (KMF_ATTRIBUTE_TESTER);
return (KMF_ERR_BAD_PARAMETER);
return (ret);
return (ret);
switch (kstype) {
case KMF_KEYSTORE_NSS:
case KMF_KEYSTORE_OPENSSL:
case KMF_KEYSTORE_PK11TOKEN:
return (KMF_ERR_FUNCTION_NOT_FOUND);
return (KMF_ERR_PLUGIN_NOTFOUND);
return (KMF_ERR_PLUGIN_NOTFOUND);
attrlist));
return (KMF_ERR_FUNCTION_NOT_FOUND);
return (ret);
return (KMF_ERR_PLUGIN_NOTFOUND);
attrlist));
return (KMF_ERR_FUNCTION_NOT_FOUND);
return (KMF_ERR_BAD_PARAMETER);
return (KMF_ERR_PLUGIN_NOTFOUND);
return (KMF_ERR_FUNCTION_NOT_FOUND);
return (KMF_ERR_BAD_PARAMETER);
return (ret);
return (KMF_ERR_PLUGIN_NOTFOUND);
return (KMF_ERR_FUNCTION_NOT_FOUND);
return (ret);
return (KMF_ERR_BAD_PARAMETER);
return (KMF_ERR_PLUGIN_NOTFOUND);
return (KMF_ERR_FUNCTION_NOT_FOUND);