diff options
author | tb <> | 2021-05-09 14:25:40 +0000 |
---|---|---|
committer | tb <> | 2021-05-09 14:25:40 +0000 |
commit | 43c113cccadf509f99393902ca7849399a77533a (patch) | |
tree | f112423d4c94314af4149c65ad8c2fc134c10edd /src/lib/libcrypto/evp/evp.h | |
parent | 00a09bf96d7f1c78d30414599acdc9f4726ae1d9 (diff) | |
download | openbsd-43c113cccadf509f99393902ca7849399a77533a.tar.gz openbsd-43c113cccadf509f99393902ca7849399a77533a.tar.bz2 openbsd-43c113cccadf509f99393902ca7849399a77533a.zip |
Prepare to provide EVP_Digest{Sign,Verify}
These are one-shot versions combining EVP_Digest{Sign,Verify}{Update,Final}.
and are part of the OpenSSL 1.1.1 API. While they simplify callers in some
situations slightly, their real use is for EdDSA that by design can't be
split into Update/Final steps.
Based on OpenSSL commit 7539418981c140648a620d72edd7398564878b5c
ok inoguchi
Diffstat (limited to 'src/lib/libcrypto/evp/evp.h')
-rw-r--r-- | src/lib/libcrypto/evp/evp.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h index e8a6eea035..e2ec40b26c 100644 --- a/src/lib/libcrypto/evp/evp.h +++ b/src/lib/libcrypto/evp/evp.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: evp.h,v 1.81 2021/03/31 16:47:01 tb Exp $ */ | 1 | /* $OpenBSD: evp.h,v 1.82 2021/05/09 14:25:40 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -617,7 +617,7 @@ int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); | |||
617 | #ifndef LIBRESSL_INTERNAL | 617 | #ifndef LIBRESSL_INTERNAL |
618 | int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); | 618 | int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); |
619 | #endif | 619 | #endif |
620 | 620 | ||
621 | int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s, | 621 | int EVP_SignFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s, |
622 | EVP_PKEY *pkey); | 622 | EVP_PKEY *pkey); |
623 | 623 | ||
@@ -628,11 +628,21 @@ int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, | |||
628 | const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey); | 628 | const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey); |
629 | int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen); | 629 | int EVP_DigestSignFinal(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen); |
630 | 630 | ||
631 | #if defined(LIBRESSL_INTERNAL) | ||
632 | int EVP_DigestSign(EVP_MD_CTX *ctx, unsigned char *sigret, size_t *siglen, | ||
633 | const unsigned char *tbs, size_t tbslen); | ||
634 | #endif | ||
635 | |||
631 | int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, | 636 | int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, |
632 | const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey); | 637 | const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey); |
633 | int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig, | 638 | int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig, |
634 | size_t siglen); | 639 | size_t siglen); |
635 | 640 | ||
641 | #if defined(LIBRESSL_INTERNAL) | ||
642 | int EVP_DigestVerify(EVP_MD_CTX *ctx, const unsigned char *sigret, | ||
643 | size_t siglen, const unsigned char *tbs, size_t tbslen); | ||
644 | #endif | ||
645 | |||
636 | int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, | 646 | int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, |
637 | const unsigned char *ek, int ekl, const unsigned char *iv, EVP_PKEY *priv); | 647 | const unsigned char *ek, int ekl, const unsigned char *iv, EVP_PKEY *priv); |
638 | int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); | 648 | int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); |