Functions | Variables
p5_pbev2.c File Reference
#include <openssl/pkcs8.h>
#include <limits.h>
#include <string.h>
#include <openssl/bytestring.h>
#include <openssl/cipher.h>
#include <openssl/err.h>
#include <openssl/mem.h>
#include <openssl/nid.h>
#include <openssl/rand.h>
#include "internal.h"
#include "../internal.h"
Include dependency graph for p5_pbev2.c:

Go to the source code of this file.

Functions

static int add_cipher_oid (CBB *out, int nid)
 
static const EVP_CIPHERcbs_to_cipher (const CBS *cbs)
 
static int pkcs5_pbe2_cipher_init (EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, const EVP_MD *pbkdf2_md, unsigned iterations, const char *pass, size_t pass_len, const uint8_t *salt, size_t salt_len, const uint8_t *iv, size_t iv_len, int enc)
 
int PKCS5_pbe2_decrypt_init (const struct pbe_suite *suite, EVP_CIPHER_CTX *ctx, const char *pass, size_t pass_len, CBS *param)
 
int PKCS5_pbe2_encrypt_init (CBB *out, EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, unsigned iterations, const char *pass, size_t pass_len, const uint8_t *salt, size_t salt_len)
 

Variables

struct {
   const EVP_CIPHER *(*   cipher_func )(void)
 
   int   nid
 
   uint8_t   oid [9]
 
   uint8_t   oid_len
 
kCipherOIDs []
 
static const uint8_t kHMACWithSHA1 []
 
static const uint8_t kHMACWithSHA256 []
 
static const uint8_t kPBES2 []
 
static const uint8_t kPBKDF2 []
 

Function Documentation

◆ add_cipher_oid()

static int add_cipher_oid ( CBB out,
int  nid 
)
static

Definition at line 131 of file p5_pbev2.c.

◆ cbs_to_cipher()

static const EVP_CIPHER* cbs_to_cipher ( const CBS cbs)
static

Definition at line 121 of file p5_pbev2.c.

◆ pkcs5_pbe2_cipher_init()

static int pkcs5_pbe2_cipher_init ( EVP_CIPHER_CTX ctx,
const EVP_CIPHER cipher,
const EVP_MD pbkdf2_md,
unsigned  iterations,
const char *  pass,
size_t  pass_len,
const uint8_t salt,
size_t  salt_len,
const uint8_t iv,
size_t  iv_len,
int  enc 
)
static

Definition at line 146 of file p5_pbev2.c.

◆ PKCS5_pbe2_decrypt_init()

int PKCS5_pbe2_decrypt_init ( const struct pbe_suite suite,
EVP_CIPHER_CTX ctx,
const char *  pass,
size_t  pass_len,
CBS param 
)

Definition at line 213 of file p5_pbev2.c.

◆ PKCS5_pbe2_encrypt_init()

int PKCS5_pbe2_encrypt_init ( CBB out,
EVP_CIPHER_CTX ctx,
const EVP_CIPHER cipher,
unsigned  iterations,
const char *  pass,
size_t  pass_len,
const uint8_t salt,
size_t  salt_len 
)

Definition at line 164 of file p5_pbev2.c.

Variable Documentation

◆ cipher_func

const EVP_CIPHER*(* cipher_func) (void)

Definition at line 92 of file p5_pbev2.c.

◆ kCipherOIDs

const { ... } kCipherOIDs[]
Initial value:
= {
{{0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x02},
8,
{{0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x03, 0x07},
8,
{{0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x02},
9,
{{0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x16},
9,
{{0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x01, 0x2a},
9,
}

◆ kHMACWithSHA1

const uint8_t kHMACWithSHA1[]
static
Initial value:
= {0x2a, 0x86, 0x48, 0x86,
0xf7, 0x0d, 0x02, 0x07}

Definition at line 81 of file p5_pbev2.c.

◆ kHMACWithSHA256

const uint8_t kHMACWithSHA256[]
static
Initial value:
= {0x2a, 0x86, 0x48, 0x86,
0xf7, 0x0d, 0x02, 0x09}

Definition at line 85 of file p5_pbev2.c.

◆ kPBES2

const uint8_t kPBES2[]
static
Initial value:
= {0x2a, 0x86, 0x48, 0x86, 0xf7,
0x0d, 0x01, 0x05, 0x0d}

Definition at line 77 of file p5_pbev2.c.

◆ kPBKDF2

const uint8_t kPBKDF2[]
static
Initial value:
= {0x2a, 0x86, 0x48, 0x86, 0xf7,
0x0d, 0x01, 0x05, 0x0c}

Definition at line 73 of file p5_pbev2.c.

◆ nid

int nid

Definition at line 91 of file p5_pbev2.c.

◆ oid

uint8_t oid[9]

Definition at line 89 of file p5_pbev2.c.

◆ oid_len

uint8_t oid_len

Definition at line 90 of file p5_pbev2.c.

NID_aes_128_cbc
#define NID_aes_128_cbc
Definition: nid.h:1933
EVP_aes_256_cbc
const OPENSSL_EXPORT EVP_CIPHER * EVP_aes_256_cbc(void)
EVP_aes_192_cbc
const OPENSSL_EXPORT EVP_CIPHER * EVP_aes_192_cbc(void)
EVP_rc2_cbc
#define EVP_rc2_cbc
Definition: boringssl_prefix_symbols.h:1745
NID_aes_256_cbc
#define NID_aes_256_cbc
Definition: nid.h:1973
NID_des_ede3_cbc
#define NID_des_ede3_cbc
Definition: nid.h:287
EVP_des_ede3_cbc
const OPENSSL_EXPORT EVP_CIPHER * EVP_des_ede3_cbc(void)
NID_aes_192_cbc
#define NID_aes_192_cbc
Definition: nid.h:1953
NID_rc2_cbc
#define NID_rc2_cbc
Definition: nid.h:256
EVP_aes_128_cbc
const OPENSSL_EXPORT EVP_CIPHER * EVP_aes_128_cbc(void)


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:25