Skip to content

Commit

Permalink
ASN1: #to_der in pure ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
HoneyryderChuck committed Jul 17, 2024
1 parent c959729 commit e92f837
Show file tree
Hide file tree
Showing 2 changed files with 429 additions and 8 deletions.
11 changes: 7 additions & 4 deletions ext/openssl/ossl_asn1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,7 @@ Init_ossl_asn1(void)
* puts int2.value # => 1
*/
cASN1Data = rb_define_class_under(mASN1, "ASN1Data", rb_cObject);
rb_define_method(cASN1Data, "to_der", ossl_asn1data_to_der, 0);
// rb_define_method(cASN1Data, "to_der", ossl_asn1data_to_der, 0);

/* Document-class: OpenSSL::ASN1::Primitive
*
Expand Down Expand Up @@ -1590,7 +1590,7 @@ Init_ossl_asn1(void)
* prim_zero_tagged_explicit = <class>.new(value, 0, :EXPLICIT)
*/
cASN1Primitive = rb_define_class_under(mASN1, "Primitive", cASN1Data);
rb_define_method(cASN1Primitive, "to_der", ossl_asn1prim_to_der, 0);
// rb_define_method(cASN1Primitive, "to_der", ossl_asn1prim_to_der, 0);

/* Document-class: OpenSSL::ASN1::Constructive
*
Expand Down Expand Up @@ -1620,7 +1620,7 @@ Init_ossl_asn1(void)
* set = OpenSSL::ASN1::Set.new( [ int, str ] )
*/
cASN1Constructive = rb_define_class_under(mASN1,"Constructive", cASN1Data);
rb_define_method(cASN1Constructive, "to_der", ossl_asn1cons_to_der, 0);
// rb_define_method(cASN1Constructive, "to_der", ossl_asn1cons_to_der, 0);

#define OSSL_ASN1_DEFINE_CLASS(name, super) \
do{\
Expand Down Expand Up @@ -1670,7 +1670,10 @@ do{\
rb_define_alias(cASN1ObjectId, "long_name", "ln");
rb_define_method(cASN1ObjectId, "==", ossl_asn1obj_eq, 1);

rb_define_method(cASN1EndOfContent, "to_der", ossl_asn1eoc_to_der, 0);
// rb_define_method(cASN1EndOfContent, "to_der", ossl_asn1eoc_to_der, 0);
rb_define_method(cASN1ObjectId, "to_der", ossl_asn1prim_to_der, 0);
rb_define_method(cASN1UTCTime, "to_der", ossl_asn1prim_to_der, 0);
rb_define_method(cASN1GeneralizedTime, "to_der", ossl_asn1prim_to_der, 0);

class_tag_map = rb_hash_new();
rb_hash_aset(class_tag_map, cASN1EndOfContent, INT2NUM(V_ASN1_EOC));
Expand Down
Loading

0 comments on commit e92f837

Please sign in to comment.