| OLD | NEW |
| 1 /* crypto/ecdh/ech_lib.c */ | 1 /* crypto/ecdh/ech_lib.c */ |
| 2 /* ==================================================================== | 2 /* ==================================================================== |
| 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. | 3 * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED. |
| 4 * | 4 * |
| 5 * The Elliptic Curve Public-Key Crypto Library (ECC Code) included | 5 * The Elliptic Curve Public-Key Crypto Library (ECC Code) included |
| 6 * herein is developed by SUN MICROSYSTEMS, INC., and is contributed | 6 * herein is developed by SUN MICROSYSTEMS, INC., and is contributed |
| 7 * to the OpenSSL project. | 7 * to the OpenSSL project. |
| 8 * | 8 * |
| 9 * The ECC Code is licensed pursuant to the OpenSSL open source | 9 * The ECC Code is licensed pursuant to the OpenSSL open source |
| 10 * license provided below. | 10 * license provided below. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 const ECDH_METHOD *ECDH_get_default_method(void) | 90 const ECDH_METHOD *ECDH_get_default_method(void) |
| 91 { | 91 { |
| 92 if(!default_ECDH_method) | 92 if(!default_ECDH_method) |
| 93 default_ECDH_method = ECDH_OpenSSL(); | 93 default_ECDH_method = ECDH_OpenSSL(); |
| 94 return default_ECDH_method; | 94 return default_ECDH_method; |
| 95 } | 95 } |
| 96 | 96 |
| 97 int ECDH_set_method(EC_KEY *eckey, const ECDH_METHOD *meth) | 97 int ECDH_set_method(EC_KEY *eckey, const ECDH_METHOD *meth) |
| 98 { | 98 { |
| 99 const ECDH_METHOD *mtmp; | |
| 100 ECDH_DATA *ecdh; | 99 ECDH_DATA *ecdh; |
| 101 | 100 |
| 102 ecdh = ecdh_check(eckey); | 101 ecdh = ecdh_check(eckey); |
| 103 | 102 |
| 104 if (ecdh == NULL) | 103 if (ecdh == NULL) |
| 105 return 0; | 104 return 0; |
| 106 | 105 |
| 106 #if 0 |
| 107 mtmp = ecdh->meth; | 107 mtmp = ecdh->meth; |
| 108 #if 0 | |
| 109 if (mtmp->finish) | 108 if (mtmp->finish) |
| 110 mtmp->finish(eckey); | 109 mtmp->finish(eckey); |
| 111 #endif | 110 #endif |
| 112 #ifndef OPENSSL_NO_ENGINE | 111 #ifndef OPENSSL_NO_ENGINE |
| 113 if (ecdh->engine) | 112 if (ecdh->engine) |
| 114 { | 113 { |
| 115 ENGINE_finish(ecdh->engine); | 114 ENGINE_finish(ecdh->engine); |
| 116 ecdh->engine = NULL; | 115 ecdh->engine = NULL; |
| 117 } | 116 } |
| 118 #endif | 117 #endif |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 237 } |
| 239 | 238 |
| 240 void *ECDH_get_ex_data(EC_KEY *d, int idx) | 239 void *ECDH_get_ex_data(EC_KEY *d, int idx) |
| 241 { | 240 { |
| 242 ECDH_DATA *ecdh; | 241 ECDH_DATA *ecdh; |
| 243 ecdh = ecdh_check(d); | 242 ecdh = ecdh_check(d); |
| 244 if (ecdh == NULL) | 243 if (ecdh == NULL) |
| 245 return NULL; | 244 return NULL; |
| 246 return(CRYPTO_get_ex_data(&ecdh->ex_data,idx)); | 245 return(CRYPTO_get_ex_data(&ecdh->ex_data,idx)); |
| 247 } | 246 } |
| OLD | NEW |