[openssl-commits] [openssl] master update
Rich Salz
rsalz at openssl.org
Sun Jul 24 21:49:17 UTC 2016
The branch master has been updated
via c1054bb4d2a2e730d8ecb25037904f7d9a7f137d (commit)
from 47d96bcc6b0eea6348b3b08a0c5b075d4d70de95 (commit)
- Log -----------------------------------------------------------------
commit c1054bb4d2a2e730d8ecb25037904f7d9a7f137d
Author: Jakub Zelenka <bukka at php.net>
Date: Sun Jul 24 18:33:29 2016 +0100
Add EVP_ENCODE_CTX_copy
Reviewed-by: Tim Hudson <tjh at openssl.org>
Reviewed-by: Rich Salz <rsalz at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1344)
-----------------------------------------------------------------------
Summary of changes:
crypto/evp/encode.c | 8 ++++++++
doc/crypto/EVP_EncodeInit.pod | 12 ++++++++----
include/openssl/evp.h | 1 +
util/libcrypto.num | 1 +
4 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/crypto/evp/encode.c b/crypto/evp/encode.c
index d140da6..abb1044 100644
--- a/crypto/evp/encode.c
+++ b/crypto/evp/encode.c
@@ -102,6 +102,14 @@ void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx)
{
OPENSSL_free(ctx);
}
+
+int EVP_ENCODE_CTX_copy(EVP_ENCODE_CTX *dctx, EVP_ENCODE_CTX *sctx)
+{
+ memcpy(dctx, sctx, sizeof(EVP_ENCODE_CTX));
+
+ return 1;
+}
+
int EVP_ENCODE_CTX_num(EVP_ENCODE_CTX *ctx)
{
return ctx->num;
diff --git a/doc/crypto/EVP_EncodeInit.pod b/doc/crypto/EVP_EncodeInit.pod
index 52c97d5..d919b14 100644
--- a/doc/crypto/EVP_EncodeInit.pod
+++ b/doc/crypto/EVP_EncodeInit.pod
@@ -2,10 +2,10 @@
=head1 NAME
-EVP_ENCODE_CTX_new, EVP_ENCODE_CTX_free, EVP_ENCODE_CTX_num, EVP_EncodeInit,
-EVP_EncodeUpdate, EVP_EncodeFinal, EVP_EncodeBlock, EVP_DecodeInit,
-EVP_DecodeUpdate, EVP_DecodeFinal, EVP_DecodeBlock - EVP base 64 encode/decode
-routines
+EVP_ENCODE_CTX_new, EVP_ENCODE_CTX_free, EVP_ENCODE_CTX_copy,
+EVP_ENCODE_CTX_num, EVP_EncodeInit, EVP_EncodeUpdate, EVP_EncodeFinal,
+EVP_EncodeBlock, EVP_DecodeInit, EVP_DecodeUpdate, EVP_DecodeFinal,
+EVP_DecodeBlock - EVP base 64 encode/decode routines
=head1 SYNOPSIS
@@ -13,6 +13,7 @@ routines
EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void);
void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx);
+ int EVP_ENCODE_CTX_copy(EVP_ENCODE_CTX *dctx, EVP_ENCODE_CTX *sctx);
int EVP_ENCODE_CTX_num(EVP_ENCODE_CTX *ctx);
void EVP_EncodeInit(EVP_ENCODE_CTX *ctx);
int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
@@ -76,6 +77,9 @@ in B<*outl>. It is the caller's responsibility to ensure that B<out> is
sufficiently large to accommodate the output data which will never be more than
65 bytes plus an additional NUL terminator (i.e. 66 bytes in total).
+EVP_ENCODE_CTX_copy() can be used to copy a context B<sctx> to a context
+B<dctx>. B<dctx> must be initialized before calling this function.
+
EVP_ENCODE_CTX_num() will return the number of as yet unprocessed bytes still to
be encoded or decoded that are pending in the B<ctx> object.
diff --git a/include/openssl/evp.h b/include/openssl/evp.h
index 9996603..10e048a 100644
--- a/include/openssl/evp.h
+++ b/include/openssl/evp.h
@@ -608,6 +608,7 @@ __owur int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl);
EVP_ENCODE_CTX *EVP_ENCODE_CTX_new(void);
void EVP_ENCODE_CTX_free(EVP_ENCODE_CTX *ctx);
+int EVP_ENCODE_CTX_copy(EVP_ENCODE_CTX *dctx, EVP_ENCODE_CTX *sctx);
int EVP_ENCODE_CTX_num(EVP_ENCODE_CTX *ctx);
void EVP_EncodeInit(EVP_ENCODE_CTX *ctx);
int EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl,
diff --git a/util/libcrypto.num b/util/libcrypto.num
index ea17c0f..0f2d82f 100644
--- a/util/libcrypto.num
+++ b/util/libcrypto.num
@@ -4153,3 +4153,4 @@ NAME_CONSTRAINTS_check_CN 4097 1_1_0 EXIST::FUNCTION:
OCSP_resp_get0_id 4098 1_1_0 EXIST::FUNCTION:OCSP
OCSP_resp_get0_certs 4099 1_1_0 EXIST::FUNCTION:OCSP
X509_set_proxy_flag 4100 1_1_0 EXIST::FUNCTION:
+EVP_ENCODE_CTX_copy 4101 1_1_0 EXIST::FUNCTION:
More information about the openssl-commits
mailing list