/* crypto/ecdsa/ecdsa_sign.c */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. All advertising materials mentioning features or use of this * software must display the following acknowledgment: * "This product includes software developed by the OpenSSL Project * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" * * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to * endorse or promote products derived from this software without * prior written permission. For written permission, please contact * openssl-core@OpenSSL.org. * * 5. Products derived from this software may not be called "OpenSSL" * nor may "OpenSSL" appear in their names without prior written * permission of the OpenSSL Project. * * 6. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by the OpenSSL Project * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" * * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * ==================================================================== * * This product includes cryptographic software written by Eric Young * (eay@cryptsoft.com). This product includes software written by Tim * Hudson (tjh@cryptsoft.com). * */ #include "ecs_locl.h" #ifndef OPENSSL_NO_ENGINE #include #endif ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst, int dlen, EC_KEY *eckey) { return ECDSA_do_sign_ex(dgst, dlen, NULL, NULL, eckey); } ECDSA_SIG *ECDSA_do_sign_ex(const unsigned char *dgst, int dlen, const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey) { ECDSA_DATA *ecdsa = ecdsa_check(eckey); if (ecdsa == NULL) return NULL; return ecdsa->meth->ecdsa_do_sign(dgst, dlen, kinv, rp, eckey); } int ECDSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, EC_KEY *eckey) { return ECDSA_sign_ex(type, dgst, dlen, sig, siglen, NULL, NULL, eckey); } int ECDSA_sign_ex(int type, const unsigned char *dgst, int dlen, unsigned char *sig, unsigned int *siglen, const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey) { ECDSA_SIG *s; s = ECDSA_do_sign_ex(dgst, dlen, kinv, r, eckey); if (s == NULL) { *siglen=0; return 0; } *siglen = i2d_ECDSA_SIG(s, &sig); ECDSA_SIG_free(s); return 1; } int ECDSA_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) { ECDSA_DATA *ecdsa = ecdsa_check(eckey); if (ecdsa == NULL) return 0; return ecdsa->meth->ecdsa_sign_setup(eckey, ctx_in, kinvp, rp); } Rob Austein <sra@hactrn.net> 2007-06-20 14:38:38 +0000 committer Rob Austein <sra@hactrn.net> 2007-06-20 14:38:38 +0000 Huh, trang converts comments too, how kind' href='/sra/rpki.net/commit/scripts/up-down-schema.rng?id=16d514176b50cbc509d63f257388fbbc9585e371'>16d51417
cdbcb769

16d51417
3f04ec85

16d51417
6acbb9ce
cdbcb769















































6acbb9ce







cdbcb769
6acbb9ce

cdbcb769
6acbb9ce
6acbb9ce























































cdbcb769
6acbb9ce

cdbcb769
6acbb9ce
6acbb9ce
cdbcb769
6acbb9ce

cdbcb769
6acbb9ce

cdbcb769



6acbb9ce


79b720d4
6acbb9ce
79b720d4
6acbb9ce





cdbcb769
6acbb9ce
6acbb9ce

cdbcb769
6acbb9ce



cdbcb769
6acbb9ce



cdbcb769
6acbb9ce

cdbcb769
6acbb9ce


cdbcb769
6acbb9ce





cdbcb769
6acbb9ce


cdbcb769
6acbb9ce



cdbcb769
6acbb9ce



cdbcb769
6acbb9ce

cdbcb769
6acbb9ce













cdbcb769
6acbb9ce

cdbcb769
6acbb9ce





cdbcb769
6acbb9ce

cdbcb769
6acbb9ce







cdbcb769
6acbb9ce

e7da2a67


cdbcb769

e7da2a67

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
                                      
    
                                                         
  

                                                     
  

                                                                      
   
                                                                                                                                                                    















































                                                     







                                              
                           

                                  
                           
                  























































                                          
                                

                                 
                              
                  
                                        
                                     

                                          
                                      

                                          



                                              


                                             
                              
                                                
                                                    





                                     
                                  
                      

                                                  
                                           



                                                    
                                            



                                                    
                                            

                        
                                     


                             
                                   





                                   
                                


                                              
                                       



                                                
                                        



                                                
                                        

                    
                                 













                                   
                                

                            
                         





                                   
                                               

              
                







                                              
                 

           


                       

                               

      
<?xml version="1.0" encoding="UTF-8"?>
<!--
  $Id: up-down-schema.rnc 3913 2011-07-01 17:04:18Z sra $
  
  RelaxNG Scheme for up-down protocol, extracted from
  draft-ietf-sidr-rescerts-provisioning-10.txt.
  
  libxml2 (including xmllint) only groks the XML syntax of RelaxNG, so
  run the compact syntax through trang to get XML syntax.
-->
<grammar ns="http://www.apnic.net/specs/rescerts/up-down/" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  <define name="resource_set_as">
    <data type="string">
      <param name="maxLength">512000</param>
      <param name="pattern">[\-,0-9]*</param>
    </data>
  </define>
  <define name="resource_set_ip4">
    <data type="string">
      <param name="maxLength">512000</param>
      <param name="pattern">[\-,/.0-9]*</param>
    </data>
  </define>
  <define name="resource_set_ip6">
    <data type="string">
      <param name="maxLength">512000</param>
      <param name="pattern">[\-,/:0-9a-fA-F]*</param>
    </data>
  </define>
  <define name="class_name">
    <data type="token">
      <param name="minLength">1</param>
      <param name="maxLength">1024</param>
    </data>
  </define>
  <define name="ski">
    <data type="token">
      <param name="minLength">27</param>
      <param name="maxLength">1024</param>
    </data>
  </define>
  <define name="label">
    <data type="token">
      <param name="minLength">1</param>
      <param name="maxLength">1024</param>
    </data>
  </define>
  <define name="cert_url">
    <data type="string">
      <param name="minLength">10</param>
      <param name="maxLength">4096</param>
    </data>
  </define>
  <define name="base64_binary">
    <data type="base64Binary">
      <param name="minLength">4</param>
      <param name="maxLength">512000</param>
    </data>
  </define>
  <start>
    <element name="message">
      <attribute name="version">
        <data type="positiveInteger">
          <param name="maxInclusive">1</param>
        </data>
      </attribute>
      <attribute name="sender">
        <ref name="label"/>
      </attribute>
      <attribute name="recipient">
        <ref name="label"/>
      </attribute>
      <ref name="payload"/>
    </element>
  </start>
  <define name="payload" combine="choice">
    <attribute name="type">
      <value>list</value>
    </attribute>
    <ref name="list_request"/>
  </define>
  <define name="payload" combine="choice">
    <attribute name="type">
      <value>list_response</value>
    </attribute>
    <ref name="list_response"/>
  </define>
  <define name="payload" combine="choice">
    <attribute name="type">
      <value>issue</value>
    </attribute>
    <ref name="issue_request"/>
  </define>
  <define name="payload" combine="choice">
    <attribute name="type">
      <value>issue_response</value>
    </attribute>
    <ref name="issue_response"/>
  </define>
  <define name="payload" combine="choice">
    <attribute name="type">
      <value>revoke</value>
    </attribute>
    <ref name="revoke_request"/>
  </define>
  <define name="payload" combine="choice">
    <attribute name="type">
      <value>revoke_response</value>
    </attribute>
    <ref name="revoke_response"/>
  </define>
  <define name="payload" combine="choice">
    <attribute name="type">
      <value>error_response</value>
    </attribute>
    <ref name="error_response"/>
  </define>
  <define name="list_request">
    <empty/>
  </define>
  <define name="list_response">
    <zeroOrMore>
      <ref name="class"/>
    </zeroOrMore>
  </define>
  <define name="class">
    <element name="class">
      <attribute name="class_name">
        <ref name="class_name"/>
      </attribute>
      <attribute name="cert_url">
        <ref name="cert_url"/>
      </attribute>
      <attribute name="resource_set_as">
        <ref name="resource_set_as"/>
      </attribute>
      <attribute name="resource_set_ipv4">
        <ref name="resource_set_ip4"/>
      </attribute>
      <attribute name="resource_set_ipv6">
        <ref name="resource_set_ip6"/>
      </attribute>
      <attribute name="resource_set_notafter">
        <data type="dateTime"/>
      </attribute>
      <optional>
        <attribute name="suggested_sia_head">
          <data type="anyURI">
            <param name="maxLength">1024</param>
            <param name="pattern">rsync://.+</param>
          </data>
        </attribute>
      </optional>
      <zeroOrMore>
        <element name="certificate">
          <attribute name="cert_url">
            <ref name="cert_url"/>
          </attribute>
          <optional>
            <attribute name="req_resource_set_as">
              <ref name="resource_set_as"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="req_resource_set_ipv4">
              <ref name="resource_set_ip4"/>
            </attribute>
          </optional>
          <optional>
            <attribute name="req_resource_set_ipv6">
              <ref name="resource_set_ip6"/>
            </attribute>
          </optional>
          <ref name="base64_binary"/>
        </element>
      </zeroOrMore>
      <element name="issuer">
        <ref name="base64_binary"/>
      </element>
    </element>
  </define>
  <define name="issue_request">
    <element name="request">
      <attribute name="class_name">
        <ref name="class_name"/>
      </attribute>
      <optional>
        <attribute name="req_resource_set_as">
          <ref name="resource_set_as"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="req_resource_set_ipv4">
          <ref name="resource_set_ip4"/>
        </attribute>
      </optional>
      <optional>
        <attribute name="req_resource_set_ipv6">
          <ref name="resource_set_ip6"/>
        </attribute>
      </optional>
      <ref name="base64_binary"/>
    </element>
  </define>
  <define name="issue_response">
    <ref name="class"/>
  </define>
  <define name="revoke_request">
    <ref name="revocation"/>
  </define>
  <define name="revoke_response">
    <ref name="revocation"/>
  </define>
  <define name="revocation">
    <element name="key">
      <attribute name="class_name">
        <ref name="class_name"/>
      </attribute>
      <attribute name="ski">
        <ref name="ski"/>
      </attribute>
    </element>
  </define>
  <define name="error_response">
    <element name="status">
      <data type="positiveInteger">
        <param name="maxInclusive">9999</param>
      </data>
    </element>
    <zeroOrMore>
      <element name="description">
        <attribute name="xml:lang">
          <data type="language"/>
        </attribute>
        <data type="string">
          <param name="maxLength">1024</param>
        </data>
      </element>
    </zeroOrMore>
  </define>
</grammar>
<!--
  Local Variables:
  indent-tabs-mode: nil
  comment-start: "# "
  comment-start-skip: "#[ \t]*"
  End:
-->