Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: openssl/crypto/dsa/dsa_sign.c

Issue 9254031: Upgrade chrome's OpenSSL to same version Android ships with. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/openssl/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « openssl/crypto/dsa/dsa_prn.c ('k') | openssl/crypto/dsa/dsa_utl.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* crypto/dsa/dsa_sign.c */ 1 /* crypto/dsa/dsa_sign.c */
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 *
5 * This package is an SSL implementation written 5 * This package is an SSL implementation written
6 * by Eric Young (eay@cryptsoft.com). 6 * by Eric Young (eay@cryptsoft.com).
7 * The implementation was written so as to conform with Netscapes SSL. 7 * The implementation was written so as to conform with Netscapes SSL.
8 * 8 *
9 * This library is free for commercial and non-commercial use as long as 9 * This library is free for commercial and non-commercial use as long as
10 * the following conditions are aheared to. The following conditions 10 * the following conditions are aheared to. The following conditions
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 * SUCH DAMAGE. 51 * SUCH DAMAGE.
52 * 52 *
53 * The licence and distribution terms for any publically available version or 53 * The licence and distribution terms for any publically available version or
54 * derivative of this code cannot be changed. i.e. this code cannot simply be 54 * derivative of this code cannot be changed. i.e. this code cannot simply be
55 * copied and put under another distribution licence 55 * copied and put under another distribution licence
56 * [including the GNU Public Licence.] 56 * [including the GNU Public Licence.]
57 */ 57 */
58 58
59 /* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */ 59 /* Original version from Steven Schoch <schoch@sheba.arc.nasa.gov> */
60 60
61 #include <stdio.h>
62 #include "cryptlib.h" 61 #include "cryptlib.h"
63 #include <openssl/bn.h>
64 #include <openssl/dsa.h> 62 #include <openssl/dsa.h>
65 #include <openssl/rand.h> 63 #include <openssl/rand.h>
66 #include <openssl/asn1.h>
67 #ifdef OPENSSL_FIPS
68 #include <openssl/fips.h>
69 #endif
70
71 64
72 DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa) 65 DSA_SIG * DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa)
73 { 66 {
74 #ifdef OPENSSL_FIPS 67 » return dsa->meth->dsa_do_sign(dgst, dlen, dsa);
75 » if(FIPS_mode() && !(dsa->flags & DSA_FLAG_NON_FIPS_ALLOW)) 68 » }
69
70 int DSA_sign(int type, const unsigned char *dgst, int dlen, unsigned char *sig,
71 » unsigned int *siglen, DSA *dsa)
72 » {
73 » DSA_SIG *s;
74 » RAND_seed(dgst, dlen);
75 » s=DSA_do_sign(dgst,dlen,dsa);
76 » if (s == NULL)
76 { 77 {
77 » » DSAerr(DSA_F_DSA_DO_SIGN, DSA_R_OPERATION_NOT_ALLOWED_IN_FIPS_MO DE); 78 » » *siglen=0;
78 » » return NULL; 79 » » return(0);
79 } 80 }
80 #endif 81 » *siglen=i2d_DSA_SIG(s,&sig);
81 » return dsa->meth->dsa_do_sign(dgst, dlen, dsa); 82 » DSA_SIG_free(s);
83 » return(1);
82 } 84 }
83 85
84 int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) 86 int DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp)
85 { 87 {
86 #ifdef OPENSSL_FIPS
87 if(FIPS_mode() && !(dsa->flags & DSA_FLAG_NON_FIPS_ALLOW))
88 {
89 DSAerr(DSA_F_DSA_SIGN_SETUP, DSA_R_OPERATION_NOT_ALLOWED_IN_FIPS _MODE);
90 return 0;
91 }
92 #endif
93 return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp); 88 return dsa->meth->dsa_sign_setup(dsa, ctx_in, kinvp, rp);
94 } 89 }
95 90
OLDNEW
« no previous file with comments | « openssl/crypto/dsa/dsa_prn.c ('k') | openssl/crypto/dsa/dsa_utl.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698