diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2008-03-18 01:00:38 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2008-03-18 01:00:38 +0000 |
commit | 6e3bc4f0730a3cb7d2d263153cb234da51637b38 (patch) | |
tree | 4014d7cad18d13c1483b6f5fd580c2deda17ccee /crypto/aes | |
parent | c36e936b60abcc426b74135b9ce4fd2950725c68 (diff) |
More support for KEK RecipientInfo.
Generalise RecipientInfo and enveloped data handling so applications can
add their own key lookup routines as well as using the standard ones.
Diffstat (limited to 'crypto/aes')
-rw-r--r-- | crypto/aes/Makefile | 4 | ||||
-rw-r--r-- | crypto/aes/aes.h | 7 | ||||
-rw-r--r-- | crypto/aes/aes_wrap.c | 8 |
3 files changed, 13 insertions, 6 deletions
diff --git a/crypto/aes/Makefile b/crypto/aes/Makefile index 632fdb55bd..80dcc3251c 100644 --- a/crypto/aes/Makefile +++ b/crypto/aes/Makefile @@ -24,8 +24,8 @@ APPS= LIB=$(TOP)/libcrypto.a LIBSRC=aes_core.c aes_misc.c aes_ecb.c aes_cbc.c aes_cfb.c aes_ofb.c \ - aes_ctr.c aes_ige.c -LIBOBJ=aes_misc.o aes_ecb.o aes_cfb.o aes_ofb.o aes_ctr.o aes_ige.o \ + aes_ctr.c aes_ige.c aes_wrap.c +LIBOBJ=aes_misc.o aes_ecb.o aes_cfb.o aes_ofb.o aes_ctr.o aes_ige.o aes_wrap.o \ $(AES_ENC) SRC= $(LIBSRC) diff --git a/crypto/aes/aes.h b/crypto/aes/aes.h index 949a754a0f..51f91e6079 100644 --- a/crypto/aes/aes.h +++ b/crypto/aes/aes.h @@ -128,6 +128,13 @@ void AES_bi_ige_encrypt(const unsigned char *in, unsigned char *out, const AES_KEY *key2, const unsigned char *ivec, const int enc); +int AES_wrap_key(AES_KEY *key, const unsigned char *iv, + unsigned char *out, + const unsigned char *in, unsigned int inlen); +int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, + unsigned char *out, + const unsigned char *in, unsigned int inlen); + #ifdef __cplusplus } diff --git a/crypto/aes/aes_wrap.c b/crypto/aes/aes_wrap.c index ba62b55a9f..9feacd65d8 100644 --- a/crypto/aes/aes_wrap.c +++ b/crypto/aes/aes_wrap.c @@ -55,6 +55,10 @@ #include <openssl/aes.h> #include <openssl/bio.h> +static const unsigned char default_iv[] = { + 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, +}; + int AES_wrap_key(AES_KEY *key, const unsigned char *iv, unsigned char *out, const unsigned char *in, unsigned int inlen) @@ -195,10 +199,6 @@ static const unsigned char key[] = { 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f }; -static const unsigned char default_iv[] = { - 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, -}; - static const unsigned char e1[] = { 0x1f, 0xa6, 0x8b, 0x0a, 0x81, 0x12, 0xb4, 0x47, 0xae, 0xf3, 0x4b, 0xd8, 0xfb, 0x5a, 0x7b, 0x82, |