зеркало из https://github.com/github/ruby.git
* ext/openssl/ossl_bn.c: More documentation.
* ext/openssl/lib/ossl_{pkey,pkey_ec}.[ch]: Add elliptic curves. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
eed46ac633
Коммит
8b95ee24de
|
@ -1,3 +1,8 @@
|
||||||
|
Tue Apr 3 02:48:48 2007 Technorama <oss-ruby@technorama.net>
|
||||||
|
* ext/openssl/ossl_bn.c: More documentation.
|
||||||
|
|
||||||
|
* ext/openssl/lib/ossl_{pkey,pkey_ec}.[ch]: Add elliptic curves.
|
||||||
|
|
||||||
Tue Apr 3 15:50:41 2007 NAKAMURA Usaku <usa@ruby-lang.org>
|
Tue Apr 3 15:50:41 2007 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* ext/socket/socket.c (s_recv, s_recvfrom): some systems (such as
|
* ext/socket/socket.c (s_recv, s_recvfrom): some systems (such as
|
||||||
|
|
|
@ -40,7 +40,7 @@ VALUE eBNError;
|
||||||
* Public
|
* Public
|
||||||
*/
|
*/
|
||||||
VALUE
|
VALUE
|
||||||
ossl_bn_new(BIGNUM *bn)
|
ossl_bn_new(const BIGNUM *bn)
|
||||||
{
|
{
|
||||||
BIGNUM *newbn;
|
BIGNUM *newbn;
|
||||||
VALUE obj;
|
VALUE obj;
|
||||||
|
@ -100,6 +100,12 @@ ossl_bn_alloc(VALUE klass)
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* call-seq:
|
||||||
|
* BN.new => aBN
|
||||||
|
* BN.new(bn) => aBN
|
||||||
|
* BN.new(string, 0 | 2 | 10 | 16) => aBN
|
||||||
|
*/
|
||||||
static VALUE
|
static VALUE
|
||||||
ossl_bn_initialize(int argc, VALUE *argv, VALUE self)
|
ossl_bn_initialize(int argc, VALUE *argv, VALUE self)
|
||||||
{
|
{
|
||||||
|
@ -189,6 +195,10 @@ ossl_bn_to_s(int argc, VALUE *argv, VALUE self)
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* call-seq:
|
||||||
|
* bn.to_i => integer
|
||||||
|
*/
|
||||||
static VALUE
|
static VALUE
|
||||||
ossl_bn_to_i(VALUE self)
|
ossl_bn_to_i(VALUE self)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,9 +14,12 @@
|
||||||
extern VALUE cBN;
|
extern VALUE cBN;
|
||||||
extern VALUE eBNError;
|
extern VALUE eBNError;
|
||||||
|
|
||||||
VALUE ossl_bn_new(BIGNUM *);
|
extern BN_CTX *ossl_bn_ctx;
|
||||||
|
|
||||||
|
VALUE ossl_bn_new(const BIGNUM *);
|
||||||
BIGNUM *GetBNPtr(VALUE);
|
BIGNUM *GetBNPtr(VALUE);
|
||||||
void Init_ossl_bn(void);
|
void Init_ossl_bn(void);
|
||||||
|
|
||||||
|
|
||||||
#endif /* _OSS_BN_H_ */
|
#endif /* _OSS_BN_H_ */
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,10 @@ ossl_pkey_new(EVP_PKEY *pkey)
|
||||||
#if !defined(OPENSSL_NO_DH)
|
#if !defined(OPENSSL_NO_DH)
|
||||||
case EVP_PKEY_DH:
|
case EVP_PKEY_DH:
|
||||||
return ossl_dh_new(pkey);
|
return ossl_dh_new(pkey);
|
||||||
|
#endif
|
||||||
|
#if !defined(OPENSSL_NO_EC) && (OPENSSL_VERSION_NUMBER >= 0x0090802fL)
|
||||||
|
case EVP_PKEY_EC:
|
||||||
|
return ossl_ec_new(pkey);
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
ossl_raise(ePKeyError, "unsupported key type");
|
ossl_raise(ePKeyError, "unsupported key type");
|
||||||
|
@ -226,10 +230,11 @@ Init_ossl_pkey()
|
||||||
id_private_q = rb_intern("private?");
|
id_private_q = rb_intern("private?");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* INIT rsa, dsa
|
* INIT rsa, dsa, dh, ec
|
||||||
*/
|
*/
|
||||||
Init_ossl_rsa();
|
Init_ossl_rsa();
|
||||||
Init_ossl_dsa();
|
Init_ossl_dsa();
|
||||||
Init_ossl_dh();
|
Init_ossl_dh();
|
||||||
|
Init_ossl_ec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -77,6 +77,19 @@ extern DH *OSSL_DEFAULT_DH_1024;
|
||||||
VALUE ossl_dh_new(EVP_PKEY *);
|
VALUE ossl_dh_new(EVP_PKEY *);
|
||||||
void Init_ossl_dh(void);
|
void Init_ossl_dh(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* EC
|
||||||
|
*/
|
||||||
|
extern VALUE cEC;
|
||||||
|
extern VALUE eECError;
|
||||||
|
extern VALUE cEC_GROUP;
|
||||||
|
extern VALUE eEC_GROUP;
|
||||||
|
extern VALUE cEC_POINT;
|
||||||
|
extern VALUE eEC_POINT;
|
||||||
|
VALUE ossl_ec_new(EVP_PKEY *);
|
||||||
|
void Init_ossl_ec(void);
|
||||||
|
|
||||||
|
|
||||||
#define OSSL_PKEY_BN(keytype, name) \
|
#define OSSL_PKEY_BN(keytype, name) \
|
||||||
/* \
|
/* \
|
||||||
* call-seq: \
|
* call-seq: \
|
||||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -493,7 +493,6 @@ ossl_rsa_to_public_key(VALUE self)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO: Test me
|
* TODO: Test me
|
||||||
extern BN_CTX *ossl_bn_ctx;
|
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
ossl_rsa_blinding_on(VALUE self)
|
ossl_rsa_blinding_on(VALUE self)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче