private void checkSignature(SignableVertexSpec vertex, ByteString vertexBinary, SubmitWorkRequestProto request, String tokenUserName) throws SecurityException, IOException { if (!request.hasWorkSpecSignature()) { logSecurityErrorRarely(tokenUserName); throw new SecurityException("Unsigned fragment not allowed"); } if (vertexBinary == null) { ByteString.Output os = ByteString.newOutput(); vertex.writeTo(os); vertexBinary = os.toByteString(); } try { signer.checkSignature(vertexBinary.toByteArray(), request.getWorkSpecSignature().toByteArray(), (int)vertex.getSignatureKeyId()); } catch (SecurityException ex) { logSecurityErrorRarely(tokenUserName); throw ex; } if (!vertex.hasUser() || !vertex.getUser().equals(tokenUserName)) { logSecurityErrorRarely(tokenUserName); throw new SecurityException("LLAP token is for " + tokenUserName + " but the fragment is for " + (vertex.hasUser() ? vertex.getUser() : null)); } }
hash = (53 * hash) + getWorkSpecSignature().hashCode();
result = result && getWorkSpecSignature() .equals(other.getWorkSpecSignature());
private void checkSignature(SignableVertexSpec vertex, ByteString vertexBinary, SubmitWorkRequestProto request, String tokenUserName) throws SecurityException, IOException { if (!request.hasWorkSpecSignature()) { logSecurityErrorRarely(tokenUserName); throw new SecurityException("Unsigned fragment not allowed"); } if (vertexBinary == null) { ByteString.Output os = ByteString.newOutput(); vertex.writeTo(os); vertexBinary = os.toByteString(); } try { signer.checkSignature(vertexBinary.toByteArray(), request.getWorkSpecSignature().toByteArray(), (int)vertex.getSignatureKeyId()); } catch (SecurityException ex) { logSecurityErrorRarely(tokenUserName); throw ex; } if (!vertex.hasUser() || !vertex.getUser().equals(tokenUserName)) { logSecurityErrorRarely(tokenUserName); throw new SecurityException("LLAP token is for " + tokenUserName + " but the fragment is for " + (vertex.hasUser() ? vertex.getUser() : null)); } }
setWorkSpecSignature(other.getWorkSpecSignature());
/** * <code>optional bytes work_spec_signature = 2;</code> */ public Builder clearWorkSpecSignature() { bitField0_ = (bitField0_ & ~0x00000002); workSpecSignature_ = getDefaultInstance().getWorkSpecSignature(); onChanged(); return this; }