summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn/bn_blind.c
diff options
context:
space:
mode:
authordjm <>2010-10-01 22:59:01 +0000
committerdjm <>2010-10-01 22:59:01 +0000
commitfe047d8b632246cb2db3234a0a4f32e5c318857b (patch)
tree939b752540947d33507b3acc48d76a8bfb7c3dc3 /src/lib/libcrypto/bn/bn_blind.c
parent2ea67f4aa254b09ded62e6e14fc893bbe6381579 (diff)
downloadopenbsd-fe047d8b632246cb2db3234a0a4f32e5c318857b.tar.gz
openbsd-fe047d8b632246cb2db3234a0a4f32e5c318857b.tar.bz2
openbsd-fe047d8b632246cb2db3234a0a4f32e5c318857b.zip
resolve conflicts, fix local changes
Diffstat (limited to 'src/lib/libcrypto/bn/bn_blind.c')
-rw-r--r--src/lib/libcrypto/bn/bn_blind.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/lib/libcrypto/bn/bn_blind.c b/src/lib/libcrypto/bn/bn_blind.c
index c11fb4ccc2..e060592fdc 100644
--- a/src/lib/libcrypto/bn/bn_blind.c
+++ b/src/lib/libcrypto/bn/bn_blind.c
@@ -1,6 +1,6 @@
1/* crypto/bn/bn_blind.c */ 1/* crypto/bn/bn_blind.c */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
@@ -121,8 +121,11 @@ struct bn_blinding_st
121 BIGNUM *Ai; 121 BIGNUM *Ai;
122 BIGNUM *e; 122 BIGNUM *e;
123 BIGNUM *mod; /* just a reference */ 123 BIGNUM *mod; /* just a reference */
124#ifndef OPENSSL_NO_DEPRECATED
124 unsigned long thread_id; /* added in OpenSSL 0.9.6j and 0.9.7b; 125 unsigned long thread_id; /* added in OpenSSL 0.9.6j and 0.9.7b;
125 * used only by crypto/rsa/rsa_eay.c, rsa_lib.c */ 126 * used only by crypto/rsa/rsa_eay.c, rsa_lib.c */
127#endif
128 CRYPTO_THREADID tid;
126 unsigned int counter; 129 unsigned int counter;
127 unsigned long flags; 130 unsigned long flags;
128 BN_MONT_CTX *m_ctx; 131 BN_MONT_CTX *m_ctx;
@@ -131,7 +134,7 @@ struct bn_blinding_st
131 BN_MONT_CTX *m_ctx); 134 BN_MONT_CTX *m_ctx);
132 }; 135 };
133 136
134BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, /* const */ BIGNUM *mod) 137BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod)
135 { 138 {
136 BN_BLINDING *ret=NULL; 139 BN_BLINDING *ret=NULL;
137 140
@@ -158,6 +161,7 @@ BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, /* const */ BIGN
158 BN_set_flags(ret->mod, BN_FLG_CONSTTIME); 161 BN_set_flags(ret->mod, BN_FLG_CONSTTIME);
159 162
160 ret->counter = BN_BLINDING_COUNTER; 163 ret->counter = BN_BLINDING_COUNTER;
164 CRYPTO_THREADID_current(&ret->tid);
161 return(ret); 165 return(ret);
162err: 166err:
163 if (ret != NULL) BN_BLINDING_free(ret); 167 if (ret != NULL) BN_BLINDING_free(ret);
@@ -263,6 +267,7 @@ int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, BN_CTX *ct
263 return(ret); 267 return(ret);
264 } 268 }
265 269
270#ifndef OPENSSL_NO_DEPRECATED
266unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *b) 271unsigned long BN_BLINDING_get_thread_id(const BN_BLINDING *b)
267 { 272 {
268 return b->thread_id; 273 return b->thread_id;
@@ -272,6 +277,12 @@ void BN_BLINDING_set_thread_id(BN_BLINDING *b, unsigned long n)
272 { 277 {
273 b->thread_id = n; 278 b->thread_id = n;
274 } 279 }
280#endif
281
282CRYPTO_THREADID *BN_BLINDING_thread_id(BN_BLINDING *b)
283 {
284 return &b->tid;
285 }
275 286
276unsigned long BN_BLINDING_get_flags(const BN_BLINDING *b) 287unsigned long BN_BLINDING_get_flags(const BN_BLINDING *b)
277 { 288 {
@@ -284,7 +295,7 @@ void BN_BLINDING_set_flags(BN_BLINDING *b, unsigned long flags)
284 } 295 }
285 296
286BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, 297BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b,
287 const BIGNUM *e, /* const */ BIGNUM *m, BN_CTX *ctx, 298 const BIGNUM *e, BIGNUM *m, BN_CTX *ctx,
288 int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, 299 int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p,
289 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), 300 const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx),
290 BN_MONT_CTX *m_ctx) 301 BN_MONT_CTX *m_ctx)