112 lines
3.0 KiB
Java
112 lines
3.0 KiB
Java
|
package com.google.android.gms.internal.p002firebaseauthapi;
|
||
|
|
||
|
import java.security.GeneralSecurityException;
|
||
|
import java.util.Iterator;
|
||
|
|
||
|
/* loaded from: classes2.dex */
|
||
|
public final class zzbi {
|
||
|
private final zzoc zza;
|
||
|
|
||
|
public static zzbi zze() {
|
||
|
return new zzbi(zzof.zzc());
|
||
|
}
|
||
|
|
||
|
public static zzbi zzf(zzbh zzbhVar) {
|
||
|
return new zzbi((zzoc) zzbhVar.zzc().zzu());
|
||
|
}
|
||
|
|
||
|
private final int zzg() {
|
||
|
int zza;
|
||
|
synchronized (this) {
|
||
|
zza = zzhj.zza();
|
||
|
while (zzj(zza)) {
|
||
|
zza = zzhj.zza();
|
||
|
}
|
||
|
}
|
||
|
return zza;
|
||
|
}
|
||
|
|
||
|
private final zzoe zzh(zzns zznsVar, zzoy zzoyVar) throws GeneralSecurityException {
|
||
|
zzoe zzoeVar;
|
||
|
synchronized (this) {
|
||
|
int zzg = zzg();
|
||
|
if (zzoyVar == zzoy.UNKNOWN_PREFIX) {
|
||
|
throw new GeneralSecurityException("unknown output prefix type");
|
||
|
}
|
||
|
zzod zzc = zzoe.zzc();
|
||
|
zzc.zza(zznsVar);
|
||
|
zzc.zzb(zzg);
|
||
|
zzc.zzd(3);
|
||
|
zzc.zzc(zzoyVar);
|
||
|
zzoeVar = (zzoe) zzc.zzi();
|
||
|
}
|
||
|
return zzoeVar;
|
||
|
}
|
||
|
|
||
|
private final zzoe zzi(zznx zznxVar) throws GeneralSecurityException {
|
||
|
zzoe zzh;
|
||
|
synchronized (this) {
|
||
|
zzh = zzh(zzbz.zzc(zznxVar), zznxVar.zzd());
|
||
|
}
|
||
|
return zzh;
|
||
|
}
|
||
|
|
||
|
private final boolean zzj(int i) {
|
||
|
synchronized (this) {
|
||
|
Iterator it = this.zza.zze().iterator();
|
||
|
while (it.hasNext()) {
|
||
|
if (((zzoe) it.next()).zza() == i) {
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Deprecated
|
||
|
public final int zza(zznx zznxVar, boolean z) throws GeneralSecurityException {
|
||
|
int zza;
|
||
|
synchronized (this) {
|
||
|
zzoe zzi = zzi(zznxVar);
|
||
|
this.zza.zzb(zzi);
|
||
|
zza = zzi.zza();
|
||
|
}
|
||
|
return zza;
|
||
|
}
|
||
|
|
||
|
public final zzbh zzb() throws GeneralSecurityException {
|
||
|
zzbh zza;
|
||
|
synchronized (this) {
|
||
|
zza = zzbh.zza((zzof) this.zza.zzi());
|
||
|
}
|
||
|
return zza;
|
||
|
}
|
||
|
|
||
|
public final zzbi zzc(zzbf zzbfVar) throws GeneralSecurityException {
|
||
|
synchronized (this) {
|
||
|
zza(zzbfVar.zza(), false);
|
||
|
}
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
public final zzbi zzd(int i) throws GeneralSecurityException {
|
||
|
synchronized (this) {
|
||
|
for (int i2 = 0; i2 < this.zza.zza(); i2++) {
|
||
|
zzoe zzd = this.zza.zzd(i2);
|
||
|
if (zzd.zza() == i) {
|
||
|
if (zzd.zzk() != 3) {
|
||
|
throw new GeneralSecurityException("cannot set key as primary because it's not enabled: " + i);
|
||
|
}
|
||
|
this.zza.zzc(i);
|
||
|
}
|
||
|
}
|
||
|
throw new GeneralSecurityException("key not found: " + i);
|
||
|
}
|
||
|
return this;
|
||
|
}
|
||
|
|
||
|
private zzbi(zzoc zzocVar) {
|
||
|
this.zza = zzocVar;
|
||
|
}
|
||
|
}
|