zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] eolivelli commented on a change in pull request #1049: ZOOKEEPER-3475 Enable Checkstyle configuration on zookeeper-server
Date Thu, 15 Aug 2019 16:40:07 GMT
eolivelli commented on a change in pull request #1049: ZOOKEEPER-3475 Enable Checkstyle configuration
on zookeeper-server
URL: https://github.com/apache/zookeeper/pull/1049#discussion_r314395393
 
 

 ##########
 File path: zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumSSLTest.java
 ##########
 @@ -318,49 +303,36 @@ public X509Certificate buildEndEntityCert(KeyPair keyPair, X509Certificate
caCer
             generalNames.add(new GeneralName(GeneralName.iPAddress, ipAddress));
         }
 
-        SubjectPublicKeyInfo entityKeyInfo =
-                SubjectPublicKeyInfoFactory.createSubjectPublicKeyInfo(PublicKeyFactory.createKey(keyPair.getPublic()
-                        .getEncoded()));
+        SubjectPublicKeyInfo entityKeyInfo = SubjectPublicKeyInfoFactory.createSubjectPublicKeyInfo(PublicKeyFactory.createKey(keyPair.getPublic().getEncoded()));
         X509ExtensionUtils extensionUtils = new BcX509ExtensionUtils();
-        X509v3CertificateBuilder certificateBuilder =
-                new JcaX509v3CertificateBuilder(holder.getSubject(), new BigInteger(128,
new Random()),
-                    certStartTime, certEndTime, new X500Name("CN=Test End Entity Certificate"),
keyPair.getPublic())
-                .addExtension(Extension.authorityKeyIdentifier, false,
-                        extensionUtils.createAuthorityKeyIdentifier(holder))
-                .addExtension(Extension.subjectKeyIdentifier, false,
-                        extensionUtils.createSubjectKeyIdentifier(entityKeyInfo))
-                .addExtension(Extension.basicConstraints, true, new BasicConstraints(false))
-                .addExtension(Extension.keyUsage, true,
-                        new KeyUsage(KeyUsage.digitalSignature | KeyUsage.keyEncipherment));
+        X509v3CertificateBuilder certificateBuilder = new JcaX509v3CertificateBuilder(holder.getSubject(),
new BigInteger(128, new Random()), certStartTime, certEndTime, new X500Name("CN=Test End Entity
Certificate"), keyPair.getPublic()).addExtension(Extension.authorityKeyIdentifier, false,
extensionUtils.createAuthorityKeyIdentifier(holder)).addExtension(Extension.subjectKeyIdentifier,
false, extensionUtils.createSubjectKeyIdentifier(entityKeyInfo)).addExtension(Extension.basicConstraints,
true, new BasicConstraints(false)).addExtension(Extension.keyUsage, true, new KeyUsage(KeyUsage.digitalSignature
+                                                                                        
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                                                         
                                                     | KeyUsage.keyEncipherment));
 
         if (!generalNames.isEmpty()) {
-            certificateBuilder.addExtension(Extension.subjectAlternativeName,  true,
-                    new GeneralNames(generalNames.toArray(new GeneralName[] {})));
+            certificateBuilder.addExtension(Extension.subjectAlternativeName, true, new GeneralNames(generalNames.toArray(new
GeneralName[]{})));
         }
 
         if (crlPath != null) {
-            DistributionPointName distPointOne = new DistributionPointName(new GeneralNames(
-                    new GeneralName(GeneralName.uniformResourceIdentifier,"file://" + crlPath)));
+            DistributionPointName distPointOne = new DistributionPointName(new GeneralNames(new
GeneralName(GeneralName.uniformResourceIdentifier,
+                                                                                        
                   "file://"
+                                                                                        
                           + crlPath)));
 
-            certificateBuilder.addExtension(Extension.cRLDistributionPoints, false,
-                    new CRLDistPoint(new DistributionPoint[] {
-                            new DistributionPoint(distPointOne, null, null)
-                    }));
+            certificateBuilder.addExtension(Extension.cRLDistributionPoints, false, new CRLDistPoint(new
DistributionPoint[]{new DistributionPoint(distPointOne, null, null)}));
         }
 
         if (ocspPort != null) {
-            certificateBuilder.addExtension(Extension.authorityInfoAccess, false,
-                    new AuthorityInformationAccess(X509ObjectIdentifiers.ocspAccessMethod,
-                    new GeneralName(GeneralName.uniformResourceIdentifier, "http://" + hostname
+ ":" + ocspPort)));
+            certificateBuilder.addExtension(Extension.authorityInfoAccess, false, new AuthorityInformationAccess(X509ObjectIdentifiers.ocspAccessMethod,
new GeneralName(
+                    GeneralName.uniformResourceIdentifier, "http://"
+                                                                   + hostname
 
 Review comment:
   it is worth reverting

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message