summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmc <>2016-11-14 18:23:30 +0000
committerjmc <>2016-11-14 18:23:30 +0000
commit4cda5d5cbf155e7ac156a140f7b6feed7c47bda9 (patch)
treec08b7bb999d24496bf06dbba6f23a977628e6d18
parente2aa470896f94f855456d30352022bbca75781d1 (diff)
downloadopenbsd-4cda5d5cbf155e7ac156a140f7b6feed7c47bda9.tar.gz
openbsd-4cda5d5cbf155e7ac156a140f7b6feed7c47bda9.tar.bz2
openbsd-4cda5d5cbf155e7ac156a140f7b6feed7c47bda9.zip
various cleanup;
-rw-r--r--src/lib/libcrypto/man/ECDSA_SIG_new.398
1 files changed, 50 insertions, 48 deletions
diff --git a/src/lib/libcrypto/man/ECDSA_SIG_new.3 b/src/lib/libcrypto/man/ECDSA_SIG_new.3
index cc5bcd8d3a..d71d8d6133 100644
--- a/src/lib/libcrypto/man/ECDSA_SIG_new.3
+++ b/src/lib/libcrypto/man/ECDSA_SIG_new.3
@@ -1,6 +1,6 @@
1.\" $OpenBSD: ECDSA_SIG_new.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ 1.\" $OpenBSD: ECDSA_SIG_new.3,v 1.3 2016/11/14 18:23:30 jmc Exp $
2.\" 2.\"
3.Dd $Mdocdate: November 6 2016 $ 3.Dd $Mdocdate: November 14 2016 $
4.Dt ECDSA_SIG_NEW 3 4.Dt ECDSA_SIG_NEW 3
5.Os 5.Os
6.Sh NAME 6.Sh NAME
@@ -45,26 +45,9 @@
45.Fa "const unsigned char **pp" 45.Fa "const unsigned char **pp"
46.Fa "long len" 46.Fa "long len"
47.Fc 47.Fc
48.Ft ECDSA_SIG*
49.Fo ECDSA_do_sign
50.Fa "const unsigned char *dgst"
51.Fa "int dgst_len"
52.Fa "EC_KEY *eckey"
53.Fc
54.Ft ECDSA_SIG*
55.Fo ECDSA_do_sign_ex
56.Fa "const unsigned char *dgst"
57.Fa "int dgstlen"
58.Fa "const BIGNUM *kinv"
59.Fa "const BIGNUM *rp"
60.Fa "EC_KEY *eckey"
61.Fc
62.Ft int 48.Ft int
63.Fo ECDSA_do_verify 49.Fo ECDSA_size
64.Fa "const unsigned char *dgst" 50.Fa "const EC_KEY *eckey"
65.Fa "int dgst_len"
66.Fa "const ECDSA_SIG *sig"
67.Fa "EC_KEY* eckey"
68.Fc 51.Fc
69.Ft int 52.Ft int
70.Fo ECDSA_sign_setup 53.Fo ECDSA_sign_setup
@@ -102,26 +85,39 @@
102.Fa "int siglen" 85.Fa "int siglen"
103.Fa "EC_KEY *eckey" 86.Fa "EC_KEY *eckey"
104.Fc 87.Fc
88.Ft ECDSA_SIG*
89.Fo ECDSA_do_sign
90.Fa "const unsigned char *dgst"
91.Fa "int dgst_len"
92.Fa "EC_KEY *eckey"
93.Fc
94.Ft ECDSA_SIG*
95.Fo ECDSA_do_sign_ex
96.Fa "const unsigned char *dgst"
97.Fa "int dgstlen"
98.Fa "const BIGNUM *kinv"
99.Fa "const BIGNUM *rp"
100.Fa "EC_KEY *eckey"
101.Fc
105.Ft int 102.Ft int
106.Fo ECDSA_size 103.Fo ECDSA_do_verify
107.Fa "const EC_KEY *eckey" 104.Fa "const unsigned char *dgst"
105.Fa "int dgst_len"
106.Fa "const ECDSA_SIG *sig"
107.Fa "EC_KEY* eckey"
108.Fc 108.Fc
109.Ft const ECDSA_METHOD* 109.Ft const ECDSA_METHOD*
110.Fo ECDSA_OpenSSL 110.Fo ECDSA_OpenSSL
111.Fa void 111.Fa void
112.Fc 112.Fc
113.Ft void
114.Fo ECDSA_set_default_method
115.Fa "const ECDSA_METHOD *meth"
116.Fc
117.Ft const ECDSA_METHOD* 113.Ft const ECDSA_METHOD*
118.Fo ECDSA_get_default_method 114.Fo ECDSA_get_default_method
119.Fa void 115.Fa void
120.Fc 116.Fc
121.Ft int 117.Ft void*
122.Fo ECDSA_set_method 118.Fo ECDSA_get_ex_data
123.Fa "EC_KEY *eckey" 119.Fa "EC_KEY *d"
124.Fa "const ECDSA_METHOD *meth" 120.Fa "int idx"
125.Fc 121.Fc
126.Ft int 122.Ft int
127.Fo ECDSA_get_ex_new_index 123.Fo ECDSA_get_ex_new_index
@@ -131,16 +127,20 @@
131.Fa "CRYPTO_EX_dup *dup_func" 127.Fa "CRYPTO_EX_dup *dup_func"
132.Fa "CRYPTO_EX_free *free_func" 128.Fa "CRYPTO_EX_free *free_func"
133.Fc 129.Fc
130.Ft void
131.Fo ECDSA_set_default_method
132.Fa "const ECDSA_METHOD *meth"
133.Fc
134.Ft int 134.Ft int
135.Fo ECDSA_set_ex_data 135.Fo ECDSA_set_ex_data
136.Fa "EC_KEY *d" 136.Fa "EC_KEY *d"
137.Fa "int idx" 137.Fa "int idx"
138.Fa "void *arg" 138.Fa "void *arg"
139.Fc 139.Fc
140.Ft void* 140.Ft int
141.Fo ECDSA_get_ex_data 141.Fo ECDSA_set_method
142.Fa "EC_KEY *d" 142.Fa "EC_KEY *eckey"
143.Fa "int idx" 143.Fa "const ECDSA_METHOD *meth"
144.Fc 144.Fc
145.Sh DESCRIPTION 145.Sh DESCRIPTION
146The 146The
@@ -182,21 +182,21 @@ and writes the encoded signature to
182is 182is
183.Dv NULL , 183.Dv NULL ,
184.Fn i2d_ECDSA_SIG 184.Fn i2d_ECDSA_SIG
185returns the expected length in bytes of the DER encoded signature). 185returns the expected length in bytes of the DER-encoded signature).
186.Fn i2d_ECDSA_SIG 186.Fn i2d_ECDSA_SIG
187returns the length of the DER encoded signature (or 0 on error). 187returns the length of the DER-encoded signature (or 0 on error).
188.Pp 188.Pp
189.Fn d2i_ECDSA_SIG 189.Fn d2i_ECDSA_SIG
190decodes a DER encoded ECDSA signature and returns the decoded signature 190decodes a DER-encoded ECDSA signature and returns the decoded signature
191in a newly allocated 191in a newly allocated
192.Vt ECDSA_SIG 192.Vt ECDSA_SIG
193structure. 193structure.
194.Fa *sig 194.Fa *sig
195points to the buffer containing the DER encoded signature of size 195points to the buffer containing the DER-encoded signature of size
196.Fa len . 196.Fa len .
197.Pp 197.Pp
198.Fn ECDSA_size 198.Fn ECDSA_size
199returns the maximum length of a DER encoded ECDSA signature created with 199returns the maximum length of a DER-encoded ECDSA signature created with
200the private EC key 200the private EC key
201.Fa eckey . 201.Fa eckey .
202.Pp 202.Pp
@@ -209,7 +209,7 @@ is a pointer to a
209.Vt BN_CTX 209.Vt BN_CTX
210structure (or 210structure (or
211.Dv NULL ) . 211.Dv NULL ) .
212The precomputed values or returned in 212The precomputed values are returned in
213.Fa kinv 213.Fa kinv
214and 214and
215.Fa rp 215.Fa rp
@@ -219,7 +219,7 @@ or
219.Fa ECDSA_do_sign_ex . 219.Fa ECDSA_do_sign_ex .
220.Pp 220.Pp
221.Fn ECDSA_sign 221.Fn ECDSA_sign
222is wrapper function for 222is a wrapper function for
223.Fa ECDSA_sign_ex 223.Fa ECDSA_sign_ex
224with 224with
225.Fa kinv 225.Fa kinv
@@ -239,7 +239,7 @@ and the optional pre-computed values
239.Fa kinv 239.Fa kinv
240and 240and
241.Fa rp . 241.Fa rp .
242The DER encoded signatures is stored in 242The DER-encoded signature is stored in
243.Fa sig 243.Fa sig
244and its length is returned in 244and its length is returned in
245.Fa siglen . 245.Fa siglen .
@@ -268,7 +268,9 @@ The parameter
268is ignored. 268is ignored.
269.Pp 269.Pp
270.Fn ECDSA_do_sign 270.Fn ECDSA_do_sign
271is wrapper function for ECDSA_do_sign_ex with 271is a wrapper function for
272.Fn ECDSA_do_sign_ex
273with
272.Fa kinv 274.Fa kinv
273and 275and
274.Fa rp 276.Fa rp
@@ -318,10 +320,10 @@ error.
318The error codes can be obtained by 320The error codes can be obtained by
319.Xr ERR_get_error 3 . 321.Xr ERR_get_error 3 .
320.Sh EXAMPLES 322.Sh EXAMPLES
321Creating a ECDSA signature of given SHA-1 hash value using the named 323Creating an ECDSA signature of given SHA-1 hash value using the named
322curve secp192k1. 324curve secp192k1.
323.Pp 325.Pp
324First step: Create an 326First step: create an
325.Vt EC_KEY 327.Vt EC_KEY
326object. 328object.
327This part is 329This part is
@@ -364,7 +366,7 @@ if (!ECDSA_sign(0, dgst, dgstlen, pp, &buf_len, eckey) {
364} 366}
365.Ed 367.Ed
366.Pp 368.Pp
367Third step: Verify the created ECDSA signature using 369Third step: verify the created ECDSA signature using
368.Fn ECDSA_do_verify 370.Fn ECDSA_do_verify
369.Pp 371.Pp
370.Dl ret = ECDSA_do_verify(digest, 20, sig, eckey); 372.Dl ret = ECDSA_do_verify(digest, 20, sig, eckey);
@@ -392,7 +394,7 @@ if (ret == -1) {
392ANSI X9.62, US Federal Information Processing Standard FIPS 186-2 394ANSI X9.62, US Federal Information Processing Standard FIPS 186-2
393(Digital Signature Standard, DSS) 395(Digital Signature Standard, DSS)
394.Sh HISTORY 396.Sh HISTORY
395The ecdsa implementation was first introduced in OpenSSL 0.9.8. 397The ECDSA implementation was first introduced in OpenSSL 0.9.8.
396.Sh AUTHORS 398.Sh AUTHORS
397.An Nils Larsch 399.An Nils Larsch
398for the OpenSSL project. 400for the OpenSSL project.