File tree Expand file tree Collapse file tree
DnsServerCore/Dns/Security Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,19 +180,19 @@ public void Rotate()
180180 }
181181
182182 // Returning spans here is unsafe once the lock is released; return a clone instead.
183- public byte [ ] GetCurrentSecret ( )
183+ public ReadOnlySpan < byte > GetCurrentSecret ( )
184184 {
185185 lock ( _lock )
186186 {
187- return _currentSecret is null ? null : ( byte [ ] ) _currentSecret . Clone ( ) ;
187+ return _currentSecret is null ? null : new ReadOnlySpan < byte > ( _currentSecret ) ;
188188 }
189189 }
190190
191- public byte [ ] GetPreviousSecret ( )
191+ public ReadOnlySpan < byte > GetPreviousSecret ( )
192192 {
193193 lock ( _lock )
194194 {
195- return _previousSecret is null ? null : ( byte [ ] ) _previousSecret . Clone ( ) ;
195+ return _previousSecret is null ? null : new ReadOnlySpan < byte > ( _previousSecret ) ;
196196 }
197197 }
198198
You can’t perform that action at this time.
0 commit comments