Ethereal-dev: [Ethereal-dev] [PATCH] (packet-ldap.c) Fix incorrect BER tag for newSuperior in

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Jason Greene <jason@xxxxxxxxxxxxx>
Date: 25 Nov 2002 00:46:26 -0600
Hello, 

This patch fixes decoding of the newSuperior attribute of an LDAPv3
modrdn request. The current implementation attempts to decode the
attribute as an LDAPDN (Octext String, 0x4), when its definition is
actually Context 0 (0x80).

>From the RFC:

ModifyDNRequest ::= [APPLICATION 12] SEQUENCE {
    entry           LDAPDN,
    newrdn          RelativeLDAPDN,
    deleteoldrdn    BOOLEAN,
    newSuperior     [0] LDAPDN OPTIONAL
}

Thanks,
-Jason


--
Jason Greene <jason@xxxxxxxxxxxxx
             <jason@xxxxxxx>

My computer can beat up your computer.
- Karl Lehenbauer
Index: packet-ldap.c
===================================================================
RCS file: /cvsroot/ethereal/packet-ldap.c,v
retrieving revision 1.48
diff -u -r1.48 packet-ldap.c
--- packet-ldap.c	2002/11/12 21:37:22	1.48
+++ packet-ldap.c	2002/11/25 06:17:50
@@ -1231,7 +1231,8 @@
 
   if (a->offset < (int) (start + length)) {
     /* LDAP V3 Modify DN operation, with newSuperior */
-    if (read_string(a, tree, hf_ldap_message_modrdn_superior, 0, 0, ASN1_UNI, ASN1_OTS) != ASN1_ERR_NOERROR)
+    /*      "newSuperior     [0] LDAPDN OPTIONAL" (0x80) */
+    if (read_string(a, tree, hf_ldap_message_modrdn_superior, 0, 0, ASN1_CTX, 0) != ASN1_ERR_NOERROR)
       return;
   }
 }