diff options
author | jsing <> | 2014-05-26 13:01:58 +0000 |
---|---|---|
committer | jsing <> | 2014-05-26 13:01:58 +0000 |
commit | 1e04f96479c885fa94175f42f348872cbdd3c9d4 (patch) | |
tree | 2d8c2f3b74e112db8f84b41231b2cde79d0be571 /src/lib/libcrypto/evp/evp_locl.h | |
parent | 3ebf48c494177b3b775febf8302322375c80fe3b (diff) | |
download | openbsd-1e04f96479c885fa94175f42f348872cbdd3c9d4.tar.gz openbsd-1e04f96479c885fa94175f42f348872cbdd3c9d4.tar.bz2 openbsd-1e04f96479c885fa94175f42f348872cbdd3c9d4.zip |
Implement an improved version of the EVP AEAD API. The
EVP_AEAD_CTX_{open,seal} functions previously returned an ssize_t that was
overloaded to indicate success/failure, along with the number of bytes
written as output. This change adds an explicit *out_len argument which
is used to return the number of output bytes and the return value is now
an int that is purely used to identify success or failure.
This change effectively rides the last libcrypto crank (although I do not
expect there to be many users of the EVP AEAD API currently).
Thanks to Adam Langley for providing the improved code that this diff is
based on.
ok miod@
Diffstat (limited to 'src/lib/libcrypto/evp/evp_locl.h')
-rw-r--r-- | src/lib/libcrypto/evp/evp_locl.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lib/libcrypto/evp/evp_locl.h b/src/lib/libcrypto/evp/evp_locl.h index 6f9218eafc..3083f30975 100644 --- a/src/lib/libcrypto/evp/evp_locl.h +++ b/src/lib/libcrypto/evp/evp_locl.h | |||
@@ -354,13 +354,13 @@ struct evp_aead_st { | |||
354 | size_t key_len, size_t tag_len); | 354 | size_t key_len, size_t tag_len); |
355 | void (*cleanup)(struct evp_aead_ctx_st*); | 355 | void (*cleanup)(struct evp_aead_ctx_st*); |
356 | 356 | ||
357 | ssize_t (*seal)(const struct evp_aead_ctx_st *ctx, unsigned char *out, | 357 | int (*seal)(const struct evp_aead_ctx_st *ctx, unsigned char *out, |
358 | size_t max_out_len, const unsigned char *nonce, size_t nonce_len, | 358 | size_t *out_len, size_t max_out_len, const unsigned char *nonce, |
359 | const unsigned char *in, size_t in_len, const unsigned char *ad, | 359 | size_t nonce_len, const unsigned char *in, size_t in_len, |
360 | size_t ad_len); | 360 | const unsigned char *ad, size_t ad_len); |
361 | 361 | ||
362 | ssize_t (*open)(const struct evp_aead_ctx_st *ctx, unsigned char *out, | 362 | int (*open)(const struct evp_aead_ctx_st *ctx, unsigned char *out, |
363 | size_t max_out_len, const unsigned char *nonce, size_t nonce_len, | 363 | size_t *out_len, size_t max_out_len, const unsigned char *nonce, |
364 | const unsigned char *in, size_t in_len, const unsigned char *ad, | 364 | size_t nonce_len, const unsigned char *in, size_t in_len, |
365 | size_t ad_len); | 365 | const unsigned char *ad, size_t ad_len); |
366 | }; | 366 | }; |