[pubcookie-dev] WEBISO CVS update: jteaton; index.cgi.c,1.109.2.2,1.109.2.3 index.cgi.h,1.42.4.2,1.42.4.3 security_legacy.c,1.31.2.1,1.31.2.2

jeaton+ at andrew.cmu.edu jeaton+ at andrew.cmu.edu
Wed Dec 17 11:37:50 PST 2003


Update of /usr/local/cvsroot/webiso/pubcookie/src
 In directory webiso-cvs.cac.washington.edu:/var/tmp/cvs-serv10225/src
 
 Modified Files:
       Tag: security-context
 	flavor_basic.c index.cgi.c index.cgi.h security_legacy.c 
 Log Message:
 a few changes i missed in my last update
 



Index: webiso/pubcookie/src/flavor_basic.c
diff -c webiso/pubcookie/src/flavor_basic.c:1.42.4.1 webiso/pubcookie/src/flavor_basic.c:1.42.4.2
*** webiso/pubcookie/src/flavor_basic.c:1.42.4.1	Tue Dec 16 14:01:26 2003
--- webiso/pubcookie/src/flavor_basic.c	Wed Dec 17 11:37:47 2003
***************
*** 13,19 ****
   *   will pass l->realm to the verifier and append it to the username when
   *   'append_realm' is set
   *
!  * $Id: flavor_basic.c,v 1.42.4.1 2003/12/16 22:01:26 jteaton Exp $
   */
  
  
--- 13,19 ----
   *   will pass l->realm to the verifier and append it to the username when
   *   'append_realm' is set
   *
!  * $Id: flavor_basic.c,v 1.42.4.2 2003/12/17 19:37:47 jteaton Exp $
   */
  
  
***************
*** 568,574 ****
     if authentication has succeeded, no output is generated and it returns
     LOGIN_OK.
   */
! static login_result process_basic(pool *p, securit_context *context,
                                    login_rec *l, login_rec *c,
  				  const char **errstr)
  {
--- 568,574 ----
     if authentication has succeeded, no output is generated and it returns
     LOGIN_OK.
   */
! static login_result process_basic(pool *p, security_context *context,
                                    login_rec *l, login_rec *c,
  				  const char **errstr)
  {


Index: webiso/pubcookie/src/index.cgi.c
diff -c webiso/pubcookie/src/index.cgi.c:1.109.2.2 webiso/pubcookie/src/index.cgi.c:1.109.2.3
*** webiso/pubcookie/src/index.cgi.c:1.109.2.2	Tue Dec 16 14:01:26 2003
--- webiso/pubcookie/src/index.cgi.c	Wed Dec 17 11:37:47 2003
***************
*** 6,12 ****
  /** @file index.cgi.c
   * Login server CGI
   *
!  * $Id: index.cgi.c,v 1.109.2.2 2003/12/16 22:01:26 jteaton Exp $
   */
  
  #ifdef HAVE_CONFIG_H
--- 6,12 ----
  /** @file index.cgi.c
   * Login server CGI
   *
!  * $Id: index.cgi.c,v 1.109.2.3 2003/12/17 19:37:47 jteaton Exp $
   */
  
  #ifdef HAVE_CONFIG_H
***************
*** 553,559 ****
   * @returns PBC_FAIL on error
   * @returns PBC_OK if everything went ok
   */
! int expire_login_cookie(pool *p, security_context *sectext, login_rec *l, login_rec *c) {
      char	*l_cookie;
      char	*message = NULL;
      int		l_res;
--- 553,559 ----
   * @returns PBC_FAIL on error
   * @returns PBC_OK if everything went ok
   */
! int expire_login_cookie(pool *p, const security_context *context, login_rec *l, login_rec *c) {
      char	*l_cookie;
      char	*message = NULL;
      int		l_res;
***************
*** 580,586 ****
          user = c->user;
      }
  
!     l_res = create_cookie( p, sectext, urluser = url_encode(p, user),
                             urlappsrvid = url_encode(p, "expired"),
                             urlappid = url_encode(p, "expired"),
                             PBC_COOKIE_TYPE_L,
--- 580,586 ----
          user = c->user;
      }
  
!     l_res = create_cookie( p, context, urluser = url_encode(p, user),
                             urlappsrvid = url_encode(p, "expired"),
                             urlappid = url_encode(p, "expired"),
                             PBC_COOKIE_TYPE_L,
***************
*** 999,1005 ****
  /*                                                                   */
  /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ 
  
! int vector_request(pool *p, security_context *sectext, login_rec *l, login_rec *c)
  {
      login_result res;
      const char *errstr = NULL;
--- 999,1005 ----
  /*                                                                   */
  /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ /* */ 
  
! int vector_request(pool *p, const security_context *context, login_rec *l, login_rec *c)
  {
      login_result res;
      const char *errstr = NULL;
***************
*** 1031,1040 ****
      }
  
      /* decode login cookie */
!     l->check_error = check_l_cookie(p, sectext, l, c);
  
      /* call authn flavor to determine correct result */
!     res = fl->process_request(p, sectext, l, c, &errstr);
  
      switch (res) {
          case LOGIN_OK:
--- 1031,1040 ----
      }
  
      /* decode login cookie */
!     l->check_error = check_l_cookie(p, context, l, c);
  
      /* call authn flavor to determine correct result */
!     res = fl->process_request(p, context, l, c, &errstr);
  
      switch (res) {
          case LOGIN_OK:
***************
*** 1224,1230 ****
  
  }
  
! int logout(pool *p, security_context *sectext, login_rec *l, login_rec *c, int logout_action)
  {
      char	*appid;
      char	*appsrvid;
--- 1224,1230 ----
  
  }
  
! int logout(pool *p, const security_context *context, login_rec *l, login_rec *c, int logout_action)
  {
      char	*appid;
      char	*appsrvid;
***************
*** 1282,1288 ****
                          NULL);
      }
      else if( logout_action == LOGOUT_ACTION_CLEAR_L ) {
!         expire_login_cookie(p, sectext, l, c);
          ntmpl_print_html(p, TMPL_FNAME,
                          libpbc_config_getstring(p, "tmpl_logout_part1",
                                                  "logout_part1"),
--- 1282,1288 ----
                          NULL);
      }
      else if( logout_action == LOGOUT_ACTION_CLEAR_L ) {
!         expire_login_cookie(p, context, l, c);
          ntmpl_print_html(p, TMPL_FNAME,
                          libpbc_config_getstring(p, "tmpl_logout_part1",
                                                  "logout_part1"),
***************
*** 1353,1359 ****
   *
   * @returns PBC_OK if not a logout, or never returns if a logout
   */
! int check_logout(pool *p, security_context *sectext, login_rec *l, login_rec *c) 
  {
      int logout_action;
      char *logout_prog;
--- 1353,1359 ----
   *
   * @returns PBC_OK if not a logout, or never returns if a logout
   */
! int check_logout(pool *p, const security_context *context, login_rec *l, login_rec *c) 
  {
      int logout_action;
      char *logout_prog;
***************
*** 1372,1378 ****
      if ( logout_action != LOGOUT_ACTION_UNSET ) {
  	pbc_log_activity(p, PBC_LOG_DEBUG_LOW, 
  			 "check_logout: logout_action : %s\n", cgiScriptName);
!         logout(p, sectext, l, c, logout_action);
          do_output(p);
          exit(0);
      }
--- 1372,1378 ----
      if ( logout_action != LOGOUT_ACTION_UNSET ) {
  	pbc_log_activity(p, PBC_LOG_DEBUG_LOW, 
  			 "check_logout: logout_action : %s\n", cgiScriptName);
!         logout(p, context, l, c, logout_action);
          do_output(p);
          exit(0);
      }
***************
*** 1402,1408 ****
  
      if(logout_prog != NULL && uri != NULL &&
         strcasecmp(logout_prog, uri) == 0 ) {
!         logout(p, l, c, LOGOUT_ACTION_CLEAR_L_NO_APP);
          do_output(p);
          if (uri != NULL)
              free(uri);
--- 1402,1408 ----
  
      if(logout_prog != NULL && uri != NULL &&
         strcasecmp(logout_prog, uri) == 0 ) {
!         logout(p, context, l, c, LOGOUT_ACTION_CLEAR_L_NO_APP);
          do_output(p);
          if (uri != NULL)
              free(uri);
***************
*** 1469,1475 ****
   * @param l info for login session
   * @param c contents of login cookie
   */
! int pinit(pool *p, security_context *sectext, login_rec *l, login_rec *c)
  {
  
      pbc_log_activity(p, PBC_LOG_DEBUG_VERBOSE,"pinit: hello");
--- 1469,1475 ----
   * @param l info for login session
   * @param c contents of login cookie
   */
! int pinit(pool *p, const security_context *context, login_rec *l, login_rec *c)
  {
  
      pbc_log_activity(p, PBC_LOG_DEBUG_VERBOSE,"pinit: hello");
***************
*** 1505,1514 ****
  	fl = get_flavor(p, l->creds_from_greq);
  
  	/* decode login cookie */
! 	l->check_error = check_l_cookie(p, sectext, l, c);
  
  	fl->init_flavor();
! 	res = fl->process_request(p, sectext, l, c, &errstr);
  	if (res != LOGIN_INPROGRESS) {
  	    pbc_log_activity(p, PBC_LOG_ERROR,
  			     "unexpected response from fl->process_request: "
--- 1505,1514 ----
  	fl = get_flavor(p, l->creds_from_greq);
  
  	/* decode login cookie */
! 	l->check_error = check_l_cookie(p, context, l, c);
  
  	fl->init_flavor();
! 	res = fl->process_request(p, context, l, c, &errstr);
  	if (res != LOGIN_INPROGRESS) {
  	    pbc_log_activity(p, PBC_LOG_ERROR,
  			     "unexpected response from fl->process_request: "
***************
*** 1543,1549 ****
      const char *mirrorfile;
      void *p; /* we pass a pointer around that is an Apache memory pool if we're
                  using apache, here we just pass a void pointer */
!     security_context *sectext; /* to hold all of the certs for a transaction */
  
  
      libpbc_config_init(p, NULL, "logincgi");
--- 1543,1549 ----
      const char *mirrorfile;
      void *p; /* we pass a pointer around that is an Apache memory pool if we're
                  using apache, here we just pass a void pointer */
!     security_context *context; /* to hold all of the certs for a transaction */
  
  
      libpbc_config_init(p, NULL, "logincgi");
***************
*** 1560,1566 ****
  
      mirrorfile = libpbc_config_getstring(p, "mirrorfile", NULL);
  
!     libpbc_pubcookie_init(p, &sectext);
  
      pbc_log_activity(p, PBC_LOG_DEBUG_LOW, "cgiMain() done initializing...\n");
  
--- 1560,1566 ----
  
      mirrorfile = libpbc_config_getstring(p, "mirrorfile", NULL);
  
!     libpbc_pubcookie_init(p, &context);
  
      pbc_log_activity(p, PBC_LOG_DEBUG_LOW, "cgiMain() done initializing...\n");
  
***************
*** 1616,1622 ****
      l = get_query(p); 
  
      /* unload the login cookie if we have it */
!     c = verify_unload_login_cookie(p, sectext, l);
  
      /* log the arrival */
      pbc_log_activity(p, PBC_LOG_AUDIT,
--- 1616,1622 ----
      l = get_query(p); 
  
      /* unload the login cookie if we have it */
!     c = verify_unload_login_cookie(p, context, l);
  
      /* log the arrival */
      pbc_log_activity(p, PBC_LOG_AUDIT,
***************
*** 1647,1658 ****
      }
      
      /* look for various logout conditions */
!     check_logout(p, sectext, l, c);
  
      /* check to see what cookies we have */
      /* pinit detected in here */
      /* pinit response detected in here */
!     if (cookie_test(p, sectext, l, c) == PBC_FAIL) {
          goto done;
      }
  
--- 1647,1658 ----
      }
      
      /* look for various logout conditions */
!     check_logout(p, context, l, c);
  
      /* check to see what cookies we have */
      /* pinit detected in here */
      /* pinit response detected in here */
!     if (cookie_test(p, context, l, c) == PBC_FAIL) {
          goto done;
      }
  
***************
*** 1664,1670 ****
          l->fr = strdup("NFR");
      }
      
!     if (vector_request(p, sectext, l, c) == PBC_OK ) {
          /* the reward for a hard days work */
          pbc_log_activity(p, PBC_LOG_AUDIT,
      "%s Issuing cookies for user: %s client addr: %s app host: %s appid: %s", 
--- 1664,1670 ----
          l->fr = strdup("NFR");
      }
      
!     if (vector_request(p, context, l, c) == PBC_OK ) {
          /* the reward for a hard days work */
          pbc_log_activity(p, PBC_LOG_AUDIT,
      "%s Issuing cookies for user: %s client addr: %s app host: %s appid: %s", 
***************
*** 1675,1681 ****
  			 l->appid);
      
          /* generate the cookies and print the redirect page */
!         print_redirect_page(p, sectext, l, c);
      }
  
  done:
--- 1675,1681 ----
  			 l->appid);
      
          /* generate the cookies and print the redirect page */
!         print_redirect_page(p, context, l, c);
      }
  
  done:
***************
*** 1780,1786 ****
  /* returns NULL if the L cookie is valid                                     */
  /*   else a description of it's invalid nature                               */
  /* xxx most of this work should probably be done inside of the flavor */
! char *check_l_cookie(pool *p, security_context *sectext, login_rec *l, login_rec *c)
  {
      time_t	t;
      char	*g_version;
--- 1780,1786 ----
  /* returns NULL if the L cookie is valid                                     */
  /*   else a description of it's invalid nature                               */
  /* xxx most of this work should probably be done inside of the flavor */
! char *check_l_cookie(pool *p, const security_context *context, login_rec *l, login_rec *c)
  {
      time_t	t;
      char	*g_version;
***************
*** 1789,1795 ****
      pbc_log_activity(p, PBC_LOG_DEBUG_VERBOSE, "check_l_cookie: hello\n");
  
      if (c == NULL )
!         c = verify_unload_login_cookie(p, sectext, l);
  
      if (c == NULL)
          return("couldn't decode login cookie");
--- 1789,1795 ----
      pbc_log_activity(p, PBC_LOG_DEBUG_VERBOSE, "check_l_cookie: hello\n");
  
      if (c == NULL )
!         c = verify_unload_login_cookie(p, context, l);
  
      if (c == NULL)
          return("couldn't decode login cookie");
***************
*** 2008,2014 ****
   * @returns PBC_FAIL if the program should finish
   * @returns PBC_OK   if the program should continue
   */
! int cookie_test(pool *p, security_context *sectext, login_rec *l, login_rec *c) 
  {
      char        *cookies;
      char        cleared_g_req[PBC_1K];
--- 2008,2014 ----
   * @returns PBC_FAIL if the program should finish
   * @returns PBC_OK   if the program should continue
   */
! int cookie_test(pool *p, const security_context *context, login_rec *l, login_rec *c) 
  {
      char        *cookies;
      char        cleared_g_req[PBC_1K];
***************
*** 2022,2028 ****
  
      /* if no cookies, then must be pinit */
      if ((cookies = getenv("HTTP_COOKIE")) == NULL) {
!         pinit(p, sectext, l, c);
          return(PBC_FAIL);
      }
      
--- 2022,2028 ----
  
      /* if no cookies, then must be pinit */
      if ((cookies = getenv("HTTP_COOKIE")) == NULL) {
!         pinit(p, context, l, c);
          return(PBC_FAIL);
      }
      
***************
*** 2057,2063 ****
  
      /* after a pinit login we give the user something nice to look at */
      if ( strstr(cookies, PBC_PINIT_COOKIENAME) != NULL ) {
!         pinit_response(p, l, c);
          return(PBC_FAIL);
      }
  
--- 2057,2063 ----
  
      /* after a pinit login we give the user something nice to look at */
      if ( strstr(cookies, PBC_PINIT_COOKIENAME) != NULL ) {
!         pinit_response(p, context, l, c);
          return(PBC_FAIL);
      }
  
***************
*** 2171,2177 ****
  }
  
  
! void print_redirect_page(pool *p, security_context *sectext, login_rec *l, login_rec *c)
  {
      char		*g_cookie;
      char		*l_cookie;
--- 2171,2177 ----
  }
  
  
! void print_redirect_page(pool *p, const security_context *context, login_rec *l, login_rec *c)
  {
      char		*g_cookie;
      char		*l_cookie;
***************
*** 2219,2238 ****
      /* the login cookie is encoded as having passed 'creds', which is what
         the flavor verified. */
  
!     l_res = create_cookie( p, sectext,
!                            user = url_encode(p, l->user),
!                            appsrvid = url_encode(p, l->appsrvid),
!                            appid = url_encode(p, l->appid),
!                            PBC_COOKIE_TYPE_L,
!                            l->creds,
!                            0,
!                            (c != NULL ? c->create_ts : 0),
!                            (c == NULL || c->expire_ts < time(NULL) 
!                                 ? compute_l_expire(p, l) 
!                                 : c->expire_ts),
!                            l_cookie,
!                            NULL, /* sending it to myself */
!                            PBC_4K);
  
      if (user != NULL)
          pbc_free(p, user);
--- 2219,2238 ----
      /* the login cookie is encoded as having passed 'creds', which is what
         the flavor verified. */
  
!     l_res = create_cookie(p, context,
!                           user = url_encode(p, l->user),
!                           appsrvid = url_encode(p, l->appsrvid),
!                           appid = url_encode(p, l->appid),
!                           PBC_COOKIE_TYPE_L,
!                           l->creds,
!                           0,
!                           (c != NULL ? c->create_ts : 0),
!                           (c == NULL || c->expire_ts < time(NULL) 
!                                ? compute_l_expire(p, l) 
!                                : c->expire_ts),
!                           l_cookie,
!                           NULL, /* sending it to myself */
!                           PBC_4K);
  
      if (user != NULL)
          pbc_free(p, user);
***************
*** 2245,2251 ****
         LOGIN_OK, we tell the application that it's desire for 'creds_from_greq'
         was successful. */
  
!     g_res = create_cookie(p, sectext, user = url_encode(p, l->user),
                            appsrvid =url_encode(p, l->appsrvid),
                            appid = url_encode(p, l->appid),
                            PBC_COOKIE_TYPE_G,
--- 2245,2251 ----
         LOGIN_OK, we tell the application that it's desire for 'creds_from_greq'
         was successful. */
  
!     g_res = create_cookie(p, context, user = url_encode(p, l->user),
                            appsrvid =url_encode(p, l->appsrvid),
                            appid = url_encode(p, l->appid),
                            PBC_COOKIE_TYPE_G,
***************
*** 2586,2592 ****
  
  /* uses libpubcookie calls to check the cookie and load the login rec with  */
  /* cookie contents                                                          */
! login_rec *verify_unload_login_cookie (pool *p, security_context *sectext, login_rec *l)
  {
      pbc_cookie_data     *cookie_data;
      char		*cookie = NULL;
--- 2586,2592 ----
  
  /* uses libpubcookie calls to check the cookie and load the login rec with  */
  /* cookie contents                                                          */
! login_rec *verify_unload_login_cookie (pool *p, const security_context *context, login_rec *l)
  {
      pbc_cookie_data     *cookie_data;
      char		*cookie = NULL;
***************
*** 2610,2616 ****
      new = malloc(sizeof(login_rec));
      init_login_rec(p, new);
  
!     cookie_data = libpbc_unbundle_cookie(p, sectext, cookie, NULL);
  
      /* Done with cookie */
      if (cookie != NULL)
--- 2610,2616 ----
      new = malloc(sizeof(login_rec));
      init_login_rec(p, new);
  
!     cookie_data = libpbc_unbundle_cookie(p, context, cookie, NULL);
  
      /* Done with cookie */
      if (cookie != NULL)
***************
*** 2645,2651 ****
  
  }
  
! int create_cookie(pool *p, security_context *sectext,
                    char *user_buf,
                    char *appsrvid_buf,
                    char *appid_buf,
--- 2645,2651 ----
  
  }
  
! int create_cookie(pool *p, const security_context *context,
                    char *user_buf,
                    char *appsrvid_buf,
                    char *appid_buf,
***************
*** 2703,2709 ****
          create = time(NULL);
  
      cookie_local = (char *) 
!         libpbc_get_cookie_with_expire(p, sectext, user, type, creds, pre_sess_tok,
                                        create, expire, appsrvid, appid, peer);
  
      if (peer != NULL)
--- 2703,2709 ----
          create = time(NULL);
  
      cookie_local = (char *) 
!         libpbc_get_cookie_with_expire(p, context, user, type, creds, pre_sess_tok,
                                        create, expire, appsrvid, appid, peer);
  
      if (peer != NULL)


Index: webiso/pubcookie/src/index.cgi.h
diff -c webiso/pubcookie/src/index.cgi.h:1.42.4.2 webiso/pubcookie/src/index.cgi.h:1.42.4.3
*** webiso/pubcookie/src/index.cgi.h:1.42.4.2	Tue Dec 16 14:01:26 2003
--- webiso/pubcookie/src/index.cgi.h	Wed Dec 17 11:37:48 2003
***************
*** 4,10 ****
   */
  
  /*
!   $Id: index.cgi.h,v 1.42.4.2 2003/12/16 22:01:26 jteaton Exp $
   */
  
  #ifndef PUBCOOKIE_LOGIN_CGI
--- 4,10 ----
   */
  
  /*
!   $Id: index.cgi.h,v 1.42.4.3 2003/12/17 19:37:48 jteaton Exp $
   */
  
  #ifndef PUBCOOKIE_LOGIN_CGI
***************
*** 81,87 ****
  /* prototypes */
  int cgiMain();
  void abend(pool *, char *);
! int cookie_test(pool *, security_context *, login_rec *, login_rec *);
  void notok(pool *, void (*)() );
  void notok_no_g_or_l(pool *);
  void print_http_header(pool *);
--- 81,87 ----
  /* prototypes */
  int cgiMain();
  void abend(pool *, char *);
! int cookie_test(pool *, const security_context *, login_rec *, login_rec *);
  void notok(pool *, void (*)() );
  void notok_no_g_or_l(pool *);
  void print_http_header(pool *);
***************
*** 98,111 ****
  void log_error(pool *,int, const char *, int, const char *, ...);
  void clear_error(pool *,const char *, const char *);
  void print_uwnetid_logo(pool *);
! login_rec *verify_unload_login_cookie (pool *, security_context *, login_rec *);
! int create_cookie(pool *, security_context *, char *, char *, char *, char, char, int, time_t, 
  		time_t, char *, const char *host, int);
  int get_cookie(pool *p, char *name, char *result, int max);
  login_rec *get_query(pool *);
  char *check_login(pool *, login_rec *, login_rec *);
! char *check_l_cookie(pool *, security_context *, login_rec *, login_rec *);
! void print_redirect_page(pool *, security_context *, login_rec *, login_rec *);
  char *url_encode(pool *, char *);
  char *get_cookie_created(pool *, char *);
  char *decode_granting_request(pool *, char *, char **peerp);
--- 98,111 ----
  void log_error(pool *,int, const char *, int, const char *, ...);
  void clear_error(pool *,const char *, const char *);
  void print_uwnetid_logo(pool *);
! login_rec *verify_unload_login_cookie (pool *, const security_context *, login_rec *);
! int create_cookie(pool *, const security_context *, char *, char *, char *, char, char, int, time_t, 
  		time_t, char *, const char *host, int);
  int get_cookie(pool *p, char *name, char *result, int max);
  login_rec *get_query(pool *);
  char *check_login(pool *, login_rec *, login_rec *);
! char *check_l_cookie(pool *, const security_context *, login_rec *, login_rec *);
! void print_redirect_page(pool *, const security_context *, login_rec *, login_rec *);
  char *url_encode(pool *, char *);
  char *get_cookie_created(pool *, char *);
  char *decode_granting_request(pool *, char *, char **peerp);


Index: webiso/pubcookie/src/security_legacy.c
diff -c webiso/pubcookie/src/security_legacy.c:1.31.2.1 webiso/pubcookie/src/security_legacy.c:1.31.2.2
*** webiso/pubcookie/src/security_legacy.c:1.31.2.1	Tue Dec  9 10:37:04 2003
--- webiso/pubcookie/src/security_legacy.c	Wed Dec 17 11:37:48 2003
***************
*** 6,12 ****
  /** @file security_legacy.c
   * Heritage message protection
   *
!  * $Id: security_legacy.c,v 1.31.2.1 2003/12/09 18:37:04 jteaton Exp $
   */
  
  
--- 6,12 ----
  /** @file security_legacy.c
   * Heritage message protection
   *
!  * $Id: security_legacy.c,v 1.31.2.2 2003/12/17 19:37:48 jteaton Exp $
   */
  
  
***************
*** 359,367 ****
  	}
  	else {
  
! 		sess_key=EVP_PKEY_new();
  		
! 		if (!EVP_PKEY_assign_RSA(sess_key,RSA_generate_key(1024,RSA_F4,NULL,NULL)))
  		{
  			pbc_log_activity(p, PBC_LOG_ERROR, 
  				"[Pubcookie_Init] Unable to find or generate session keypair.");
--- 359,367 ----
  	}
  	else {
  
! 		context->sess_key=EVP_PKEY_new();
  		
! 		if (!EVP_PKEY_assign_RSA(context->sess_key,RSA_generate_key(1024,RSA_F4,NULL,NULL)))
  		{
  			pbc_log_activity(p, PBC_LOG_ERROR, 
  				"[Pubcookie_Init] Unable to find or generate session keypair.");
***************
*** 369,375 ****
  		}
  
  		/* sess_key was assigned both public and private keys */
! 		sess_pub = sess_key;
          pbc_log_activity(p, PBC_LOG_AUDIT, 
                           "security_init: generated new session keypair.");
  	}
--- 369,375 ----
  		}
  
  		/* sess_key was assigned both public and private keys */
! 		context->sess_pub = context->sess_key;
          pbc_log_activity(p, PBC_LOG_AUDIT, 
                           "security_init: generated new session keypair.");
  	}
***************
*** 384,390 ****
  				"[Pubcookie_Init] gethostbyname failed.");
  			return -1;
  		}
! 		myname = mystrdup(p, hp->h_name);
  	}
  
  #endif
--- 384,390 ----
  				"[Pubcookie_Init] gethostbyname failed.");
  			return -1;
  		}
! 		context->myname = mystrdup(p, hp->h_name);
  	}
  
  #endif
***************
*** 511,517 ****
  
      FILE *fp;
      char keyfile[1024];
-     char *configkey;
  
      pbc_log_activity(p, PBC_LOG_DEBUG_LOW, "get_crypt_key: hello\n");
  
--- 511,516 ----



end of message


More information about the pubcookie-dev mailing list