Blame crypto/pkcs12/p12_p8d.c
|
Packit |
c4476c |
/*
|
|
Packit |
c4476c |
* Copyright 2001-2016 The OpenSSL Project Authors. All Rights Reserved.
|
|
Packit |
c4476c |
*
|
|
Packit |
c4476c |
* Licensed under the OpenSSL license (the "License"). You may not use
|
|
Packit |
c4476c |
* this file except in compliance with the License. You can obtain a copy
|
|
Packit |
c4476c |
* in the file LICENSE in the source distribution or at
|
|
Packit |
c4476c |
* https://www.openssl.org/source/license.html
|
|
Packit |
c4476c |
*/
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
#include <stdio.h>
|
|
Packit |
c4476c |
#include "internal/cryptlib.h"
|
|
Packit |
c4476c |
#include <openssl/pkcs12.h>
|
|
Packit |
c4476c |
|
|
Packit |
c4476c |
PKCS8_PRIV_KEY_INFO *PKCS8_decrypt(const X509_SIG *p8, const char *pass,
|
|
Packit |
c4476c |
int passlen)
|
|
Packit |
c4476c |
{
|
|
Packit |
c4476c |
const X509_ALGOR *dalg;
|
|
Packit |
c4476c |
const ASN1_OCTET_STRING *doct;
|
|
Packit |
c4476c |
X509_SIG_get0(p8, &dalg, &doct);
|
|
Packit |
c4476c |
return PKCS12_item_decrypt_d2i(dalg,
|
|
Packit |
c4476c |
ASN1_ITEM_rptr(PKCS8_PRIV_KEY_INFO), pass,
|
|
Packit |
c4476c |
passlen, doct, 1);
|
|
Packit |
c4476c |
}
|