mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-12-23 00:51:01 +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) {
|
if (user == null && autoReg) {
|
||||||
AuthHookManager.RegContext context = new AuthHookManager.RegContext(login, ((AuthPlainPassword) password).password, ip, false);
|
AuthHookManager.RegContext context = new AuthHookManager.RegContext(login, ((AuthPlainPassword) password).password, ip, false);
|
||||||
if (srv.authHookManager.registraion.hook(context)) {
|
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 {
|
} else {
|
||||||
throw new AuthException("Registration canceled. Try again later");
|
throw new AuthException("Registration canceled. Try again later");
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ public Path process(Path inputFile) throws IOException {
|
||||||
new X500Name("CN=ca"),
|
new X500Name("CN=ca"),
|
||||||
SubjectPublicKeyInfo.getInstance(server.publicKey.getEncoded()));
|
SubjectPublicKeyInfo.getInstance(server.publicKey.getEncoded()));
|
||||||
builder.addExtension(Extension.extendedKeyUsage, false, new ExtendedKeyUsage(KeyPurposeId.id_kp_codeSigning));
|
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");
|
JcaContentSignerBuilder csBuilder = new JcaContentSignerBuilder("SHA256WITHECDSA");
|
||||||
ContentSigner signer = csBuilder.build(server.privateKey);
|
ContentSigner signer = csBuilder.build(server.privateKey);
|
||||||
bcCertificate = builder.build(signer);
|
bcCertificate = builder.build(signer);
|
||||||
|
|
|
@ -87,7 +87,7 @@ public X509Certificate[] getTrusted() {
|
||||||
|
|
||||||
public void isCertificateCodeSign(X509Certificate certificate)
|
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;
|
List<String> extended;
|
||||||
try {
|
try {
|
||||||
extended = certificate.getExtendedKeyUsage();
|
extended = certificate.getExtendedKeyUsage();
|
||||||
|
|
Loading…
Reference in a new issue