mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-22 16:41:46 +03:00
[FIX] Autogen Certificate
This commit is contained in:
parent
43e1533c87
commit
96930cbce3
3 changed files with 3 additions and 3 deletions
|
@ -17,7 +17,7 @@ public AuthProviderResult auth(String login, AuthRequest.AuthPasswordInterface p
|
|||
if (user == null && autoReg) {
|
||||
AuthHookManager.RegContext context = new AuthHookManager.RegContext(login, ((AuthPlainPassword) password).password, ip, false);
|
||||
if (srv.authHookManager.registraion.hook(context)) {
|
||||
user = srv.config.dao.userService.registerNewUser(login, ((AuthPlainPassword) password).password);
|
||||
//user = srv.config.dao.userService.registerNewUser(login, ((AuthPlainPassword) password).password); //TODO: FIX
|
||||
} else {
|
||||
throw new AuthException("Registration canceled. Try again later");
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ public Path process(Path inputFile) throws IOException {
|
|||
new X500Name("CN=ca"),
|
||||
SubjectPublicKeyInfo.getInstance(server.publicKey.getEncoded()));
|
||||
builder.addExtension(Extension.extendedKeyUsage, false, new ExtendedKeyUsage(KeyPurposeId.id_kp_codeSigning));
|
||||
builder.addExtension(Extension.keyUsage, false, new KeyUsage(1));
|
||||
//builder.addExtension(Extension.keyUsage, false, new KeyUsage(1));
|
||||
JcaContentSignerBuilder csBuilder = new JcaContentSignerBuilder("SHA256WITHECDSA");
|
||||
ContentSigner signer = csBuilder.build(server.privateKey);
|
||||
bcCertificate = builder.build(signer);
|
||||
|
|
|
@ -87,7 +87,7 @@ public X509Certificate[] getTrusted() {
|
|||
|
||||
public void isCertificateCodeSign(X509Certificate certificate)
|
||||
{
|
||||
if(!certificate.getKeyUsage()[0]) throw new SecurityException("Certificate keyUsage \"digitalSignature\" check failed");
|
||||
//if(!certificate.getKeyUsage()[0]) throw new SecurityException("Certificate keyUsage \"digitalSignature\" check failed");
|
||||
List<String> extended;
|
||||
try {
|
||||
extended = certificate.getExtendedKeyUsage();
|
||||
|
|
Loading…
Reference in a new issue