Hello everybody,

Fabio asked me to find somebody willing to fix openswan - there's a
patch ready which needs looking at and test-building etc.

Would be nice, if we considered it for Dapper release.

Have a nice day,
 Daniel

--- programs/pluto/pluto_crypt.c.~1~    2006-05-23 00:54:23.000000000 -0700
+++ programs/pluto/pluto_crypt.c        2006-05-23 00:54:28.000000000 -0700
@@ -146,7 +146,10 @@ helper_passert_fail(const char *pred_str
 
 void pluto_crypto_helper(int fd, int helpernum)
 {
-    char reqbuf[PCR_REQ_SIZE];
+    union {
+       char reqbuf[PCR_REQ_SIZE];
+       struct pluto_crypto_req reqreal;
+    } req;
     struct pluto_crypto_req *r;
 
     signal(SIGHUP, catchhup);
@@ -159,18 +162,18 @@ void pluto_crypto_helper(int fd, int hel
     DBG(DBG_CONTROL, DBG_log("helper %d waiting on fd: %d"
                              , helpernum, fd));
 
-    memset(reqbuf, 0, sizeof(reqbuf));
-    while(read(fd, reqbuf, sizeof(r->pcr_len)) == sizeof(r->pcr_len)) {
+    memset(req.reqbuf, 0, sizeof(req.reqbuf));
+    while(read(fd, &req.reqbuf[0], sizeof(r->pcr_len)) == sizeof(r->pcr_len)) {
        int restlen;
        int actlen;
 
-       r = (struct pluto_crypto_req *)reqbuf;
+       r = &req.reqreal;
        restlen = r->pcr_len-sizeof(r->pcr_len);
        
        passert(restlen < (signed)PCR_REQ_SIZE);
 
        /* okay, got a basic size, read the rest of it */
-       if((actlen= read(fd, reqbuf+sizeof(r->pcr_len), restlen)) != restlen) {
+       if((actlen= read(fd, req.reqbuf+sizeof(r->pcr_len), restlen)) != 
restlen) {
            /* faulty read. die, parent will restart us */
            
            loglog(RC_LOG_SERIOUS, "cryptographic helper(%d) read(%d)=%d 
failed: %s\n",
@@ -186,7 +189,7 @@ void pluto_crypto_helper(int fd, int hel
            loglog(RC_LOG_SERIOUS, "failed to write answer: %d", actlen);
            exit(2);
        }
-       memset(reqbuf, 0, sizeof(reqbuf));
+       memset(req.reqbuf, 0, sizeof(req.reqbuf));
     }
 
     /* probably normal EOF */
@@ -470,7 +473,10 @@ void delete_cryptographic_continuation(s
  */
 void handle_helper_comm(struct pluto_crypto_worker *w)
 {
-    char reqbuf[PCR_REQ_SIZE];
+    union {
+       char reqbuf[PCR_REQ_SIZE];
+       struct pluto_crypto_req reqreal;
+    } req;
     struct pluto_crypto_req *r;
     int restlen;
     int actlen;
@@ -484,7 +490,7 @@ void handle_helper_comm(struct pluto_cry
                           ,w->pcw_work));
 
     /* read from the pipe */
-    actlen = read(w->pcw_pipe, reqbuf, sizeof(r->pcr_len));
+    actlen = read(w->pcw_pipe, &req.reqbuf[0], sizeof(r->pcr_len));
 
     if(actlen != sizeof(r->pcr_len)) {
        if(actlen != 0) {
@@ -501,13 +507,13 @@ void handle_helper_comm(struct pluto_cry
        return;
     }
 
-    r = (struct pluto_crypto_req *)reqbuf;
+    r = &req.reqreal;
 
-    if(r->pcr_len > sizeof(reqbuf)) {
+    if(r->pcr_len > sizeof(req.reqbuf)) {
        loglog(RC_LOG_SERIOUS, "helper(%d) pid=%d screwed up length: %lu > %lu, 
killing it"
               , w->pcw_helpernum
               , w->pcw_pid, (unsigned long)r->pcr_len
-               , (unsigned long)sizeof(reqbuf));
+               , (unsigned long)sizeof(req.reqbuf));
        kill(w->pcw_pid, SIGTERM);
        w->pcw_dead = TRUE;
        return;
@@ -517,7 +523,7 @@ void handle_helper_comm(struct pluto_cry
        
     /* okay, got a basic size, read the rest of it */
     if((actlen= read(w->pcw_pipe
-                    , reqbuf+sizeof(r->pcr_len)
+                    , req.reqbuf+sizeof(r->pcr_len)
                     , restlen)) != restlen) {
        /* faulty read. die, parent will restart us */
        

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

-- 
Ubuntu-motu mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-motu

Reply via email to