Re: [Mono-dev] Odbc and unsigned int

2007-10-11 Thread Mads Bondo Dydensborg
tirsdag 21 August 2007 skrev Mads Bondo Dydensborg:
 Hi there

Hi everybody.

Just trying to get help with the issue below.

All help appreciated.

Regards,

Mads

 
 Is it correctly understood, that .NET Odbc does not support unsigned 
integers?
 
 This page would suggest that this is the case: 
 http://msdn2.microsoft.com/en-us/library/bbw6zyha.aspx
 
 What I seem to experience is, that a column from my database that is 
unsigned 
 int, returns the same type, as a column that is int. 
 
 Is this to be expected, or a problem with mono? (I can not test this under 
 Windows currently).
 
 Regards,
 
 Mads
 
 -- 
 Med venlig hilsen/Regards
 
 Systemudvikler/Systemsdeveloper cand.scient.dat, Ph.d., Mads Bondo 
Dydensborg
 Dansk BiblioteksCenter A/S, Tempovej 7-11, 2750 Ballerup, Tlf. +45 44 86 77 
34
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 



-- 
Med venlig hilsen/Regards

Systemudvikler/Systemsdeveloper cand.scient.dat, Ph.d., Mads Bondo Dydensborg
Dansk BiblioteksCenter A/S, Tempovej 7-11, 2750 Ballerup, Tlf. +45 44 86 77 34
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Newbie Building mono - bootstrapping

2007-10-11 Thread Nistur

I am trying to do a similar thing, although slightly differently.
I am currently trying to make a package build script for Archlinux,
hopefully ending in moonlight being installed.
However, the build requires mcs and the libraries, I can download libmcs
that will fulfil those dependencies, but that then leads to file conflicts
when the package comes to being installed as some of the files are already
there.
I have tried to follow the bootstrap procedure but mcs returns:
The assembly mscorlib.dll was not found or could not be loaded.
It should have been installed in the `/usr/lib/mono/1.0/mscorlib.dll'
directory.
I have found the above mentioned file in the monolite package but as I
cannot really install a dll outside the build enironment.



César Lopéz Natarén wrote:
 
 Hello.
 
 So how do I bootstrap my clean Linux installation with mono?
 
 The release tarball should do the job. Read
 http://www.go-mono.com/archive/1.1.9/#install
 
 césar
 
 
 
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 

-- 
View this message in context: 
http://www.nabble.com/-Mono-dev--Newbie-Building-mono---bootstrapping-tf359217.html#a13117779
Sent from the Mono - Dev mailing list archive at Nabble.com.

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Marshalling (Segmentation fault)

2007-10-11 Thread Abir Bhattacharya
Hi All,

 

I have a 'C' structure which needs to be marshalled in MONO.

 

The 'C' struct is something like :

 

struct fgrab {

int bufferlength;

unsigned char *buffer[1000];

} typedef fgrab_struct;

 

 

In the Mono side I have the following code : 

 

 

Class A

{

[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Unicode)]

  Struct ImgStruct

{

  Public uint bufflen;

  IntPtr imgbuff;

}

 

[DllImport (lib.so)]

Private static extern ImgStruct gbuffergrab(); // gbuffergrab is the 'C'
method which returns type struct

 

 

Public void A()

{

  ImgStruct I;

  I=gbuffergrab();  // ERROR

}

}

 

 

 

The code does not have compilation issues but while execution it gives
Segmentation Fault  and exits abnormally ..

 

Any help is appreciated.

 

Thanks 

 

Abir

 



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Marshalling (Segmentation fault)

2007-10-11 Thread Robert Jordan
Abir Bhattacharya wrote:
 
 [DllImport (lib.so)]
 
 Private static extern ImgStruct gbuffergrab(); // gbuffergrab is the 'C'
 method which returns type struct

Please post the C prototype as well.

Robert

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Marshalling (Segmentation fault)

2007-10-11 Thread Abir Bhattacharya
The 'C' prototype :



#ifndef PICTURE_H
#define PICTURE_H

#include def.h


struct fgrab {
int bufferlength;
unsigned char *buffer[1000];
} typedef fgrab_struct;


fgrab_struct fbuffergrab();
void fbufferflush(fgrab_struct fgbuffer);

#endif

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert Jordan
Sent: Thursday, October 11, 2007 4:32 PM
To: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] Marshalling (Segmentation fault)

Abir Bhattacharya wrote:
 
 [DllImport (lib.so)]
 
 Private static extern ImgStruct gbuffergrab(); // gbuffergrab is the 'C'
 method which returns type struct

Please post the C prototype as well.

Robert

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list




-- Visit us at http://www.2pirad.com/ --
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Marshalling (Segmentation fault)

2007-10-11 Thread russell.kay
The C# version of this Structure would be best expressed as

[StructLayout(LayoutKind.Explicit)]
unsafe struct FrameGrab
{
[FieldOffset(0)]
public int bufferlength;
[FieldOffset(4)]
Public fixed IntPtr buffer[1000]
}

One question are you definitely wanting an array of 1000 pointers if
it is really 1000 bytes you are wanting then it would look like

[StructLayout(LayoutKind.Explicit)]
unsafe struct FrameGrab
{
[FieldOffset(0)]
public int bufferlength;
[FieldOffset(4)]
Public fixed byte buffer[1000]
}

Accessing this array on the C# side would then be through a bit of
unsafe code

Public void DoSomething( IntPtr _pValFromCPP )
{
unsafe {
fixed( FrameGrab* pFG = (FrameGrab*)_pValFromCPP.ToPointer()) {
IntPtr p = pFG-buffer[0];
// or
Byte b = pFG-buffer[0];
}
}
}

Russell

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Abir
Bhattacharya
Sent: 11 October 2007 12:09
To: 'Robert Jordan'; mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] Marshalling (Segmentation fault)

The 'C' prototype :



#ifndef PICTURE_H
#define PICTURE_H

#include def.h


struct fgrab {
int bufferlength;
unsigned char *buffer[1000];
} typedef fgrab_struct;


fgrab_struct fbuffergrab();
void fbufferflush(fgrab_struct fgbuffer);

#endif

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Jordan
Sent: Thursday, October 11, 2007 4:32 PM
To: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] Marshalling (Segmentation fault)

Abir Bhattacharya wrote:
 
 [DllImport (lib.so)]
 
 Private static extern ImgStruct gbuffergrab(); // gbuffergrab is the
'C'
 method which returns type struct

Please post the C prototype as well.

Robert

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list




-- Visit us at http://www.2pirad.com/ --
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


This email has been scanned by the MessageLabs Email Security System

DISCLAIMER
This message and any attachments contain privileged and confidential 
information intended for the use of the addressee named above. If you are not 
the intended recipient of this message, you are hereby notified that any use, 
dissemination, distribution or reproduction of this message is prohibited. 
Please note that we cannot guarantee that this message or any attachment is 
virus free or that it has not been intercepted and amended. The views of the 
author may not necessarily reflect those of Real Time Worlds Ltd.

This email has been scanned by the MessageLabs Email Security System
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] FIPS 140 cryptography

2007-10-11 Thread Sebastien Pouliot
Hello Vladimir,

On Fri, 2007-10-05 at 09:02 -0400, Vladimir Giszpenc wrote:
 Hi,
 
 The 100% managed implementation of Mono.Security is an elegant solution but
 the U.S. government may not be as trusting as I am.  Are there any plans to
 get official FIPS 140-2 certification?  

Yes and no. 

Yes. It's been discussed a few times in the past and everyone agrees it
would be nice to have.

No. The short story is that it's a big, long and costly project and
that there's been, so far, not many demand for it (wrt to other Mono
features).

 This would go a long way to ensuring
 net worthiness.

I totally agree :)


While it's less elegant (imho) you can still use FIPS140 certified
crypto in Mono by wrapping an existing toolkit (e.g. nss) in C# [1] and
using this as a replacement [2] for Mono's crypto (split in both
Mono.Security and mscorlib).


[1] which is exactly what MS is doing on Windows: the FIPS140 crypto
comes from CryptoAPI (managed stuff isn't certified) and wrapped in the
class library.

[2] it's possible to remap cryptographic algorithms using machine.config
(so all mono tools and *correctly* written applications/libraries will
be using your own crypto).


Sebastien

 Thanks,
 
 Vladimir Giszpenc
 DSCI Contractor Supporting 
 US Army CERDEC STCD IAD Tactical Network Protection Branch
 (732) 532-8959
 
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Marshalling (Segmentation fault)

2007-10-11 Thread Robert Jordan
[EMAIL PROTECTED] wrote:
 The C# version of this Structure would be best expressed as
 
 [StructLayout(LayoutKind.Explicit)]
 unsafe struct FrameGrab
 {
   [FieldOffset(0)]
   public int bufferlength;
   [FieldOffset(4)]
   Public fixed IntPtr buffer[1000]
 }

This is usually bad portability-wise. LayoutKind.Sequential with
the system's ABI default packing should be used instead, unless
the struct really has a specific layout.

Robert

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Marshalling (Segmentation fault)

2007-10-11 Thread Robert Jordan
Hi,

 struct fgrab {
   int bufferlength;
   unsigned char *buffer[1000];
 } typedef fgrab_struct;
 
 
 int bufferlength = 0;
 unsigned char *buffer[1000];
 
 extern SDL_mutex *mutex;
 
 
 fgrab_struct gbuffergrab() {
   fgrab_struct fgbuffer;
 
   int index;
 
   SDL_mutexP(mutex);
 
   fgbuffer.bufferlength = bufferlength;
   //fgbuffer.buffer = buffer;
   for (index = 0; index  bufferlength; index++) {
   fgbuffer.buffer[index] = buffer[index];
   }
 
   bufferlength = 0;
 
   SDL_mutexV(mutex);
 
   return fgbuffer;
 }


I don't see where you're allocating the buffer, so
I think that function simply doesn't work.

Are you sure you want unsigned char *buffer[1000]?
I guess it should be unsigned char buffer[1000].

Fix this first and the p/invoke will work as well.

Robert


Abir Bhattacharya wrote:
 The 'C' prototype :
 
 
 
 #ifndef PICTURE_H
 #define PICTURE_H
 
 #include def.h
 
 
 struct fgrab {
   int bufferlength;
   unsigned char *buffer[1000];
 } typedef fgrab_struct;
 
 
 fgrab_struct fbuffergrab();
 void fbufferflush(fgrab_struct fgbuffer);
 
 #endif
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Robert Jordan
 Sent: Thursday, October 11, 2007 4:32 PM
 To: mono-devel-list@lists.ximian.com
 Subject: Re: [Mono-dev] Marshalling (Segmentation fault)
 
 Abir Bhattacharya wrote:
 [DllImport (lib.so)]

 Private static extern ImgStruct gbuffergrab(); // gbuffergrab is the 'C'
 method which returns type struct
 
 Please post the C prototype as well.
 
 Robert
 
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 
 
 
 -- Visit us at http://www.2pirad.com/ --

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Marshalling (Segmentation fault)

2007-10-11 Thread Robert Jordan
Abir Bhattacharya wrote:
 Hi,
 
 Actually I have another 'C' File which allocates this buffer : 

But your exposed function doesn't allocate any buffer:

  fgrab_struct gbuffergrab() {
  fgrab_struct fgbuffer;
 
  int index;
 
  SDL_mutexP(mutex);
 
  fgbuffer.bufferlength = bufferlength;
  //fgbuffer.buffer = buffer;
  for (index = 0; index  bufferlength; index++) {
  fgbuffer.buffer[index] = buffer[index];

fgbuffer.buffer is NULL in this place.

Robert

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Marshalling (Segmentation fault)

2007-10-11 Thread Abir Bhattacharya
Hi,

Actually I have another 'C' File which allocates this buffer : 

This captures allocates on a per frame basis.

void fcapture()
{
int fd;

struct video_mbuf mbuf;
char *buf0, *buf1/*, *buf2, *buf3*/;
int size;
//unsigned char *tmp;

struct video_mmap mm;

int frame;

fd = open(/dev/video0, O_RDWR);
if(fd = 0)
{
printf(open);
exit(1);
}

if(ioctl(fd, VIDIOCGMBUF, mbuf)  0)
{
perror(ioctl VIDIOCGMBUF);
exit(1);
}
printf(ioctl VIDIOCGMBUF: done\n);

//use mmap to get a pointer to each buffer.
buf0 = (unsigned char*) mmap(0, mbuf.size, PROT_READ|PROT_WRITE,
MAP_SHARED, fd, 0);
buf0 = buf0 + mbuf.offsets[0];
buf1 = buf0 + mbuf.offsets[1];
size = (320 * 240 * 3)  1;
//tmp = (unsigned char*) malloc(size);
/*
buf2 = buf0 + mbuf.offsets[2];;
buf3 = buf0 + mbuf.offsets[4];;
*/

mm.height = 240;
mm.width = 320;
mm.format = VIDEO_PALETTE_YUV420P;
mm.frame = 0;
if(ioctl(fd, VIDIOCMCAPTURE, mm)  0)
{
perror(ioctl VIDIOCMCAPTURE 0);
exit(1);
}
printf(ioctl VIDIOCMCAPTURE 0: done\n);

while (1)
{
mm.height = 240;
mm.width = 320;
mm.format = VIDEO_PALETTE_YUV420P;
mm.frame = 1;
if(ioctl(fd, VIDIOCMCAPTURE, mm)  0)
{
perror(ioctl VIDIOCMCAPTURE 1);
exit(1);
}
printf(ioctl VIDIOCMCAPTURE 1: done\n);

frame = 0;
if(ioctl(fd, VIDIOCSYNC, frame)  0)
{
perror(ioctl VIDIOCSYNC 0);
exit(1);
}
printf(ioctl VIDIOCSYNC 0: done\n);
//memset(tmp, 0x00, size);
//memcpy(tmp,   buf0, size);
//printf (%u %u %u %u\n, tmp[0], tmp[1], tmp[2], tmp[3]);
//writepicture(tmp, size);
SDL_mutexP(mutex);
buffer[bufferlength] = (unsigned char*) malloc(size);
memset(buffer[bufferlength], 0x00, size);
memcpy(buffer[bufferlength++],  buf0, size);
SDL_mutexV(mutex);

mm.height = 240;
mm.width = 320;
mm.format = VIDEO_PALETTE_YUV420P;
mm.frame = 0;
if(ioctl(fd, VIDIOCMCAPTURE, mm)  0)
{
perror(ioctl VIDIOCMCAPTURE 0);
exit(1);
}
printf(ioctl VIDIOCMCAPTURE 0: done\n);

frame = 1;
if(ioctl(fd, VIDIOCSYNC, frame)  0)
{
perror(ioctl VIDIOCSYNC 1);
exit(1);
}
printf(ioctl VIDIOCSYNC 1: done\n);
//memset(tmp, 0x00, size);
//memcpy(tmp,   buf1, size);
//printf (%u %u %u %u\n, tmp[0], tmp[1], tmp[2], tmp[3]);
//writepicture(tmp, size);
SDL_mutexP(mutex);
buffer[bufferlength] = (unsigned char*) malloc(size);
memset(buffer[bufferlength], 0x00, size);
memcpy(buffer[bufferlength++],  buf0, size);
SDL_mutexV(mutex);
}

close(fd);
}

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert Jordan
Sent: Thursday, October 11, 2007 5:52 PM
To: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] Marshalling (Segmentation fault)

Hi,

 struct fgrab {
   int bufferlength;
   unsigned char *buffer[1000];
 } typedef fgrab_struct;
 
 
 int bufferlength = 0;
 unsigned char *buffer[1000];
 
 extern SDL_mutex *mutex;
 
 
 fgrab_struct gbuffergrab() {
   fgrab_struct fgbuffer;
 
   int index;
 
   SDL_mutexP(mutex);
 
   fgbuffer.bufferlength = bufferlength;
   //fgbuffer.buffer = buffer;
   for (index = 0; index  bufferlength; index++) {
   fgbuffer.buffer[index] = buffer[index];
   }
 
   bufferlength = 0;
 
   SDL_mutexV(mutex);
 
   return fgbuffer;
 }


I don't see where you're allocating the buffer, so
I think that function simply doesn't work.

Are you sure you want unsigned char *buffer[1000]?
I guess it should be unsigned char buffer[1000].

Fix this first and the p/invoke will work as well.

Robert


Abir Bhattacharya wrote:
 The 'C' prototype :
 
 
 
 #ifndef PICTURE_H
 #define PICTURE_H
 
 #include def.h
 
 
 struct fgrab {
   int bufferlength;
   unsigned char *buffer[1000];
 } typedef fgrab_struct;
 
 
 fgrab_struct fbuffergrab();
 void 

Re: [Mono-dev] Marshalling (Segmentation fault)

2007-10-11 Thread Abir Bhattacharya
You cannot have a fixed IntPtr.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

Sent: Thursday, October 11, 2007 4:50 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; mono-devel-list@lists.ximian.com
Subject: RE: [Mono-dev] Marshalling (Segmentation fault)

The C# version of this Structure would be best expressed as

[StructLayout(LayoutKind.Explicit)]
unsafe struct FrameGrab
{
[FieldOffset(0)]
public int bufferlength;
[FieldOffset(4)]
Public fixed IntPtr buffer[1000]
}

One question are you definitely wanting an array of 1000 pointers if
it is really 1000 bytes you are wanting then it would look like

[StructLayout(LayoutKind.Explicit)]
unsafe struct FrameGrab
{
[FieldOffset(0)]
public int bufferlength;
[FieldOffset(4)]
Public fixed byte buffer[1000]
}

Accessing this array on the C# side would then be through a bit of
unsafe code

Public void DoSomething( IntPtr _pValFromCPP )
{
unsafe {
fixed( FrameGrab* pFG = (FrameGrab*)_pValFromCPP.ToPointer()) {
IntPtr p = pFG-buffer[0];
// or
Byte b = pFG-buffer[0];
}
}
}

Russell

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Abir
Bhattacharya
Sent: 11 October 2007 12:09
To: 'Robert Jordan'; mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] Marshalling (Segmentation fault)

The 'C' prototype :



#ifndef PICTURE_H
#define PICTURE_H

#include def.h


struct fgrab {
int bufferlength;
unsigned char *buffer[1000];
} typedef fgrab_struct;


fgrab_struct fbuffergrab();
void fbufferflush(fgrab_struct fgbuffer);

#endif

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Jordan
Sent: Thursday, October 11, 2007 4:32 PM
To: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] Marshalling (Segmentation fault)

Abir Bhattacharya wrote:
 
 [DllImport (lib.so)]
 
 Private static extern ImgStruct gbuffergrab(); // gbuffergrab is the
'C'
 method which returns type struct

Please post the C prototype as well.

Robert

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list




-- Visit us at http://www.2pirad.com/ --
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


This email has been scanned by the MessageLabs Email Security System

DISCLAIMER
This message and any attachments contain privileged and confidential
information intended for the use of the addressee named above. If you are
not the intended recipient of this message, you are hereby notified that any
use, dissemination, distribution or reproduction of this message is
prohibited. Please note that we cannot guarantee that this message or any
attachment is virus free or that it has not been intercepted and amended.
The views of the author may not necessarily reflect those of Real Time
Worlds Ltd.

This email has been scanned by the MessageLabs Email Security System




-- Visit us at http://www.2pirad.com/ --
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] FIPS 140 cryptography

2007-10-11 Thread Vladimir Giszpenc
Sebastien,

 No. The short story is that it's a big, long and costly project and
 that there's been, so far, not many demand for it (wrt to other Mono
 features).

I agree that there are more pressing needs, but it never hurts to voice
your
own so they are recognized.  I am a big Mono proponent, but it is
difficult
to compete with Java on maturity of tools.  

 While it's less elegant (imho) you can still use FIPS140 certified
 crypto in Mono by wrapping an existing toolkit (e.g. nss) in C# [1]
and
 using this as a replacement [2] for Mono's crypto (split in both
 Mono.Security and mscorlib).

The Java community has JSS.  Would asking for a MonoSS be asking too
much?
That seems like a big project as well.  This is not even what I am
really
looking for.  I need SSH.  I found the capability in SharpSSH, but in
order
for me to make certification labs happy, I need the encryption used in
my
SSH implementation to be FIPS 140 compliant.

 [1] which is exactly what MS is doing on Windows: the FIPS140 crypto
 comes from CryptoAPI (managed stuff isn't certified) and wrapped in
the
 class library.
 
 [2] it's possible to remap cryptographic algorithms using
machine.config
 (so all mono tools and *correctly* written applications/libraries will
 be using your own crypto).

That is nice for Windows, but I am targeting Linux.  I would love to
point
some config file at NSS.  Is there any chance such a thing will happen?

I am a little peon doing RD hoping to move the Army toward accepting
Mono.
Any help you can give me would be much appreciated!

Many Thanks,

Vladimir Giszpenc
DSCI Contractor Supporting
US Army CERDEC STCD IAD Tactical Network Protection Branch
(732) 532-8959
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Marshalling (Segmentation fault)

2007-10-11 Thread russell.kay
True,... 

In this case I was ripping an example I had that was using a union type
layout, which does need this type of arrangement... Apologies all round.

For simple structures C/C++ is pretty portable these days between
architectures, the main issue is 32bit/64bit and pointers (and any
alignment specific nastiness).

My main gripe with C# is not supporting union in a portable way (i.e.
you have to resort to LayoutKind.Explicit).

Russell


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Jordan
Sent: 11 October 2007 13:15
To: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] Marshalling (Segmentation fault)

[EMAIL PROTECTED] wrote:
 The C# version of this Structure would be best expressed as
 
 [StructLayout(LayoutKind.Explicit)]
 unsafe struct FrameGrab
 {
   [FieldOffset(0)]
   public int bufferlength;
   [FieldOffset(4)]
   Public fixed IntPtr buffer[1000]
 }

This is usually bad portability-wise. LayoutKind.Sequential with
the system's ABI default packing should be used instead, unless
the struct really has a specific layout.

Robert

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


This email has been scanned by the MessageLabs Email Security System

DISCLAIMER
This message and any attachments contain privileged and confidential 
information intended for the use of the addressee named above. If you are not 
the intended recipient of this message, you are hereby notified that any use, 
dissemination, distribution or reproduction of this message is prohibited. 
Please note that we cannot guarantee that this message or any attachment is 
virus free or that it has not been intercepted and amended. The views of the 
author may not necessarily reflect those of Real Time Worlds Ltd.

This email has been scanned by the MessageLabs Email Security System
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] FIPS 140 cryptography

2007-10-11 Thread Sebastien Pouliot
Hello Vladimir,

On Thu, 2007-10-11 at 11:04 -0400, Vladimir Giszpenc wrote:
 Sebastien,
 
  No. The short story is that it's a big, long and costly project and
  that there's been, so far, not many demand for it (wrt to other Mono
  features).
 
 I agree that there are more pressing needs, but it never hurts to voice
 your
 own so they are recognized.  

Well I can't agree more with that ;-) If no one had asked before today
we wouldn't even have considered it.

 I am a big Mono proponent, but it is
 difficult
 to compete with Java on maturity of tools.  
 
  While it's less elegant (imho) you can still use FIPS140 certified
  crypto in Mono by wrapping an existing toolkit (e.g. nss) in C# [1]
 and
  using this as a replacement [2] for Mono's crypto (split in both
  Mono.Security and mscorlib).
 
 The Java community has JSS.  Would asking for a MonoSS be asking too
 much?

It depends from who you're asking ;-)

Network Security Services for Java (JSS) is provided by Mozilla. So yes
Mozilla *could* do something like this (not Mono-specific but for
all .NET users) just like they provide the API for Java.

However I don't think this (NSS) should ever become a direct(*) Mono
goal(**). Mono itself has already too many things to complete to afford
a duplicate effort (since we already offer the same features).

(*) Someone in the Mono (or .NET) community may be interested in
producing this. This is a reason (help alternatives) why Crimson
(http://www.mono-project.com/Crimson) was started last year. Sadly it
would seems that my offer to help people (rather than doing it myself)
was quite enough to produce much code ;-)

(**) certifying our own code for FIPS-140 is another story :)

 That seems like a big project as well.  This is not even what I am
 really
 looking for.  I need SSH.  I found the capability in SharpSSH, but in
 order
 for me to make certification labs happy, I need the encryption used in
 my
 SSH implementation to be FIPS 140 compliant.

Well as long as SharpSSH doesn't provide it's own crypto (totally or
partially) it doesn't have to be certified. Which brings you back to
finding certified cryptographic implementations (like NSS) available
thru Mono.

  [1] which is exactly what MS is doing on Windows: the FIPS140 crypto
  comes from CryptoAPI (managed stuff isn't certified) and wrapped in
 the
  class library.
  
  [2] it's possible to remap cryptographic algorithms using
 machine.config
  (so all mono tools and *correctly* written applications/libraries will
  be using your own crypto).
 
 That is nice for Windows, but I am targeting Linux.  I would love to
 point
 some config file at NSS.  Is there any chance such a thing will happen?

Well the config remapping stuff already works on Mono/Linux, so it's a
matter of finding alternates cryptographic implementation that match
your need (fips140 certified). Mono itself is ready to use it ;-)

 I am a little peon doing RD hoping to move the Army toward accepting
 Mono.
 Any help you can give me would be much appreciated!

Besides NSS there are other FIPS140 certified libraries that could be
wrapped to give the same end result. However I don't know any available
on Linux that have .NET binding.

 
 Many Thanks,
 
 Vladimir Giszpenc
 DSCI Contractor Supporting
 US Army CERDEC STCD IAD Tactical Network Protection Branch
 (732) 532-8959
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] FIPS 140 cryptography

2007-10-11 Thread Miguel de Icaza
Hello,

   I have updated our FAQ with the details from this discussion.   I
encourage folks to maintain our FAQs updated when we come across
information like this:

http://www.mono-project.com/FAQ:_Security#FIPS_Certification

   Feel free to correct or fix it.

 Hello Vladimir,
 
 On Thu, 2007-10-11 at 11:04 -0400, Vladimir Giszpenc wrote:
  Sebastien,
  
   No. The short story is that it's a big, long and costly project and
   that there's been, so far, not many demand for it (wrt to other Mono
   features).
  
  I agree that there are more pressing needs, but it never hurts to voice
  your
  own so they are recognized.  
 
 Well I can't agree more with that ;-) If no one had asked before today
 we wouldn't even have considered it.
 
  I am a big Mono proponent, but it is
  difficult
  to compete with Java on maturity of tools.  
  
   While it's less elegant (imho) you can still use FIPS140 certified
   crypto in Mono by wrapping an existing toolkit (e.g. nss) in C# [1]
  and
   using this as a replacement [2] for Mono's crypto (split in both
   Mono.Security and mscorlib).
  
  The Java community has JSS.  Would asking for a MonoSS be asking too
  much?
 
 It depends from who you're asking ;-)
 
 Network Security Services for Java (JSS) is provided by Mozilla. So yes
 Mozilla *could* do something like this (not Mono-specific but for
 all .NET users) just like they provide the API for Java.
 
 However I don't think this (NSS) should ever become a direct(*) Mono
 goal(**). Mono itself has already too many things to complete to afford
 a duplicate effort (since we already offer the same features).
 
 (*) Someone in the Mono (or .NET) community may be interested in
 producing this. This is a reason (help alternatives) why Crimson
 (http://www.mono-project.com/Crimson) was started last year. Sadly it
 would seems that my offer to help people (rather than doing it myself)
 was quite enough to produce much code ;-)
 
 (**) certifying our own code for FIPS-140 is another story :)
 
  That seems like a big project as well.  This is not even what I am
  really
  looking for.  I need SSH.  I found the capability in SharpSSH, but in
  order
  for me to make certification labs happy, I need the encryption used in
  my
  SSH implementation to be FIPS 140 compliant.
 
 Well as long as SharpSSH doesn't provide it's own crypto (totally or
 partially) it doesn't have to be certified. Which brings you back to
 finding certified cryptographic implementations (like NSS) available
 thru Mono.
 
   [1] which is exactly what MS is doing on Windows: the FIPS140 crypto
   comes from CryptoAPI (managed stuff isn't certified) and wrapped in
  the
   class library.
   
   [2] it's possible to remap cryptographic algorithms using
  machine.config
   (so all mono tools and *correctly* written applications/libraries will
   be using your own crypto).
  
  That is nice for Windows, but I am targeting Linux.  I would love to
  point
  some config file at NSS.  Is there any chance such a thing will happen?
 
 Well the config remapping stuff already works on Mono/Linux, so it's a
 matter of finding alternates cryptographic implementation that match
 your need (fips140 certified). Mono itself is ready to use it ;-)
 
  I am a little peon doing RD hoping to move the Army toward accepting
  Mono.
  Any help you can give me would be much appreciated!
 
 Besides NSS there are other FIPS140 certified libraries that could be
 wrapped to give the same end result. However I don't know any available
 on Linux that have .NET binding.
 
  
  Many Thanks,
  
  Vladimir Giszpenc
  DSCI Contractor Supporting
  US Army CERDEC STCD IAD Tactical Network Protection Branch
  (732) 532-8959
  ___
  Mono-devel-list mailing list
  Mono-devel-list@lists.ximian.com
  http://lists.ximian.com/mailman/listinfo/mono-devel-list
 
 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] New profiler (work in progress)

2007-10-11 Thread Ben Motmans
excellent news !

I'm going to add support for this profiler to the MonoDevelop profiling
addin as soon as possible.

-- Ben

On 10/11/07, Massimiliano Mantione [EMAIL PROTECTED] wrote:


 Hello,
 we decided to overhaul the current mono profiler.
 It is not a revolution, because the profiling API stays the same,
 just a reimplementation of the current default profiler.

 In the attached files you can find some documentation, and the work
 I've done so far.
 Note that you will need at least svn r87098, otherwise the needed
 events will not be called by the runtime.

 Status:

 Everything implemented is working, except the statistical profiler.
 Currently I have problems getting the jit info, I just commented
 the line so that all events appear to have hit unmanaged code.
 However, I still don't handle mapping of unmanaged function names,
 so the statistical profiler is useless for now.
 Moreover, I still don't implement parsing of arguments, so the
 flags are hardcoded into setup_user_options.

 Then, the reader program is still to be refined.

 And I sort of ported it to Windows, but never tested it there.

 Apart from that, the thing works, but it produces *huge* files.
 Running the bench.exe program in mono/mini generates almost one
 GB of data.
 The nice thing is that it works :-)

 Have fun,
   Massimiliano



 ___
 Mono-devel-list mailing list
 Mono-devel-list@lists.ximian.com
 http://lists.ximian.com/mailman/listinfo/mono-devel-list



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] New profiler (work in progress)

2007-10-11 Thread Massimiliano Mantione
On Thu, 2007-10-11 at 17:27 -0400, Chris Morgan wrote:
 I'm not sure if you've ever used valgrind/kcachegrind but it might be
 useful to be able to output in that format to enable easier
 visualization of profiling data. As far as I know kcachegrind still
 has about the best visualization for profiling that I've seen and it
 would be useful to leverage a tool like it to provide easier analysis
 than reading through profiling text output.

Yes, I have used kcachegrind, and I absolutely loved it :-)
For now the priority is to be able to output files as small
as possible, and with as little overhead as possible.

Then, hintsomebody could contribute/hint an off line
translator from our file format to kcachegrind's ;-)

Another thing I would like is integrating oprofile support in
this profiler. The oprofile team just created a branch which
provides Java support, but the JIT support is vm-agnostic and
it would be easy to make it support Mono.

BTW, I just rerun the bench test enabling only the (broken)
statistical profiler support, even if it does not provide
meaningful data.
This way the log file is small and the overhead ok.
The log file was so huge because with all the flags enabled it
was actually like a full trace...

Ciao,
  Massi


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list