Fetch secret from pass based on pass_path. If there is
    any error, return back the original pass_path value
502738
def _fetch_secret(pass_path):
    '''
    
    '''
    cmd = "pass show {0}".format(pass_path.strip())
    log.debug('Fetching secret: %s', cmd)

    proc = Popen(cmd.split(' '), stdout=PIPE, stderr=PIPE)
    pass_data, pass_error = proc.communicate()

    # The version of pass used during development sent output to
    # stdout instead of stderr even though its returncode was non zero.
    if proc.returncode or not pass_data:
        log.warning('Could not fetch secret: %s %s', pass_data, pass_error)
        pass_data = pass_path
    return pass_data.strip()
283170
def get_client_premaster_secret(self, password_hash, server_public, client_private, common_secret):
        
        password_verifier = self.get_common_password_verifier(password_hash)
        return pow(
            (server_public - (self._mult * password_verifier)),
            (client_private + (common_secret * password_hash)), self._prime)
93255
def __get_keys(self, name='master', passphrase=None):
        '''
        
        '''
        path = os.path.join(self.opts['pki_dir'],
                            name + '.pem')
        if not os.path.exists(path):
            log.info('Generating %s keys: %s', name, self.opts['pki_dir'])
            gen_keys(self.opts['pki_dir'],
                     name,
                     self.opts['keysize'],
                     self.opts.get('user'),
                     passphrase)
        if HAS_M2:
            key_error = RSA.RSAError
        else:
            key_error = ValueError
        try:
            key = get_rsa_key(path, passphrase)
        except key_error as e:
            message = 'Unable to read key: {0}; passphrase may be incorrect'.format(path)
            log.error(message)
            raise MasterExit(message)
        log.debug('Loaded %s key: %s', name, path)
        return key
466408
def __proxy_password(self):
        """"""
        passwd = copy(self._inp_proxy_password.value)
        self._inp_proxy_password.value = ''
        return passwd
212074
def decrypt_file(path, password=None):
    '''
    
    '''
    global PASSWORD_FILE
    if not password:
        password = PASSWORD_FILE
    if path and not os.path.isfile(path):
        raise SystemExit(_error_codes.get(106))
    query = 'openssl aes-128-cbc -d -salt -in {0} -out {1} -k {2}'
    with hide('output'):
        local(query.format(path, path + '.tar.gz', PASSWORD_FILE))
850827
private String getPathInfoforSecureloginlogout(String currentURI, String securityString) {
        String pathInfo = null;
        int lastIndex_Security = currentURI.lastIndexOf(securityString);
        String restURI = currentURI.substring(lastIndex_Security + securityString.length());

        if (restURI.equals(""))
            pathInfo = null;
        else
            pathInfo = restURI;
        return pathInfo;
    }
383175
def load_key(self, path):
        
        with open(path, 'r') as f:
            self.key = f.readline().strip()
            self.secret = f.readline().strip()
1037483
def GET(self, path):
        
        url = self._absolute_url(path)
        resp = requests.get(url, headers=self.headers, verify=self.verify_ssl)
        if resp.status_code != 200:
            raise MispTransportError('GET %s: returned status=%d', path, resp.status_code)
        return resp.content
421522
def role(name)
      json = client.get("/v1/auth/approle/role/#{encode_path(name)}")
      return Secret.decode(json)
    rescue HTTPError => e
      return nil if e.code == 404
      raise
    end
565691
def get_env_pass(self,user=None,msg=None,note=None):
		
		shutit = self.shutit
		shutit.handle_note(note)
		user = user or self.whoami()
		# cygwin does not have root
		pw = ''
		if self.current_environment.distro == 'cygwin':
			return pw
		if user not in self.current_environment.users.keys():
			self.current_environment.users.update({user:None})
		if not self.current_environment.users[user] and user != 'root':
			msg = msg or 'Please input the sudo password for user: ' + user
			pw = shutit_util.get_input(msg,ispass=True)
			self.current_environment.users[user] = pw
			shutit_global.shutit_global_object.secret_words_set.add(self.current_environment.users[user])
		return pw
412912
def getpass(self, prompt, default=None):
        """"""
        return click.prompt(prompt, hide_input=True, default=default)
904761
def _get_credentials():
    '''
    
    '''
    ret = {
        'user': False,
        'passwd': False
    }

    # Loop through opts, grains, and pillar
    # Return the first acceptable configuration found
    for item in ret:
        for struct in [__opts__, __grains__, __pillar__]:
            # Look for the config key
            # Support old-style config format and new
            for config_key in __valid_configs[item]:
                value = salt.utils.data.traverse_dict_and_list(
                    struct,
                    config_key,
                    None)
                if value:
                    ret[item] = value
                    break
    return ret['user'], ret['passwd']
554135
def get_key(fingerprint, secret = false)
      rkey = []
      err = GPGME::gpgme_get_key(self, fingerprint, rkey, secret ? 1 : 0)
      exc = GPGME::error_to_exception(err)
      raise exc if exc
      rkey[0]
    end
1298983
def sign_url_path(url, secret_key, expire_in=None, digest=None):
    # type: (str, bytes, int, Callable) -> str
    
    result = urlparse(url)
    query_args = MultiValueDict(parse_qs(result.query))
    query_args['_'] = token()
    if expire_in is not None:
        query_args['expires'] = int(time() + expire_in)
    query_args['signature'] = _generate_signature(result.path, secret_key, query_args, digest)
    return "%s?%s" % (result.path, urlencode(list(query_args.sorteditems(True))))
1335958
def load_secrets(self, secret_path):
        """"""
        self._config = p_config.render_secrets(self.config_path, secret_path)
406442
def netrc_path
      unencrypted = Netrc.default_path
      encrypted = unencrypted + '.gpg'
      if File.exists?(encrypted)
        encrypted
      else
        unencrypted
      end
    end
996137
def secret_loader(self, callback):
        
        if not callback or not callable(callback):
            raise Exception("Please pass in a callable that loads secret keys")
        self.secret_loader_callback = callback
        return callback