CH-J Tools MobileSSH를 통한 서버 관리
메뉴
공개된 소스

CH-J Tools Mobile

특정 애플리케이션 릴리스의 디렉터리와 파일을 살펴보세요.

소스 ZIP 다운로드
CH-J / CH-J Tools Mobile 175 개 파일
sm-mobile-20261016T185235Z-8e93ecc1b59a 추가됨: · 빌드됨:
host_verifier.dart 추가됨: 날짜 기록 없음 913 B · 32 줄
코드 파일 다운로드
1import '../core/failure.dart';
2import 'vault.dart';
4typedef TrustPrompt =
5 Future<bool> Function(String endpoint, String type, String fingerprint);
7class HostVerifier {
8 final Vault vault;
9 HostVerifier(this.vault);
10 Future<bool> verify(
11 String endpoint,
12 String type,
13 String fingerprint,
14 TrustPrompt prompt,
15 ) async {
16 if (!RegExp(r'^SHA256:[A-Za-z0-9+/]{43}$').hasMatch(fingerprint)) {
17 throw const Failure('hostRejected');
18 }
19 final epoch = vault.generation;
20 final previous = vault.fingerprint(endpoint);
21 if (previous != null) {
22 if (previous != fingerprint) throw const Failure('hostChanged');
23 return true;
24 }
25 if (!await prompt(endpoint, type, fingerprint)) {
26 throw const Failure('hostRejected');
27 }
28 if (epoch != vault.generation) throw const Failure('locked');
29 await vault.trust(endpoint, fingerprint);
30 return true;
31 }
SHA-256abd25d6bc94824a18c99bac9cd4646d347dd37a381d02b27b852b44f69b2117d

CH-J Proprietary Software License 1.14 · 소스는 CH-J Proprietary Software License 1.14에 따라 제공됩니다. 소스를 공개한다고 해서 라이선스 조항이 바뀌거나 추가 권리가 부여되지는 않습니다.

압축 파일 SHA-25646e427a43e87af091004f36145590bda8fe90086dfb0f631afeb5029fb0b5655
파일