allow user-specification of cipher to be used when encrypting packets.
preserve the CAST5 default for now. at the user level, this is specified using the --cipher=<ciphername> option.
This commit is contained in:
parent
0ae434d4da
commit
f7745f8410
@ -57,12 +57,12 @@ am_libnetpgp_la_OBJECTS = libnetpgp_la-bufgap.lo \
|
||||
libnetpgp_la-compress.lo libnetpgp_la-create.lo \
|
||||
libnetpgp_la-crypto.lo libnetpgp_la-fastctype.lo \
|
||||
libnetpgp_la-keyring.lo libnetpgp_la-misc.lo \
|
||||
libnetpgp_la-mj.lo libnetpgp_la-netpgp.lo \
|
||||
libnetpgp_la-openssl_crypto.lo libnetpgp_la-packet-parse.lo \
|
||||
libnetpgp_la-packet-print.lo libnetpgp_la-packet-show.lo \
|
||||
libnetpgp_la-reader.lo libnetpgp_la-signature.lo \
|
||||
libnetpgp_la-ssh2pgp.lo libnetpgp_la-symmetric.lo \
|
||||
libnetpgp_la-validate.lo libnetpgp_la-writer.lo
|
||||
libnetpgp_la-netpgp.lo libnetpgp_la-openssl_crypto.lo \
|
||||
libnetpgp_la-packet-parse.lo libnetpgp_la-packet-print.lo \
|
||||
libnetpgp_la-packet-show.lo libnetpgp_la-reader.lo \
|
||||
libnetpgp_la-signature.lo libnetpgp_la-ssh2pgp.lo \
|
||||
libnetpgp_la-symmetric.lo libnetpgp_la-validate.lo \
|
||||
libnetpgp_la-writer.lo
|
||||
libnetpgp_la_OBJECTS = $(am_libnetpgp_la_OBJECTS)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@
|
||||
depcomp = $(SHELL) $(top_srcdir)/buildaux/depcomp
|
||||
@ -213,7 +213,6 @@ libnetpgp_la_SOURCES = \
|
||||
fastctype.c \
|
||||
keyring.c \
|
||||
misc.c \
|
||||
mj.c \
|
||||
netpgp.c \
|
||||
openssl_crypto.c \
|
||||
packet-parse.c \
|
||||
@ -322,7 +321,6 @@ distclean-compile:
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnetpgp_la-fastctype.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnetpgp_la-keyring.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnetpgp_la-misc.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnetpgp_la-mj.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnetpgp_la-netpgp.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnetpgp_la-openssl_crypto.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libnetpgp_la-packet-parse.Plo@am__quote@
|
||||
@ -405,13 +403,6 @@ libnetpgp_la-misc.lo: misc.c
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnetpgp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnetpgp_la-misc.lo `test -f 'misc.c' || echo '$(srcdir)/'`misc.c
|
||||
|
||||
libnetpgp_la-mj.lo: mj.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnetpgp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnetpgp_la-mj.lo -MD -MP -MF $(DEPDIR)/libnetpgp_la-mj.Tpo -c -o libnetpgp_la-mj.lo `test -f 'mj.c' || echo '$(srcdir)/'`mj.c
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libnetpgp_la-mj.Tpo $(DEPDIR)/libnetpgp_la-mj.Plo
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='mj.c' object='libnetpgp_la-mj.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnetpgp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libnetpgp_la-mj.lo `test -f 'mj.c' || echo '$(srcdir)/'`mj.c
|
||||
|
||||
libnetpgp_la-netpgp.lo: netpgp.c
|
||||
@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libnetpgp_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libnetpgp_la-netpgp.lo -MD -MP -MF $(DEPDIR)/libnetpgp_la-netpgp.Tpo -c -o libnetpgp_la-netpgp.lo `test -f 'netpgp.c' || echo '$(srcdir)/'`netpgp.c
|
||||
@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libnetpgp_la-netpgp.Tpo $(DEPDIR)/libnetpgp_la-netpgp.Plo
|
||||
|
@ -117,6 +117,10 @@
|
||||
/* Define to 1 if you have the <zlib.h> header file. */
|
||||
#undef HAVE_ZLIB_H
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
|
71
crypto/external/bsd/netpgp/dist/src/lib/create.c
vendored
71
crypto/external/bsd/netpgp/dist/src/lib/create.c
vendored
@ -57,7 +57,7 @@
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
|
||||
__RCSID("$NetBSD: create.c,v 1.34 2010/09/01 17:25:57 agc Exp $");
|
||||
__RCSID("$NetBSD: create.c,v 1.35 2010/11/04 15:38:45 agc Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -843,31 +843,23 @@ __ops_calc_sesskey_checksum(__ops_pk_sesskey_t *sesskey, uint8_t cs[2])
|
||||
}
|
||||
|
||||
static unsigned
|
||||
create_unencoded_m_buf(__ops_pk_sesskey_t *sesskey, uint8_t *m_buf)
|
||||
create_unencoded_m_buf(__ops_pk_sesskey_t *sesskey, __ops_crypt_t *cipherinfo, uint8_t *m_buf)
|
||||
{
|
||||
int i;
|
||||
unsigned i;
|
||||
|
||||
/* m_buf is the buffer which will be encoded in PKCS#1 block */
|
||||
/* encoding to form the "m" value used in the */
|
||||
/* Public Key Encrypted Session Key Packet */
|
||||
/*
|
||||
* as defined in RFC Section 5.1 "Public-Key Encrypted Session Key
|
||||
* Packet"
|
||||
/* m_buf is the buffer which will be encoded in PKCS#1 block
|
||||
* encoding to form the "m" value used in the Public Key
|
||||
* Encrypted Session Key Packet as defined in RFC Section 5.1
|
||||
* "Public-Key Encrypted Session Key Packet"
|
||||
*/
|
||||
|
||||
m_buf[0] = sesskey->symm_alg;
|
||||
|
||||
if (sesskey->symm_alg != OPS_SA_CAST5) {
|
||||
(void) fprintf(stderr, "create_unencoded_m_buf: symm alg\n");
|
||||
return 0;
|
||||
}
|
||||
for (i = 0; i < CAST_KEY_LENGTH; i++) {
|
||||
for (i = 0; i < cipherinfo->keysize ; i++) {
|
||||
/* XXX - Flexelint - Warning 679: Suspicious Truncation in arithmetic expression combining with pointer */
|
||||
m_buf[1 + i] = sesskey->key[i];
|
||||
}
|
||||
|
||||
return (__ops_calc_sesskey_checksum(sesskey,
|
||||
m_buf + 1 + CAST_KEY_LENGTH));
|
||||
return __ops_calc_sesskey_checksum(sesskey,
|
||||
m_buf + 1 + cipherinfo->keysize);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -940,24 +932,21 @@ encode_m_buf(const uint8_t *M, size_t mLen, const __ops_pubkey_t * pubkey,
|
||||
\note Currently hard-coded to use RSA
|
||||
*/
|
||||
__ops_pk_sesskey_t *
|
||||
__ops_create_pk_sesskey(const __ops_key_t *key)
|
||||
__ops_create_pk_sesskey(const __ops_key_t *key, const char *ciphername)
|
||||
{
|
||||
/*
|
||||
* Creates a random session key and encrypts it for the given key
|
||||
*
|
||||
* Session Key is for use with a SK algo,
|
||||
* can be any, we're hardcoding CAST5 for now
|
||||
*
|
||||
* Encryption used is PK,
|
||||
* can be any, we're hardcoding RSA for now
|
||||
*/
|
||||
|
||||
#define SZ_UNENCODED_M_BUF (CAST_KEY_LENGTH + 1 + 2)
|
||||
|
||||
const __ops_pubkey_t *pubkey;
|
||||
__ops_pk_sesskey_t *sesskey;
|
||||
__ops_symm_alg_t cipher;
|
||||
const uint8_t *id;
|
||||
uint8_t unencoded_m_buf[SZ_UNENCODED_M_BUF];
|
||||
__ops_crypt_t cipherinfo;
|
||||
uint8_t *unencoded_m_buf;
|
||||
uint8_t *encoded_m_buf;
|
||||
size_t sz_encoded_m_buf;
|
||||
|
||||
@ -968,21 +957,34 @@ __ops_create_pk_sesskey(const __ops_key_t *key)
|
||||
pubkey = &key->enckey;
|
||||
id = key->encid;
|
||||
}
|
||||
/* allocate unencoded_m_buf here */
|
||||
(void) memset(&cipherinfo, 0x0, sizeof(cipherinfo));
|
||||
__ops_crypt_any(&cipherinfo,
|
||||
cipher = __ops_str_to_cipher((ciphername) ? ciphername : "cast5"));
|
||||
unencoded_m_buf = calloc(1, cipherinfo.keysize + 1 + 2);
|
||||
if (unencoded_m_buf == NULL) {
|
||||
(void) fprintf(stderr,
|
||||
"__ops_create_pk_sesskey: can't allocate\n");
|
||||
return NULL;
|
||||
}
|
||||
sz_encoded_m_buf = BN_num_bytes(pubkey->key.rsa.n);
|
||||
if ((encoded_m_buf = calloc(1, sz_encoded_m_buf)) == NULL) {
|
||||
(void) fprintf(stderr,
|
||||
"__ops_create_pk_sesskey: can't allocate\n");
|
||||
free(unencoded_m_buf);
|
||||
return NULL;
|
||||
}
|
||||
if ((sesskey = calloc(1, sizeof(*sesskey))) == NULL) {
|
||||
(void) fprintf(stderr,
|
||||
"__ops_create_pk_sesskey: can't allocate\n");
|
||||
free(unencoded_m_buf);
|
||||
free(encoded_m_buf);
|
||||
return NULL;
|
||||
}
|
||||
if (key->type != OPS_PTAG_CT_PUBLIC_KEY) {
|
||||
(void) fprintf(stderr,
|
||||
"__ops_create_pk_sesskey: bad type\n");
|
||||
free(unencoded_m_buf);
|
||||
free(encoded_m_buf);
|
||||
free(sesskey);
|
||||
return NULL;
|
||||
@ -1001,34 +1003,37 @@ __ops_create_pk_sesskey(const __ops_key_t *key)
|
||||
default:
|
||||
(void) fprintf(stderr,
|
||||
"__ops_create_pk_sesskey: bad pubkey algorithm\n");
|
||||
free(unencoded_m_buf);
|
||||
free(encoded_m_buf);
|
||||
free(sesskey);
|
||||
return NULL;
|
||||
}
|
||||
sesskey->alg = pubkey->alg;
|
||||
|
||||
/* \todo allow user to specify other algorithm */
|
||||
sesskey->symm_alg = OPS_SA_CAST5;
|
||||
__ops_random(sesskey->key, CAST_KEY_LENGTH);
|
||||
sesskey->symm_alg = cipher;
|
||||
__ops_random(sesskey->key, cipherinfo.keysize);
|
||||
|
||||
if (__ops_get_debug_level(__FILE__)) {
|
||||
hexdump(stderr, "CAST5 sesskey created", sesskey->key, CAST_KEY_LENGTH);
|
||||
hexdump(stderr, "sesskey created", sesskey->key,
|
||||
cipherinfo.keysize + 1 + 2);
|
||||
}
|
||||
if (create_unencoded_m_buf(sesskey, &unencoded_m_buf[0]) == 0) {
|
||||
if (create_unencoded_m_buf(sesskey, &cipherinfo, &unencoded_m_buf[0]) == 0) {
|
||||
free(unencoded_m_buf);
|
||||
free(encoded_m_buf);
|
||||
free(sesskey);
|
||||
return NULL;
|
||||
}
|
||||
if (__ops_get_debug_level(__FILE__)) {
|
||||
hexdump(stderr, "uuencoded m buf", unencoded_m_buf, SZ_UNENCODED_M_BUF);
|
||||
hexdump(stderr, "uuencoded m buf", unencoded_m_buf, cipherinfo.keysize + 1 + 2);
|
||||
}
|
||||
encode_m_buf(unencoded_m_buf, SZ_UNENCODED_M_BUF, pubkey, encoded_m_buf);
|
||||
encode_m_buf(unencoded_m_buf, cipherinfo.keysize + 1 + 2, pubkey, encoded_m_buf);
|
||||
|
||||
/* and encrypt it */
|
||||
switch (key->key.pubkey.alg) {
|
||||
case OPS_PKA_RSA:
|
||||
if (!__ops_rsa_encrypt_mpi(encoded_m_buf, sz_encoded_m_buf, pubkey,
|
||||
&sesskey->params)) {
|
||||
free(unencoded_m_buf);
|
||||
free(encoded_m_buf);
|
||||
free(sesskey);
|
||||
return NULL;
|
||||
@ -1037,6 +1042,7 @@ __ops_create_pk_sesskey(const __ops_key_t *key)
|
||||
case OPS_PKA_DSA:
|
||||
case OPS_PKA_ELGAMAL:
|
||||
(void) fprintf(stderr, "DSA/Elgamal encryption not supported yet\n");
|
||||
free(unencoded_m_buf);
|
||||
free(encoded_m_buf);
|
||||
free(sesskey);
|
||||
return NULL;
|
||||
@ -1044,6 +1050,7 @@ __ops_create_pk_sesskey(const __ops_key_t *key)
|
||||
/* will not get here - for lint only */
|
||||
break;
|
||||
}
|
||||
free(unencoded_m_buf);
|
||||
free(encoded_m_buf);
|
||||
return sesskey;
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ unsigned __ops_write_litdata(__ops_output_t *,
|
||||
const uint8_t *,
|
||||
const int,
|
||||
const __ops_litdata_enum);
|
||||
__ops_pk_sesskey_t *__ops_create_pk_sesskey(const __ops_key_t *);
|
||||
__ops_pk_sesskey_t *__ops_create_pk_sesskey(const __ops_key_t *, const char *);
|
||||
unsigned __ops_write_pk_sesskey(__ops_output_t *, __ops_pk_sesskey_t *);
|
||||
unsigned __ops_write_xfer_pubkey(__ops_output_t *,
|
||||
const __ops_key_t *, const unsigned);
|
||||
|
12
crypto/external/bsd/netpgp/dist/src/lib/crypto.c
vendored
12
crypto/external/bsd/netpgp/dist/src/lib/crypto.c
vendored
@ -54,7 +54,7 @@
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
|
||||
__RCSID("$NetBSD: crypto.c,v 1.28 2010/09/08 03:21:22 agc Exp $");
|
||||
__RCSID("$NetBSD: crypto.c,v 1.29 2010/11/04 15:38:45 agc Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -305,7 +305,8 @@ __ops_encrypt_file(__ops_io_t *io,
|
||||
const char *outfile,
|
||||
const __ops_key_t *key,
|
||||
const unsigned use_armour,
|
||||
const unsigned allow_overwrite)
|
||||
const unsigned allow_overwrite,
|
||||
const char *cipher)
|
||||
{
|
||||
__ops_output_t *output;
|
||||
__ops_memory_t *inmem;
|
||||
@ -328,7 +329,7 @@ __ops_encrypt_file(__ops_io_t *io,
|
||||
}
|
||||
|
||||
/* Push the encrypted writer */
|
||||
if (!__ops_push_enc_se_ip(output, key)) {
|
||||
if (!__ops_push_enc_se_ip(output, key, cipher)) {
|
||||
__ops_memory_free(inmem);
|
||||
return 0;
|
||||
}
|
||||
@ -349,7 +350,8 @@ __ops_encrypt_buf(__ops_io_t *io,
|
||||
const void *input,
|
||||
const size_t insize,
|
||||
const __ops_key_t *pubkey,
|
||||
const unsigned use_armour)
|
||||
const unsigned use_armour,
|
||||
const char *cipher)
|
||||
{
|
||||
__ops_output_t *output;
|
||||
__ops_memory_t *outmem;
|
||||
@ -369,7 +371,7 @@ __ops_encrypt_buf(__ops_io_t *io,
|
||||
}
|
||||
|
||||
/* Push the encrypted writer */
|
||||
__ops_push_enc_se_ip(output, pubkey);
|
||||
__ops_push_enc_se_ip(output, pubkey, cipher);
|
||||
|
||||
/* This does the writing */
|
||||
__ops_write(output, input, (unsigned)insize);
|
||||
|
@ -169,7 +169,7 @@ void __ops_writer_push_encrypt(__ops_output_t *,
|
||||
|
||||
unsigned __ops_encrypt_file(__ops_io_t *, const char *, const char *,
|
||||
const __ops_key_t *,
|
||||
const unsigned, const unsigned);
|
||||
const unsigned, const unsigned, const char *);
|
||||
unsigned __ops_decrypt_file(__ops_io_t *,
|
||||
const char *,
|
||||
const char *,
|
||||
@ -182,11 +182,9 @@ unsigned __ops_decrypt_file(__ops_io_t *,
|
||||
__ops_cbfunc_t *);
|
||||
|
||||
__ops_memory_t *
|
||||
__ops_encrypt_buf(__ops_io_t *,
|
||||
const void *,
|
||||
const size_t,
|
||||
__ops_encrypt_buf(__ops_io_t *, const void *, const size_t,
|
||||
const __ops_key_t *,
|
||||
const unsigned);
|
||||
const unsigned, const char *);
|
||||
__ops_memory_t *
|
||||
__ops_decrypt_buf(__ops_io_t *,
|
||||
const void *,
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
|
||||
__RCSID("$NetBSD: netpgp.c,v 1.79 2010/11/04 06:45:28 agc Exp $");
|
||||
__RCSID("$NetBSD: netpgp.c,v 1.80 2010/11/04 15:38:45 agc Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -1189,7 +1189,7 @@ netpgp_encrypt_file(netpgp_t *netpgp,
|
||||
out = outname;
|
||||
}
|
||||
return (int)__ops_encrypt_file(io, f, out, key, (unsigned)armored,
|
||||
overwrite);
|
||||
overwrite, netpgp_getvar(netpgp, "cipher"));
|
||||
}
|
||||
|
||||
#define ARMOR_HEAD "-----BEGIN PGP MESSAGE-----"
|
||||
@ -1494,7 +1494,8 @@ netpgp_encrypt_memory(netpgp_t *netpgp,
|
||||
"netpgp_encrypt_buf: input size is larger than output size\n");
|
||||
return 0;
|
||||
}
|
||||
enc = __ops_encrypt_buf(io, in, insize, keypair, (unsigned)armored);
|
||||
enc = __ops_encrypt_buf(io, in, insize, keypair, (unsigned)armored,
|
||||
netpgp_getvar(netpgp, "cipher"));
|
||||
m = MIN(__ops_mem_len(enc), outsize);
|
||||
(void) memcpy(out, __ops_mem_data(enc), m);
|
||||
__ops_memory_free(enc);
|
||||
|
@ -58,7 +58,7 @@
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
|
||||
__RCSID("$NetBSD: packet-parse.c,v 1.42 2010/09/08 03:21:22 agc Exp $");
|
||||
__RCSID("$NetBSD: packet-parse.c,v 1.43 2010/11/04 15:38:45 agc Exp $");
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_OPENSSL_CAST_H
|
||||
@ -2651,10 +2651,7 @@ parse_pk_sesskey(__ops_region_t *region,
|
||||
unsigned k;
|
||||
BIGNUM *enc_m;
|
||||
int n;
|
||||
/* Can't rely on it being CAST5 */
|
||||
/* \todo FIXME RW */
|
||||
/* const size_t sz_unencoded_m_buf=CAST_KEY_LENGTH+1+2; */
|
||||
uint8_t unencoded_m_buf[1024];
|
||||
uint8_t unencoded_m_buf[1024];
|
||||
|
||||
if (!limread(&c, 1, region, stream)) {
|
||||
return 0;
|
||||
|
@ -75,7 +75,7 @@ unsigned __ops_write_se_ip_pktset(__ops_output_t *, const uint8_t *,
|
||||
const unsigned,
|
||||
__ops_crypt_t *);
|
||||
void __ops_push_enc_crypt(__ops_output_t *, __ops_crypt_t *);
|
||||
int __ops_push_enc_se_ip(__ops_output_t *, const __ops_key_t *);
|
||||
int __ops_push_enc_se_ip(__ops_output_t *, const __ops_key_t *, const char *);
|
||||
|
||||
/* Secret Key checksum */
|
||||
void __ops_push_checksum_writer(__ops_output_t *, __ops_seckey_t *);
|
||||
|
@ -54,7 +54,7 @@
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
|
||||
__RCSID("$NetBSD: symmetric.c,v 1.15 2010/11/04 07:35:08 agc Exp $");
|
||||
__RCSID("$NetBSD: symmetric.c,v 1.16 2010/11/04 15:38:45 agc Exp $");
|
||||
#endif
|
||||
|
||||
#include "crypto.h"
|
||||
@ -757,6 +757,10 @@ __ops_is_sa_supported(__ops_symm_alg_t alg)
|
||||
case OPS_SA_AES_256:
|
||||
case OPS_SA_CAST5:
|
||||
case OPS_SA_TRIPLEDES:
|
||||
#ifndef OPENSSL_NO_CAMELLIA
|
||||
case OPS_SA_CAMELLIA_128:
|
||||
case OPS_SA_CAMELLIA_256:
|
||||
#endif
|
||||
#ifndef OPENSSL_NO_IDEA
|
||||
case OPS_SA_IDEA:
|
||||
#endif
|
||||
|
10
crypto/external/bsd/netpgp/dist/src/lib/writer.c
vendored
10
crypto/external/bsd/netpgp/dist/src/lib/writer.c
vendored
@ -58,7 +58,7 @@
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
|
||||
__RCSID("$NetBSD: writer.c,v 1.28 2010/08/15 16:36:24 agc Exp $");
|
||||
__RCSID("$NetBSD: writer.c,v 1.29 2010/11/04 15:38:45 agc Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -1026,7 +1026,7 @@ static void encrypt_se_ip_destroyer(__ops_writer_t *);
|
||||
\brief Push Encrypted SE IP Writer onto stack
|
||||
*/
|
||||
int
|
||||
__ops_push_enc_se_ip(__ops_output_t *output, const __ops_key_t *pubkey)
|
||||
__ops_push_enc_se_ip(__ops_output_t *output, const __ops_key_t *pubkey, const char *cipher)
|
||||
{
|
||||
__ops_pk_sesskey_t *encrypted_pk_sesskey;
|
||||
encrypt_se_ip_t *se_ip;
|
||||
@ -1039,7 +1039,7 @@ __ops_push_enc_se_ip(__ops_output_t *output, const __ops_key_t *pubkey)
|
||||
}
|
||||
|
||||
/* Create and write encrypted PK session key */
|
||||
if ((encrypted_pk_sesskey = __ops_create_pk_sesskey(pubkey)) == NULL) {
|
||||
if ((encrypted_pk_sesskey = __ops_create_pk_sesskey(pubkey, cipher)) == NULL) {
|
||||
(void) fprintf(stderr, "__ops_push_enc_se_ip: null pk sesskey\n");
|
||||
return 0;
|
||||
}
|
||||
@ -1409,7 +1409,7 @@ static void str_enc_se_ip_destroyer(__ops_writer_t *writer);
|
||||
\param pubkey
|
||||
*/
|
||||
void
|
||||
__ops_push_stream_enc_se_ip(__ops_output_t *output, const __ops_key_t *pubkey)
|
||||
__ops_push_stream_enc_se_ip(__ops_output_t *output, const __ops_key_t *pubkey, const char *cipher)
|
||||
{
|
||||
__ops_pk_sesskey_t *encrypted_pk_sesskey;
|
||||
str_enc_se_ip_t *se_ip;
|
||||
@ -1422,7 +1422,7 @@ __ops_push_stream_enc_se_ip(__ops_output_t *output, const __ops_key_t *pubkey)
|
||||
"__ops_push_stream_enc_se_ip: bad alloc\n");
|
||||
return;
|
||||
}
|
||||
encrypted_pk_sesskey = __ops_create_pk_sesskey(pubkey);
|
||||
encrypted_pk_sesskey = __ops_create_pk_sesskey(pubkey, cipher);
|
||||
__ops_write_pk_sesskey(output, encrypted_pk_sesskey);
|
||||
|
||||
/* Setup the se_ip */
|
||||
|
@ -114,6 +114,6 @@ unsigned __ops_write_mpi(__ops_output_t *, const BIGNUM *);
|
||||
void __ops_writer_info_delete(__ops_writer_t *);
|
||||
unsigned __ops_writer_info_finalise(__ops_error_t **, __ops_writer_t *);
|
||||
|
||||
void __ops_push_stream_enc_se_ip(__ops_output_t *, const __ops_key_t *);
|
||||
void __ops_push_stream_enc_se_ip(__ops_output_t *, const __ops_key_t *, const char *);
|
||||
|
||||
#endif /* WRITER_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user