Re: [protobuf] Re: What are some protobufs security measures?

2016-07-18 Thread Oi Lee
I did not add an issue to github because I follow the instructions in the 
readme.txt in the python folder. 

On Wednesday, July 13, 2016 at 7:13:42 PM UTC-6, Oi Lee wrote:
>
> Yes I can. :) 
> But just so you know, I did not clone the master from github, instead I 
> downloaded the tar from 
> https://github.com/google/protobuf/releases/tag/v2.6.1. Also I found some 
> record of this issue here: 
> https://bugzilla.redhat.com/show_bug.cgi?id=1154474
>
>
> On Wednesday, July 13, 2016 at 6:57:11 PM UTC-6, Feng Xiao wrote:
>>
>> Can you create a github issue for this?
>>
>> On Wed, Jul 13, 2016 at 1:55 PM, Oi Lee  wrote:
>>
>>> BTW,  I'm on CENTOS7, if that helps. 
>>>
>>> On Wednesday, July 13, 2016 at 2:44:46 PM UTC-6, Oi Lee wrote:

 When I try to run that from protobuf/python, I get an error. 

 distutils.errors.DistutilsError: Could not find suitable distribution 
 for Requirement.parse('google-apputils')


 On Wednesday, July 13, 2016 at 2:08:46 PM UTC-6, Feng Xiao wrote:
>
>
>
> On Wed, Jul 13, 2016 at 1:03 PM, Oi Lee  wrote:
>
>> If I used the make install from github instructions 
>> , is 
>> that compiled using the C++ protobuf library?
>>
> Yes, that will install C++ protobuf library. To enable python C++ 
> implementation, you still need to run "./setup.py install 
> --cpp_implementation". 
>  
>
>>
>>
>> On Monday, July 11, 2016 at 5:55:19 PM UTC-6, Feng Xiao wrote:
>>>
>>>
>>>
>>> On Mon, Jul 11, 2016 at 3:39 PM, Oi Lee  wrote:
>>>
 How do you compile protobuf-Python to use C++ protobuf library? I 
 think I'm using pure-Python protobuf implementation but not totally 
 sure.

>>> How did you install protobuf python? If you install it through PyPI, 
>>> it's pure python. If you install it from source, you will only get the 
>>> C++ 
>>> implementation if you explicitly ask for it: "./setup.py build 
>>> --cpp_implementation".
>>>  
>>>


 On Friday, July 8, 2016 at 4:29:46 PM UTC-6, Josh Haberman wrote:

> This is a complicated question and hard to answer in a general way.
>
> When protobuf-Python is compiled to use the C++ protobuf library, 
> it will use C++ for all parsing. So all of the same protections 
> against 
> parsing untrusted input would apply.
>
> When you are using the pure-Python protobuf implementation, I 
> don't believe the same resource limits are enforced (for example, 
> maximum 
> size or maximum message depth). However, since the parsing code is 
> pure-Python in this case, it shouldn't generally be possible to SEGV 
> the 
> program just by sending unexpected input.
>
> On Friday, July 8, 2016 at 9:34:23 AM UTC-7, Oi Lee wrote:
>>
>> Hello,
>> I saw this post Are protocol buffers hardened? 
>> ,
>>  
>> but I noticed the response only mentioned safeguards for C++ and 
>> Java. May 
>> we assume that these safeguards are in place for other languages 
>> like 
>> Python, etc? 
>>
>> Thank you for your assistance.
>>
>> -- 
 You received this message because you are subscribed to the Google 
 Groups "Protocol Buffers" group.
 To unsubscribe from this group and stop receiving emails from it, 
 send an email to protobuf+u...@googlegroups.com.
 To post to this group, send email to prot...@googlegroups.com.
 Visit this group at https://groups.google.com/group/protobuf.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>> -- 
>> You received this message because you are subscribed to the Google 
>> Groups "Protocol Buffers" group.
>> To unsubscribe from this group and stop receiving emails from it, 
>> send an email to protobuf+u...@googlegroups.com.
>> To post to this group, send email to prot...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Protocol Buffers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to protobuf+u...@googlegroups.com.
>>> To post to this group, send email to prot...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/protobuf.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>

-- 
You received 

[protobuf] what to put in WORKSPACE and/or BUILD files to enable the cc_proto_library rule?

2016-07-18 Thread JI Ioannidis
What is the sequence of magic incantations to create a cc_proto_library 
rule? I have tried copying protobuf.bzl from the protobuf repo to the root 
of my workspace, as well as some (at least a year old) .bzl files 
referenced in this group, to no avail.

My end goal is to have a BUILD file such as 
$ *cat protoa/BUILD*  
cc_proto_library( 
 name = "alice", 
 srcs = ["alice.proto"], 
)

then type 

$ *bazel build //protoa:alice*

and have it create the right .pb.h and .pb.cc files

FWIW, I have already installed bazel at sha 42d8290 (compiled, bazel binary 
copied to ~/bin/) and built and installed protobuf at sha b99577c. 

Thanks!

/ji

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Creating protobuff of biometric data in C#.

2016-07-18 Thread shashi chandra
can anyone help me in creating protobuff of biometric data in C#, if have 
any sample please share.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] why does int64, fixed64, uint64 serialise to string in JSON

2016-07-18 Thread Shashwat Agarwal
Hi,
As per this 
doc: https://developers.google.com/protocol-buffers/docs/proto3#json, 
int64, fixed64, uint64 are suppose to serialise to string in JSON. Are 
there any specific reasons for this choice? It is non standard and breaks a 
other JSON parsers and JS itself.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] Process to generate .proto file for a given XSD ?

2016-07-18 Thread Amit Yadav
Hi , 

Could anyone please let me know the Process to generate .proto file for a 
given XSD ?
E.g. Bulk xsd Process> .proto file 

Thanks, 
Amit

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] C++ Linux Google Protocol Buffers - having trouble replicating the tutorial

2016-07-18 Thread Jonathan


I'm following the cpp tutorial on google protocol buffers 
 and am 
trying to run the example code.


I successfully installed Google Protocol Buffers on Ubuntu and compiled the 
.proto file so I got the pb.h and pb.cc generated files.




ReadAddressBook.cpp is the main c++ file that uses Google Protocol Buffers 
and I made it very minimal:


#include #include #include #include 
"address_book.pb.h"using namespace std;
int main(){

 GOOGLE_PROTOBUF_VERIFY_VERSION;

 tutorial::AddressBook address_book;

 cout << "Created Object";
return 0;}


Now using g++ I want to run this. The tutorial never mentioned actually how 
to compile and link these files beyond generating the pb.cc and ph.h files.


So I wrote the commands:


g++ -l /home/{usr}/local/include -L /home/{usr}/local/lib ReadAddressBook.cpp 
address_book.pb.cc -lprotobuf -pthread

g++ -c ReadAddressBook.cpp

g++ -o ReadAddressBook ReadAddressBook.o


And got the error messages:




Undefined reference to 'google::protobuf::internal' and ect..


How do I link these libraries?



-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] How Do I Get proto3 to build shared libraries in C++

2016-07-18 Thread Doug Lewis
I'm building the proto3 version of protocol buffers using Cygwin.

When I execute the "make check" command I get the following error:

*** Warning: This system can not link to static lib archive lib/libgtest.la.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have.

I did the "./configure" and "make" before doing the "make check".

Is there an option to tell the make to build shared libraries as opposed to 
static libraries?

Thanks,
Doug

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at https://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] Question about Go protobufs and import_prefix

2016-07-18 Thread Zellyn
Note that I'm not actually generating protobufs into a vendor folder; what 
I described has the same problems with or without vendoring.

On Tuesday, July 12, 2016 at 4:33:33 PM UTC-4, Damien Neil wrote:
>
> Simpler than maintaining a fork, though.
>
> The more convenient alternative would be for protoc to understand Go 
> vendor directories, but that would require putting some Go-specific logic 
> in protoc itself.
>
> On Tue, Jul 12, 2016 at 8:00 AM, Zellyn Hunter  > wrote:
>
>> Yeah I can do anything with a wrapper. But to the extent that our 
>> concerns and structure are normal, it would be a shame to need a wrapper.
>>
>> On Tue, Jul 12, 2016, 8:54 AM Ross Light  
>> wrote:
>>
>>> Zellyn and I talked a little bit at Gophercon about this. I think some 
>>> kind of wrapper is in order for his use case: it may actually be a filter 
>>> between protoc and protoc-gen-go.
>>>
>>> On Tue, Jul 12, 2016, 8:49 AM Damien Neil >> > wrote:
>>>
 If I'm following this correctly, your core problem is that protoc 
 doesn't understand vendored paths as used by the go tool. For example:

 - You have a proto file located in src/square/up/protos/square.proto.
 - square.proto imports "
 github.com/golang/protobuf/ptypes/timestamp/timestamp.proto".
 - timestamp.proto is actually located in "src/square/up/vendor/
 github.com/.../timestamp.proto".

 You can't run "protoc --go_out=. square/up/protos/square.proto", 
 because protoc won't be able to locate the vendored copy of 
 timestamp.proto. If it did, everything would work correctly without 
 setting 
 an import_prefix.

 It would be nice for Go users if protoc did understand vendored paths. 
 Failing that, however, I think you can get what you want with a very small 
 wrapper around protoc. The wrapper can copy a proto and all its 
 dependencies into a temp directory (pulling dependencies from vendored 
 paths as necessary), run protoc there, and copy the result back. e.g., in 
 the case of the above example:

 $ mkdir -p /tmp/x/square/up/protos
 $ cp src/square/up/protos/square.proto /tmp/x/square/up/protos
 $ mkdir -p /tmp/x/github.com/golang/protobuf/ptypes/timestamp
 $ cp square/up/vendor/
 github.com/golang/protobuf/ptypes/timestamp/timestamp.proto 
 github.com/golang/protobuf/ptypes/timestamp
 $ cd /tmp/x && protoc -go_out=. square/up/protos/square.proto
 $ cp /tmp/x/square/up/protos/square.pb.go square/up/protos

 The generated .go files will reference non-vendored paths, which the Go 
 compiler will resolve to the correct vendored directory.

 Does that seem like it would work for you?

 On Sun, Jul 10, 2016 at 12:32 PM, Zellyn Hunter  wrote:

> Usually not too tricky. The problem is that protos and most other 
> programming languages prohibit circular imports at the file level, and Go 
> does it at the package level. The fact that protoc and the other 
> languages 
> are okay with a topology ensures there is a valid Go repackaging that 
> will 
> work.
>
> Zellyn
>
> On Fri, Jul 8, 2016, 6:52 PM 'Josh Haberman' via Protocol Buffers <
> prot...@googlegroups.com > wrote:
>
>> I don't know the background of the Go import system or go_package 
>> option. However this statement concerns me a little:
>>
>> > We have to use go_package to reorganize things that are fine in 
>> Java/Ruby, but would be circular package imports in Go.
>>
>> Is this implying that certain .proto files would generate invalid Go 
>> code until you manually insert some go_package statements? How tricky is 
>> it 
>> to do this manual untangling?
>>
>>
>> On Friday, July 1, 2016 at 7:53:03 PM UTC-7, Zellyn wrote:
>>>
>>> Oh wow. Thanks for thinking about it so carefully!
>>>
>>> I should mention: before you could actually specify full package 
>>> paths to the Go proto plugin, earlier versions of our wrapper (
>>> https://github.com/square/goprotowrap) just forcibly manhandled 
>>> things into the shape we wanted by explicitly specifying -M parameter 
>>> import rewrites for *every single* import, and renaming the output 
>>> files into place.
>>>
>>> So it's definitely possible to shape things as you want. However, I 
>>> would prefer to find a solution that works with the official plugin, 
>>> because I don't believe our setup is remarkable or unusual: as GRPC 
>>> sees an 
>>> increase in use as a cross-language RPC mechanism, everyone else is 
>>> going 
>>> to struggle with the same things.
>>>
>>> Zellyn
>>>
>>> On Fri, Jul 1, 2016 at 7:32 PM Ross Light >> > wrote:
>>>
 Sorry for the delayed response!  I've written about 3-4 draft