public void ClearPtr() { mCred = null; }
static unsafe apr_hash_t clone_credentials(apr_hash_t from, apr_hash_t to, AprPool pool) { if (from == null) { throw new ArgumentNullException(nameof(from)); } if (pool == null) { throw new ArgumentNullException(nameof(pool)); } // to can be null apr_hash_t hash_to = to ?? apr_hash.apr_hash_make(pool.Handle); sbyte * pKey; long len = default; void * pValue; void * pNewValue; using (var tmpPool = new AprPool(pool)) { for (var hi = apr_hash.apr_hash_first(tmpPool.Handle, from); hi != null; hi = apr_hash.apr_hash_next(hi)) { apr_hash.apr_hash_this(hi, (void **)&pKey, ref len, &pValue); pNewValue = null; if (pValue == null) { continue; } #if IMPLEMENTED if (MatchPrefix(pKey, Constants.SVN_AUTH_CRED_SIMPLE)) { pNewValue = clone_cred_usernamepassword((const svn_auth_cred_simple_t *)pValue, pool); } else if (MatchPrefix(pKey, Constants.SVN_AUTH_CRED_USERNAME)) { pNewValue = clone_cred_username((const svn_auth_cred_username_t *)pValue, pool); } else if (MatchPrefix(pKey, Constants.SVN_AUTH_CRED_SSL_CLIENT_CERT)) { pNewValue = clone_cred_ssl_clientcert((const svn_auth_cred_ssl_client_cert_t *)pValue, pool); } else if (MatchPrefix(pKey, Constants.SVN_AUTH_CRED_SSL_CLIENT_CERT_PW)) { pNewValue = clone_cred_ssl_clientcertpw((const svn_auth_cred_ssl_client_cert_pw_t *)pValue, pool); } else if (MatchPrefix(pKey, Constants.SVN_AUTH_CRED_SSL_SERVER_TRUST)) { pNewValue = clone_cred_ssl_servercert((const svn_auth_cred_ssl_server_trust_t *)pValue, pool); } /* else: Unknown -> Don't copy */ if (pNewValue != null) { // Create a 0 terminated copy of key char *pNewKey = (char *)apr_pcalloc(pool->Handle, len + 1); memcpy(pNewKey, pKey, len); apr_hash_set(hash_to, pNewKey, len, pNewValue); } #endif // IMPLEMENTED throw new NotImplementedException(); } } return(hash_to); }
public SvnAuthCredSslClientCertPw(IntPtr ptr) { mCred = (svn_auth_cred_ssl_client_cert_pw_t *) ptr.ToPointer(); }
private SvnAuthCredSslClientCertPw(svn_auth_cred_ssl_client_cert_pw_t *ptr) { mCred = ptr; }
public void ClearPtr() { mCred = null; }
private SvnAuthCredSslClientCertPw(svn_auth_cred_ssl_client_cert_pw_t *ptr) { mCred = ptr; }
public SvnAuthCredSslClientCertPw(IntPtr ptr) { mCred = (svn_auth_cred_ssl_client_cert_pw_t *) ptr.ToPointer(); }