'Authenticate component. Send handshake stanza and wait for result. Returns "ok" on success.'

def authComponent(self, owner):

    self.handshake = 0
    owner.send(Node((NS_COMPONENT_ACCEPT + '    handshake'), payload=[sha.new((owner.Dispatcher.Stream._document_attrs['id'] + self.password)).hexdigest()]))
    owner.RegisterHandler('handshake', self.handshakeHandler, xmlns=NS_COMPONENT_ACCEPT)
    while (not self.handshake):
        self.DEBUG('waiting    on    handshake', 'notify')
        owner.Process(1)
    owner._registered_name = self.user
    if (self.handshake + 1):
        return 'ok'
