Lines Matching refs:ad

133 	struct ad_private *ad;  in authdes_pk_seccreate()  local
144 ad = malloc(sizeof (struct ad_private)); in authdes_pk_seccreate()
145 if (ad == NULL) { in authdes_pk_seccreate()
149 ad->ad_fullname = ad->ad_servername = NULL; /* Sanity reasons */ in authdes_pk_seccreate()
150 ad->ad_timehost = NULL; in authdes_pk_seccreate()
151 ad->ad_netid = NULL; in authdes_pk_seccreate()
152 ad->ad_uaddr = NULL; in authdes_pk_seccreate()
153 ad->ad_nis_srvr = NULL; in authdes_pk_seccreate()
154 ad->ad_timediff.tv_sec = 0; in authdes_pk_seccreate()
155 ad->ad_timediff.tv_usec = 0; in authdes_pk_seccreate()
156 (void) memcpy(ad->ad_pkey, pkey->n_bytes, pkey->n_len); in authdes_pk_seccreate()
159 ad->ad_fullnamelen = RNDUP((uint_t)strlen(namebuf)); in authdes_pk_seccreate()
160 ad->ad_fullname = malloc(ad->ad_fullnamelen + 1); in authdes_pk_seccreate()
161 ad->ad_servernamelen = strlen(servername); in authdes_pk_seccreate()
162 ad->ad_servername = malloc(ad->ad_servernamelen + 1); in authdes_pk_seccreate()
164 if (ad->ad_fullname == NULL || ad->ad_servername == NULL) { in authdes_pk_seccreate()
169 ad->ad_timehost = malloc(strlen(timehost) + 1); in authdes_pk_seccreate()
170 if (ad->ad_timehost == NULL) { in authdes_pk_seccreate()
174 (void) memcpy(ad->ad_timehost, timehost, strlen(timehost) + 1); in authdes_pk_seccreate()
175 ad->ad_dosync = TRUE; in authdes_pk_seccreate()
177 ad->ad_nis_srvr = srvr; /* transient */ in authdes_pk_seccreate()
178 ad->ad_dosync = TRUE; in authdes_pk_seccreate()
180 ad->ad_dosync = FALSE; in authdes_pk_seccreate()
182 (void) memcpy(ad->ad_fullname, namebuf, ad->ad_fullnamelen + 1); in authdes_pk_seccreate()
183 (void) memcpy(ad->ad_servername, servername, ad->ad_servernamelen + 1); in authdes_pk_seccreate()
184 ad->ad_window = window; in authdes_pk_seccreate()
200 auth->ah_private = (caddr_t)ad; in authdes_pk_seccreate()
205 ad->ad_nis_srvr = NULL; /* not needed any longer */ in authdes_pk_seccreate()
211 if (ad) { in authdes_pk_seccreate()
212 if (ad->ad_fullname) in authdes_pk_seccreate()
213 free(ad->ad_fullname); in authdes_pk_seccreate()
214 if (ad->ad_servername) in authdes_pk_seccreate()
215 free(ad->ad_servername); in authdes_pk_seccreate()
216 if (ad->ad_timehost) in authdes_pk_seccreate()
217 free(ad->ad_timehost); in authdes_pk_seccreate()
218 if (ad->ad_netid) in authdes_pk_seccreate()
219 free(ad->ad_netid); in authdes_pk_seccreate()
220 if (ad->ad_uaddr) in authdes_pk_seccreate()
221 free(ad->ad_uaddr); in authdes_pk_seccreate()
222 free(ad); in authdes_pk_seccreate()
249 struct ad_private *ad = (struct ad_private *)auth->ah_private; in authdes_marshal() local
250 struct authdes_cred *cred = &ad->ad_cred; in authdes_marshal()
251 struct authdes_verf *verf = &ad->ad_verf; in authdes_marshal()
262 (void) gettimeofday(&ad->ad_timestamp, NULL); in authdes_marshal()
263 ad->ad_timestamp.tv_sec += ad->ad_timediff.tv_sec; in authdes_marshal()
264 ad->ad_timestamp.tv_usec += ad->ad_timediff.tv_usec; in authdes_marshal()
265 while (ad->ad_timestamp.tv_usec >= USEC_PER_SEC) { in authdes_marshal()
266 ad->ad_timestamp.tv_usec -= USEC_PER_SEC; in authdes_marshal()
267 ad->ad_timestamp.tv_sec++; in authdes_marshal()
275 IXDR_PUT_INT32(ixdr, ad->ad_timestamp.tv_sec); in authdes_marshal()
276 IXDR_PUT_INT32(ixdr, ad->ad_timestamp.tv_usec); in authdes_marshal()
277 if (ad->ad_cred.adc_namekind == ADN_FULLNAME) { in authdes_marshal()
278 IXDR_PUT_U_INT32(ixdr, ad->ad_window); in authdes_marshal()
279 IXDR_PUT_U_INT32(ixdr, ad->ad_window - 1); in authdes_marshal()
293 ad->ad_verf.adv_xtimestamp = cryptbuf[0]; in authdes_marshal()
294 if (ad->ad_cred.adc_namekind == ADN_FULLNAME) { in authdes_marshal()
295 ad->ad_cred.adc_fullname.window = cryptbuf[1].key.high; in authdes_marshal()
296 ad->ad_verf.adv_winverf = cryptbuf[1].key.low; in authdes_marshal()
298 ad->ad_cred.adc_nickname = ad->ad_nickname; in authdes_marshal()
299 ad->ad_verf.adv_winverf = 0; in authdes_marshal()
306 if (ad->ad_cred.adc_namekind == ADN_FULLNAME) { in authdes_marshal()
307 len = ((1 + 1 + 2 + 1)*BYTES_PER_XDR_UNIT + ad->ad_fullnamelen); in authdes_marshal()
345 struct ad_private *ad = (struct ad_private *)auth->ah_private; in authdes_validate() local
381 if (memcmp(&ad->ad_timestamp, &verf.adv_timestamp, in authdes_validate()
390 ad->ad_nickname = verf.adv_nickname; in authdes_validate()
391 ad->ad_cred.adc_namekind = ADN_NICKNAME; in authdes_validate()
403 struct ad_private *ad = (struct ad_private *)auth->ah_private; in authdes_refresh() local
404 struct authdes_cred *cred = &ad->ad_cred; in authdes_refresh()
408 if (ad->ad_dosync) { in authdes_refresh()
409 ok = __rpc_get_time_offset(&ad->ad_timediff, ad->ad_nis_srvr, in authdes_refresh()
410 ad->ad_timehost, &(ad->ad_uaddr), in authdes_refresh()
411 &(ad->ad_netid)); in authdes_refresh()
416 ad->ad_dosync = 0; in authdes_refresh()
421 ad->ad_xkey = auth->ah_key; in authdes_refresh()
422 pkey.n_bytes = (char *)(ad->ad_pkey); in authdes_refresh()
423 pkey.n_len = (uint_t)strlen((char *)ad->ad_pkey) + 1; in authdes_refresh()
424 if (key_encryptsession_pk(ad->ad_servername, &pkey, &ad->ad_xkey) < 0) { in authdes_refresh()
429 cred->adc_fullname.key = ad->ad_xkey; in authdes_refresh()
431 cred->adc_fullname.name = ad->ad_fullname; in authdes_refresh()
443 struct ad_private *ad = (struct ad_private *)auth->ah_private; in authdes_destroy() local
445 free(ad->ad_fullname); in authdes_destroy()
446 free(ad->ad_servername); in authdes_destroy()
447 if (ad->ad_timehost) in authdes_destroy()
448 free(ad->ad_timehost); in authdes_destroy()
449 if (ad->ad_netid) in authdes_destroy()
450 free(ad->ad_netid); in authdes_destroy()
451 if (ad->ad_uaddr) in authdes_destroy()
452 free(ad->ad_uaddr); in authdes_destroy()
453 free(ad); in authdes_destroy()