Beispiel #1
0
ops_parse_cb_return_t
test_cb_get_passphrase(const ops_parser_content_t *content_,
		       ops_parse_cb_info_t *cbinfo)
    {
    //    ops_parser_content_union_t* content=(ops_parser_content_union_t *)&content_->content;
    char *passphrase=NULL;

    OPS_USED(cbinfo);

//    ops_print_packet(content_);

    switch(content_->tag)
        {
    case OPS_PARSER_CMD_GET_SK_PASSPHRASE:
        /*
          Doing this so the test can be automated.
        */
        
        if (cbinfo->cryptinfo.keydata==alpha_sec_keydata)
            passphrase=alpha_passphrase;
        else if (cbinfo->cryptinfo.keydata==bravo_sec_keydata)
            passphrase=bravo_passphrase;
        else
            assert(0);
        //        *(content->secret_key_passphrase.passphrase)=ops_malloc_passphrase(no_passphrase);
        cbinfo->cryptinfo.passphrase=ops_malloc_passphrase(passphrase);
        return OPS_KEEP_MEMORY;
        break;
        
    default:
        //        return callback_general(content_,cbinfo);
        break;
	}
    
    return OPS_RELEASE_MEMORY;
    }
Beispiel #2
0
char *ops_get_passphrase(void)
    {
    return ops_malloc_passphrase(getpass("Passphrase: "));
    }