[112] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

bugs in pepsy 6.8 support code

daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Wed Mar 20 10:47:24 1991

Date: Wed, 20 Mar 91 10:47:03 EST
From: John T Kohl <jtkohl@MIT.EDU>
To: bug-isode@nisc.psi.net
Cc: krb5-bugs@MIT.EDU

The support code for pepsy 6.8 ASN.1 parsing/encoding does not properly
process the "optionals" field used for optional basic types in sequences
(among other things).

Attached are patches that make it work for my uses; I am not completely
confident that this fixes it for all cases, but it's a good start.

All files are in the pepsy/ subdirectory from the isode 6.8 (interim)
distribution.

RCS file: RCS/dec.c,v
retrieving revision 1.1
diff -c -r1.1 dec.c
*** /tmp/,RCSt1a05488	Wed Mar 20 10:46:00 1991
--- dec.c	Wed Mar 20 10:45:32 1991
***************
*** 683,688 ****
--- 683,689 ----
  	    case REALTYPE:
  	    case BOOLEAN:
  	    case T_NULL:
+ 	    basictype:
  		if (pe == NULLPE || CHKTAG(mod, p, pe) == 0) {
  		    optcnt++;
  		    goto next;
***************
*** 690,695 ****
--- 691,705 ----
  		SETBIT(*popt, optcnt++);
  		break;
  
+ 	    case ETAG:			/* XXX ? optional things in seq's? */
+ 		switch (p[1].pe_type) {
+ 		case INTEGER:
+ 		case REALTYPE:
+ 		case BOOLEAN:
+ 		case T_NULL:
+ 		    goto basictype;
+ 		}
+ 		/* else fall through... */
  
  	    default:
  		if (pe == NULLPE || CHKTAG(mod, p, pe) == 0) {
===================================================================
RCS file: RCS/enc.c,v
retrieving revision 1.1
diff -c -r1.1 enc.c
*** /tmp/,RCSt1a05488	Wed Mar 20 10:46:01 1991
--- enc.c	Wed Mar 20 10:27:45 1991
***************
*** 564,570 ****
  		break;
  
  	    case FN_CALL:
! 		if ((val = hasdata(parm, p, mod, popt, optcnt)) == NOTOK)
  		    goto bad;
  		if (val == 0)
  		    goto next;
--- 564,570 ----
  		break;
  
  	    case FN_CALL:
! 		if ((val = hasdata(parm, p, mod, popt, &optcnt)) == NOTOK)
  		    goto bad;
  		if (val == 0)
  		    goto next;
***************
*** 571,577 ****
  		break;
  
  	    case ETAG:
! 		if ((val = hasdata(parm, p + 1, mod, popt, optcnt)) == NOTOK)
  		    goto bad;
  		if (val == 0)
  		    goto next;
--- 571,577 ----
  		break;
  
  	    case ETAG:
! 		if ((val = hasdata(parm, p + 1, mod, popt, &optcnt)) == NOTOK)
  		    goto bad;
  		if (val == 0)
  		    goto next;
***************
*** 749,755 ****
  		break;
  
  	    case FN_CALL:
! 		if ((val = hasdata(parm, p, mod, popt, optcnt)) == NOTOK)
  		    goto bad;
  		if (val == 0)
  		    goto next;
--- 749,755 ----
  		break;
  
  	    case FN_CALL:
! 		if ((val = hasdata(parm, p, mod, popt, &optcnt)) == NOTOK)
  		    goto bad;
  		if (val == 0)
  		    goto next;
***************
*** 756,762 ****
  		break;
  
  	    case ETAG:
! 		if ((val = hasdata(parm, p + 1, mod, popt, optcnt)) == NOTOK)
  		    goto bad;
  		if (val == 0)
  		    goto next;
--- 756,762 ----
  		break;
  
  	    case ETAG:
! 		if ((val = hasdata(parm, p + 1, mod, popt, &optcnt)) == NOTOK)
  		    goto bad;
  		if (val == 0)
  		    goto next;
RCS file: RCS/util.c,v
retrieving revision 1.2
diff -c -r1.2 util.c
*** /tmp/,RCSt1a05488	Wed Mar 20 10:46:07 1991
--- util.c	Wed Mar 20 10:27:44 1991
***************
*** 398,404 ****
  PEPYPARM parm;
  tpe    *p;
  modtyp *mod;			/* Module it is from */
! int    *popt, optcnt;
  {
      int	val;
  
--- 398,404 ----
  PEPYPARM parm;
  tpe    *p;
  modtyp *mod;			/* Module it is from */
! int    *popt, *optcnt;
  {
      int	val;
  
***************
*** 414,420 ****
  		goto next;
  	    break;
  	}
! 	if (!TESTBIT(*popt, optcnt++))
  	    goto next;		/* Missing so skip */
  	break;
  
--- 414,420 ----
  		goto next;
  	    break;
  	}
! 	if (!TESTBIT(*popt, (*optcnt)++))
  	    goto next;		/* Missing so skip */
  	break;
  

home help back first fref pref prev next nref lref last post