- /*
- * If it's not continued, just create the normal
- * attribute.
- */
- if (!flag) {
- vp = paircreate(attribute, PW_TYPE_OCTETS);
- if (!vp) return NULL;
-
- if (!data2vp(packet, original, secret,
- attribute, length, data, vp)) {
- pairfree(&vp);
- return NULL;
- }
- } else {
- /*
- * Non-TLV types cannot be continued
- * across multiple attributes. This is
- * true even of keys that are encrypted
- * with the tunnel-password method. The
- * spec says that they can be
- * continued... but also that the keys
- * are 160 bits, which means that they
- * CANNOT be continued. <sigh>
- */
- not_well_formed:
- if (tlv_data == data) { /* true if we had 'goto' */
- tlv_data = malloc(tlv_length);
- if (!tlv_data) return NULL;
- memcpy(tlv_data, data, tlv_length);
- }
-
- vp = paircreate(attribute, PW_TYPE_OCTETS);
- if (!vp) return NULL;
-
- vp->type = PW_TYPE_TLV;
- vp->flags.encrypt = FLAG_ENCRYPT_NONE;
- vp->flags.has_tag = 0;
- vp->flags.is_tlv = 0;
- vp->vp_tlv = tlv_data;
- vp->length = tlv_length;
+ not_well_formed:
+ if (tlv_data == data) { /* true if we had 'goto' */
+ tlv_data = malloc(tlv_length);
+ if (!tlv_data) return NULL;
+ memcpy(tlv_data, data, tlv_length);