openssl_util.c revision c28749e97052f09388969427adf7df641cdcdc22
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <assert.h>
#include <strings.h>
#include "kssladm.h"
static void
print_crypto_error(void)
{
}
/* ARGSUSED */
static int
{
}
{
perror("Unable to open pem file for reading");
return (NULL);
}
if (verbose)
(void) printf("In PEM_get_x509_info_stack: %s opened\n",
filename);
if (x509_info_stack == NULL) {
}
return (x509_info_stack);
}
RSA *
{
perror("Unable to open pem file for reading");
return (NULL);
}
if (verbose)
}
return (rsa_key);
}
uchar_t *
{
int i, j, v;
X509 *x;
if (x != NULL) {
pkey = X509_get_pubkey(x);
X509_free(x);
return (NULL);
}
v = ((int)(bn->d[i] >> (long)j)) & 0xff;
*m = v;
m++;
}
}
X509_free(x);
}
return (mptr);
}
static uchar_t *
{
int size;
if (size < 0) {
perror("Invalid cert\n");
return (NULL);
}
return (cert_buf);
}
/* Returns DER encoded cert */
uchar_t *
{
if (x509_info_stack == NULL) {
return (NULL);
}
/* LINTED */
return (NULL);
}
return (cert_buf);
}
static PKCS12 *
PKCS12_load(const char *filename)
{
perror("Unnable to open file for reading");
return (NULL);
}
return (NULL);
}
return (p12);
}
int
{
int rv = -1;
char password_buf[1024];
goto out0;
}
if (get_passphrase(
perror("Unnable to read passphrase");
goto out0;
}
}
goto out0;
}
goto out1;
}
goto out2;
}
rv = 0;
}
out2:
out1:
out0:
return (rv);
}