File tree Expand file tree Collapse file tree 2 files changed +24
-24
lines changed Expand file tree Collapse file tree 2 files changed +24
-24
lines changed Original file line number Diff line number Diff line change @@ -136,13 +136,7 @@ static LUA_FUNCTION(openssl_pkcs7_set_content)
136
136
PKCS7 * p7 = CHECK_OBJECT (1 , PKCS7 , "openssl.pkcs7" );
137
137
PKCS7 * content = CHECK_OBJECT (2 , PKCS7 , "openssl.pkcs7" );
138
138
139
- int ret = PKCS7_set_content (p7 , content );
140
- if (ret == 1 )
141
- {
142
- lua_pushvalue (L , 1 );
143
- lua_pushvalue (L , 2 );
144
- lua_rawset (L , LUA_REGISTRYINDEX );
145
- }
139
+ int ret = PKCS7_set_content (p7 , PKCS7_dup (content ));
146
140
return openssl_pushresult (L , ret );
147
141
}
148
142
Original file line number Diff line number Diff line change @@ -63,27 +63,33 @@ function TestPKCS7:testNew()
63
63
der = assert (p7 :export ())
64
64
assert (openssl .pkcs7 .read (der , ' auto' ))
65
65
66
- if helper .openssl3 then
67
- -- p7 = openssl.pkcs7.create({
68
- -- ca.cacert,
69
- -- cert
70
- -- }, {ca.crl})
71
- -- assert(p7:parse())
72
- -- assert(p7:export())
73
-
74
- -- assert(p7:export('der'))
75
- else
76
- p7 = openssl .pkcs7 .new ()
77
- p7 :add (ca .cacert )
78
- p7 :add (cert )
79
- p7 :add (ca .crl )
66
+ local p = openssl .pkcs7 .new ()
67
+ p :add (ca .cacert )
68
+ p :add (cert )
69
+ p :add (ca .crl )
70
+ assert (p :parse ())
71
+ assert (p :export ())
72
+
73
+ -- FIXME: illegal zero content
74
+ assert (p :export (' der' ))
75
+ local ln , sn = p :type ()
76
+ assert (ln )
77
+ assert (sn )
78
+
79
+ p7 = openssl .pkcs7 .create ({
80
+ ca .cacert ,
81
+ cert
82
+ }, {ca .crl })
80
83
assert (p7 :parse ())
81
84
assert (p7 :export ())
82
85
83
- assert ( p7 : export ( ' der ' ))
84
- end
86
+ -- TODO: enable below
87
+ -- p7:set_content(p)
85
88
86
- local ln , sn = p7 :type ()
89
+ -- FIXME: illegal zero content
90
+ -- assert(p7:export('der'))
91
+ ln , sn = p7 :type ()
87
92
assert (ln )
88
93
assert (sn )
94
+
89
95
end
You can’t perform that action at this time.
0 commit comments