/src/openssl/crypto/ec/ecdsa_vrf.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright 2002-2020 The OpenSSL Project Authors. All Rights Reserved. |
3 | | * |
4 | | * Licensed under the Apache License 2.0 (the "License"). You may not use |
5 | | * this file except in compliance with the License. You can obtain a copy |
6 | | * in the file LICENSE in the source distribution or at |
7 | | * https://www.openssl.org/source/license.html |
8 | | */ |
9 | | |
10 | | /* |
11 | | * ECDSA low level APIs are deprecated for public use, but still ok for |
12 | | * internal use. |
13 | | */ |
14 | | #include "internal/deprecated.h" |
15 | | |
16 | | #include <openssl/ec.h> |
17 | | #include "ec_local.h" |
18 | | #include <openssl/err.h> |
19 | | |
20 | | /*- |
21 | | * returns |
22 | | * 1: correct signature |
23 | | * 0: incorrect signature |
24 | | * -1: error |
25 | | */ |
26 | | int ECDSA_do_verify(const unsigned char *dgst, int dgst_len, |
27 | | const ECDSA_SIG *sig, EC_KEY *eckey) |
28 | 0 | { |
29 | 0 | if (eckey->meth->verify_sig != NULL) |
30 | 0 | return eckey->meth->verify_sig(dgst, dgst_len, sig, eckey); |
31 | 0 | ERR_raise(ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED); |
32 | 0 | return -1; |
33 | 0 | } |
34 | | |
35 | | /*- |
36 | | * returns |
37 | | * 1: correct signature |
38 | | * 0: incorrect signature |
39 | | * -1: error |
40 | | */ |
41 | | int ECDSA_verify(int type, const unsigned char *dgst, int dgst_len, |
42 | | const unsigned char *sigbuf, int sig_len, EC_KEY *eckey) |
43 | 0 | { |
44 | 0 | if (eckey->meth->verify != NULL) |
45 | 0 | return eckey->meth->verify(type, dgst, dgst_len, sigbuf, sig_len, |
46 | 0 | eckey); |
47 | 0 | ERR_raise(ERR_LIB_EC, EC_R_OPERATION_NOT_SUPPORTED); |
48 | 0 | return -1; |
49 | 0 | } |