From 5965124505ab1a1ba21a8a86bedbe17f5ce3da82 Mon Sep 17 00:00:00 2001 From: Wesley Miaw Date: Fri, 13 Apr 2018 10:02:56 -0700 Subject: [PATCH] Whitespace and variable name fixes. --- .../entityauth/EccAuthenticationFactory.java | 19 +++++++++---------- .../com/netflix/msl/entityauth/EccStore.java | 7 +++---- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/core/src/main/java/com/netflix/msl/entityauth/EccAuthenticationFactory.java b/core/src/main/java/com/netflix/msl/entityauth/EccAuthenticationFactory.java index 6b41f8de..9f25eb08 100644 --- a/core/src/main/java/com/netflix/msl/entityauth/EccAuthenticationFactory.java +++ b/core/src/main/java/com/netflix/msl/entityauth/EccAuthenticationFactory.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2016-2017 Netflix, Inc. All rights reserved. + * Copyright (c) 2016-2018 Netflix, Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ /** *

ECC asymmetric keys entity authentication factory.

- * */ public class EccAuthenticationFactory extends EntityAuthenticationFactory { /** @@ -79,29 +78,29 @@ public ICryptoContext getCryptoContext(final MslContext ctx, final EntityAuthent // Make sure we have the right kind of entity authentication data. if (!(authdata instanceof EccAuthenticationData)) throw new MslInternalException("Incorrect authentication data type " + authdata.getClass().getName() + "."); - final EccAuthenticationData rad = (EccAuthenticationData)authdata; + final EccAuthenticationData ead = (EccAuthenticationData)authdata; // Check for revocation. - final String identity = rad.getIdentity(); + final String identity = ead.getIdentity(); if (authutils.isEntityRevoked(identity)) - throw new MslEntityAuthException(MslError.ENTITY_REVOKED, "ecc" + identity).setEntityAuthenticationData(rad); + throw new MslEntityAuthException(MslError.ENTITY_REVOKED, "ecc" + identity).setEntityAuthenticationData(ead); // Verify the scheme is permitted. if (!authutils.isSchemePermitted(identity, getScheme())) - throw new MslEntityAuthException(MslError.INCORRECT_ENTITYAUTH_DATA, "Authentication Scheme for Device Type Not Supported " + identity + ":" + getScheme()).setEntityAuthenticationData(rad); + throw new MslEntityAuthException(MslError.INCORRECT_ENTITYAUTH_DATA, "Authentication Scheme for Device Type Not Supported " + identity + ":" + getScheme()).setEntityAuthenticationData(ead); // Extract ECC authentication data. - final String pubkeyid = rad.getPublicKeyId(); + final String pubkeyid = ead.getPublicKeyId(); final PublicKey publicKey = store.getPublicKey(pubkeyid); final PrivateKey privateKey = store.getPrivateKey(pubkeyid); // The local entity must have a private key. if (pubkeyid.equals(keyPairId) && privateKey == null) - throw new MslEntityAuthException(MslError.ECC_PRIVATEKEY_NOT_FOUND, pubkeyid).setEntityAuthenticationData(rad); + throw new MslEntityAuthException(MslError.ECC_PRIVATEKEY_NOT_FOUND, pubkeyid).setEntityAuthenticationData(ead); // Remote entities must have a public key. else if (!pubkeyid.equals(keyPairId) && publicKey == null) - throw new MslEntityAuthException(MslError.ECC_PUBLICKEY_NOT_FOUND, pubkeyid).setEntityAuthenticationData(rad); + throw new MslEntityAuthException(MslError.ECC_PUBLICKEY_NOT_FOUND, pubkeyid).setEntityAuthenticationData(ead); // Return the crypto context. return new EccCryptoContext(identity, privateKey, publicKey, Mode.SIGN_VERIFY); @@ -112,5 +111,5 @@ else if (!pubkeyid.equals(keyPairId) && publicKey == null) /** ECC key store. */ private final EccStore store; /** Authentication utilities. */ - final AuthenticationUtils authutils; + private final AuthenticationUtils authutils; } diff --git a/core/src/main/java/com/netflix/msl/entityauth/EccStore.java b/core/src/main/java/com/netflix/msl/entityauth/EccStore.java index b0886fc2..fd7f91d0 100644 --- a/core/src/main/java/com/netflix/msl/entityauth/EccStore.java +++ b/core/src/main/java/com/netflix/msl/entityauth/EccStore.java @@ -1,6 +1,6 @@ /** * Copyright (c) 2016 Netflix, Inc. All rights reserved. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -21,7 +21,6 @@ /** * An ECC public key store contains trusted ECC public and private keys. - * */ public interface EccStore { /** @@ -36,10 +35,10 @@ public interface EccStore { * @return the public key of the identified key pair or null if not found. */ public PublicKey getPublicKey(final String identity); - + /** * Return the private key of the identified ECC key pair. - * + * * @param identity ECC key pair identity. * @return the private key of the identified key pair or null if not found. */