File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -112,14 +112,10 @@ func SHA3_512(p []byte) (sum [64]byte) {
112
112
}
113
113
114
114
var isMarshallableCache sync.Map
115
- var testNotMarshalable bool // Used in tests.
116
115
117
116
// isHashMarshallable returns true if the memory layout of cb
118
117
// is known by this library and can therefore be marshalled.
119
118
func isHashMarshallable (ch crypto.Hash ) bool {
120
- if testNotMarshalable {
121
- return false
122
- }
123
119
if vMajor == 1 {
124
120
return true
125
121
}
@@ -235,12 +231,14 @@ func (h *evpHash) sum(out []byte) {
235
231
runtime .KeepAlive (h )
236
232
}
237
233
234
+ var testNotMarshalable bool // Used in tests.
235
+
238
236
// hashState returns a pointer to the internal hash structure.
239
237
//
240
238
// The EVP_MD_CTX memory layout has changed in OpenSSL 3
241
239
// and the property holding the internal structure is no longer md_data but algctx.
242
240
func (h * evpHash ) hashState () unsafe.Pointer {
243
- if ! h .marshallable {
241
+ if ! h .marshallable || testNotMarshalable {
244
242
return nil
245
243
}
246
244
switch vMajor {
You can’t perform that action at this time.
0 commit comments